source: imaps-frontend/node_modules/@babel/plugin-syntax-import-attributes/lib/index.js

main
Last change on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 1.3 KB
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = void 0;
7var _helperPluginUtils = require("@babel/helper-plugin-utils");
8var _default = exports.default = (0, _helperPluginUtils.declare)((api, {
9 deprecatedAssertSyntax
10}) => {
11 api.assertVersion("^7.22.0 || >8.0.0-alpha <8.0.0-beta");
12 if (deprecatedAssertSyntax != null && typeof deprecatedAssertSyntax !== "boolean") {
13 throw new Error("'deprecatedAssertSyntax' must be a boolean, if specified.");
14 }
15 return {
16 name: "syntax-import-attributes",
17 manipulateOptions({
18 parserOpts,
19 generatorOpts
20 }) {
21 var _generatorOpts$import;
22 (_generatorOpts$import = generatorOpts.importAttributesKeyword) != null ? _generatorOpts$import : generatorOpts.importAttributesKeyword = "with";
23 const importAssertionsPluginIndex = parserOpts.plugins.indexOf("importAssertions");
24 if (importAssertionsPluginIndex !== -1) {
25 parserOpts.plugins.splice(importAssertionsPluginIndex, 1);
26 deprecatedAssertSyntax = true;
27 }
28 if (deprecatedAssertSyntax) {
29 parserOpts.plugins.push("deprecatedImportAssert", ["importAttributes", {
30 deprecatedAssertSyntax: true
31 }]);
32 } else {
33 parserOpts.plugins.push("importAttributes");
34 }
35 }
36 };
37});
38
39//# sourceMappingURL=index.js.map
Note: See TracBrowser for help on using the repository browser.