Urara-Blog/node_modules/.pnpm-store/v3/files/33/248c8f1fd0e489a409b3029f669e8c536d03f09a0d689b9f1f2747962b5510ea35b2e0d36634f0a34983f997715f98ab423839cbdb1c20d93f91b43da1eefe
2022-08-14 01:14:53 +08:00

36 lines
No EOL
1,017 B
Text

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addProposalSyntaxPlugins = addProposalSyntaxPlugins;
exports.removeUnnecessaryItems = removeUnnecessaryItems;
exports.removeUnsupportedItems = removeUnsupportedItems;
var _semver = require("semver");
var _availablePlugins = require("./available-plugins");
const has = Function.call.bind(Object.hasOwnProperty);
function addProposalSyntaxPlugins(items, proposalSyntaxPlugins) {
proposalSyntaxPlugins.forEach(plugin => {
items.add(plugin);
});
}
function removeUnnecessaryItems(items, overlapping) {
items.forEach(item => {
var _overlapping$item;
(_overlapping$item = overlapping[item]) == null ? void 0 : _overlapping$item.forEach(name => items.delete(name));
});
}
function removeUnsupportedItems(items, babelVersion) {
items.forEach(item => {
if (has(_availablePlugins.minVersions, item) && _semver.lt(babelVersion, _availablePlugins.minVersions[item])) {
items.delete(item);
}
});
}