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.

17 lines
381 B

4 years ago
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = isModule;
  6. function isModule(path) {
  7. const {
  8. sourceType
  9. } = path.node;
  10. if (sourceType !== "module" && sourceType !== "script") {
  11. throw path.buildCodeFrameError(`Unknown sourceType "${sourceType}", cannot transform.`);
  12. }
  13. return path.node.sourceType === "module";
  14. }