You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
728 B

4 years ago
  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
  21. ? dep.range[0] - 1
  22. : dep.rangeStatement[1] - 1;
  23. source.replace(dep.rangeStatement[0], replaceUntil, content);
  24. }
  25. };
  26. module.exports = HarmonyExportHeaderDependency;