mirror of
https://github.com/Sevichecc/Urara-Blog.git
synced 2025-05-02 20:09:30 +08:00
36 lines
No EOL
1,017 B
Text
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);
|
|
}
|
|
});
|
|
} |