HarmonyExportHeaderDependency.js 750 B

12345678910111213141516171819202122232425262728
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. const NullDependency = require("./NullDependency");
  7. class HarmonyExportHeaderDependency extends NullDependency {
  8. constructor(range, rangeStatement) {
  9. super();
  10. this.range = range;
  11. this.rangeStatement = rangeStatement;
  12. }
  13. get type() {
  14. return "harmony export header";
  15. }
  16. }
  17. HarmonyExportHeaderDependency.Template = class HarmonyExportDependencyTemplate {
  18. apply(dep, source) {
  19. const content = "";
  20. const replaceUntil = dep.range ? dep.range[0] - 1 : dep.rangeStatement[1] - 1;
  21. source.replace(dep.rangeStatement[0], replaceUntil, content);
  22. }
  23. };
  24. module.exports = HarmonyExportHeaderDependency;