-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
18 additions
and
21 deletions.
There are no files selected for viewing
7 changes: 3 additions & 4 deletions
7
packages/core-js-compat/get-modules-list-for-target-version.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
'use strict'; | ||
const data = require('./data'); | ||
const { coerce: semver, cmp } = require('semver'); | ||
const data = require('./src/data'); | ||
|
||
const modules = Object.keys(data); | ||
|
||
function compare(a, operator, b) { | ||
return cmp(semver(a), operator, semver(b)); | ||
} | ||
|
||
function normalizeModulesList(list, order) { | ||
const set = new Set(list); | ||
return (Array.isArray(order) ? order : modules).filter(name => set.has(name)); | ||
} | ||
|
||
module.exports = { | ||
compare, | ||
normalizeModulesList, | ||
semver, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters