aboutsummaryrefslogtreecommitdiff
path: root/node_modules/@babel/helper-module-imports/lib/is-module.js
blob: bdb24c33feca08df7a8e94bb5fd69d3670add228 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = isModule;

function isModule(path) {
  const sourceType = path.node.sourceType;

  if (sourceType !== "module" && sourceType !== "script") {
    throw path.buildCodeFrameError(`Unknown sourceType "${sourceType}", cannot transform.`);
  }

  return path.node.sourceType === "module";
}