UNPKG

381 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = isModule;
7
8function isModule(path) {
9 const {
10 sourceType
11 } = path.node;
12
13 if (sourceType !== "module" && sourceType !== "script") {
14 throw path.buildCodeFrameError(`Unknown sourceType "${sourceType}", cannot transform.`);
15 }
16
17 return path.node.sourceType === "module";
18}
\No newline at end of file