@babel/plugin-syntax-typescript
Advanced tools
Comparing version 7.20.0 to 7.21.4
@@ -7,53 +7,51 @@ "use strict"; | ||
exports.default = void 0; | ||
var _helperPluginUtils = require("@babel/helper-plugin-utils"); | ||
function removePlugin(plugins, name) { | ||
const indices = []; | ||
plugins.forEach((plugin, i) => { | ||
const n = Array.isArray(plugin) ? plugin[0] : plugin; | ||
if (n === name) { | ||
indices.unshift(i); | ||
{ | ||
var removePlugin = function (plugins, name) { | ||
const indices = []; | ||
plugins.forEach((plugin, i) => { | ||
const n = Array.isArray(plugin) ? plugin[0] : plugin; | ||
if (n === name) { | ||
indices.unshift(i); | ||
} | ||
}); | ||
for (const i of indices) { | ||
plugins.splice(i, 1); | ||
} | ||
}); | ||
for (const i of indices) { | ||
plugins.splice(i, 1); | ||
} | ||
}; | ||
} | ||
var _default = (0, _helperPluginUtils.declare)((api, { | ||
disallowAmbiguousJSXLike, | ||
dts, | ||
isTSX | ||
}) => { | ||
var _default = (0, _helperPluginUtils.declare)((api, opts) => { | ||
api.assertVersion(7); | ||
const { | ||
disallowAmbiguousJSXLike, | ||
dts | ||
} = opts; | ||
{ | ||
var { | ||
isTSX | ||
} = opts; | ||
} | ||
return { | ||
name: "syntax-typescript", | ||
manipulateOptions(opts, parserOpts) { | ||
const { | ||
plugins | ||
} = parserOpts; | ||
removePlugin(plugins, "flow"); | ||
removePlugin(plugins, "jsx"); | ||
plugins.push(["typescript", { | ||
{ | ||
const { | ||
plugins | ||
} = parserOpts; | ||
removePlugin(plugins, "flow"); | ||
removePlugin(plugins, "jsx"); | ||
plugins.push("objectRestSpread", "classProperties"); | ||
if (isTSX) { | ||
plugins.push("jsx"); | ||
} | ||
} | ||
parserOpts.plugins.push(["typescript", { | ||
disallowAmbiguousJSXLike, | ||
dts | ||
}], "classProperties"); | ||
{ | ||
plugins.push("objectRestSpread"); | ||
} | ||
if (isTSX) { | ||
plugins.push("jsx"); | ||
} | ||
}]); | ||
} | ||
}; | ||
}); | ||
exports.default = _default; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@babel/plugin-syntax-typescript", | ||
"version": "7.20.0", | ||
"version": "7.21.4", | ||
"description": "Allow parsing of TypeScript syntax", | ||
@@ -21,3 +21,3 @@ "repository": { | ||
"dependencies": { | ||
"@babel/helper-plugin-utils": "^7.19.0" | ||
"@babel/helper-plugin-utils": "^7.20.2" | ||
}, | ||
@@ -28,3 +28,3 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"@babel/core": "^7.19.6", | ||
"@babel/core": "^7.21.4", | ||
"@babel/helper-plugin-test-runner": "^7.18.6" | ||
@@ -31,0 +31,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6856
54