Skip to content

Commit

Permalink
refactor: use Set for proposalPlugins
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Apr 20, 2020
1 parent eb9bd81 commit b094064
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/babel-preset-env/data/shipped-proposals.js
Expand Up @@ -2,9 +2,9 @@
// These mappings represent the syntax proposals that have been
// shipped by browsers, and are enabled by the `shippedProposals` option.

const proposalPlugins = {
"proposal-numeric-separator": true
};
const proposalPlugins = new Set([
"proposal-numeric-separator",
]);

// use intermediary object to enforce alphabetical key order
const pluginSyntaxObject = {
Expand Down
4 changes: 2 additions & 2 deletions packages/babel-preset-env/src/utils.js
Expand Up @@ -28,10 +28,10 @@ export function intersection<T>(

export function filterStageFromList(
list: { [feature: string]: Targets },
stageList: { [feature: string]: boolean },
stageList: Set<string>,
) {
return Object.keys(list).reduce((result, item) => {
if (!stageList[item]) {
if (!stageList.has(item)) {
result[item] = list[item];
}

Expand Down

0 comments on commit b094064

Please sign in to comment.