UNPKG

739 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = void 0;
7var _helperPluginUtils = require("@babel/helper-plugin-utils");
8var _core = require("@babel/core");
9var _default = (0, _helperPluginUtils.declare)(api => {
10 api.assertVersion(7);
11 return {
12 name: "transform-strict-mode",
13 visitor: {
14 Program(path) {
15 const {
16 node
17 } = path;
18 for (const directive of node.directives) {
19 if (directive.value.value === "use strict") return;
20 }
21 path.unshiftContainer("directives", _core.types.directive(_core.types.directiveLiteral("use strict")));
22 }
23 }
24 };
25});
26exports.default = _default;
27
28//# sourceMappingURL=index.js.map