@yarnpkg/core
Advanced tools
Comparing version 4.1.2 to 4.1.3
@@ -182,3 +182,3 @@ "use strict"; | ||
function simplifyRanges(ranges) { | ||
const parsedRanges = ranges.map(range => validRange(range).set.map(comparators => comparators.map(comparator => getComparator(comparator)))); | ||
const parsedRanges = ranges.map(removeSubsets).map(range => validRange(range).set.map(comparators => comparators.map(comparator => getComparator(comparator)))); | ||
let alternatives = parsedRanges.shift().map(comparators => mergeComparators(comparators)) | ||
@@ -205,1 +205,17 @@ .filter((range) => range !== null); | ||
} | ||
function removeSubsets(rangeString) { | ||
const parts = rangeString.split(`||`); | ||
if (parts.length > 1) { | ||
const newParts = new Set(); | ||
for (const potentialSubset of parts) { | ||
if (!parts.some(part => part !== potentialSubset && semver_1.default.subset(potentialSubset, part))) { | ||
newParts.add(potentialSubset); | ||
} | ||
} | ||
if (newParts.size < parts.length) { | ||
const newRange = [...newParts].join(` || `); | ||
return newRange; | ||
} | ||
} | ||
return rangeString; | ||
} |
{ | ||
"name": "@yarnpkg/core", | ||
"version": "4.1.2", | ||
"version": "4.1.3", | ||
"license": "BSD-2-Clause", | ||
@@ -18,3 +18,3 @@ "main": "./lib/index.js", | ||
"@yarnpkg/parsers": "^3.0.2", | ||
"@yarnpkg/shell": "^4.0.2", | ||
"@yarnpkg/shell": "^4.1.0", | ||
"camelcase": "^5.3.1", | ||
@@ -53,3 +53,3 @@ "chalk": "^3.0.0", | ||
"@types/tunnel": "^0.0.0", | ||
"@yarnpkg/cli": "^4.4.0", | ||
"@yarnpkg/cli": "^4.5.0", | ||
"@yarnpkg/plugin-link": "^3.0.0", | ||
@@ -56,0 +56,0 @@ "@yarnpkg/plugin-npm": "^3.0.1", |
Sorry, the diff of this file is too big to display
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
800815
14787
Updated@yarnpkg/shell@^4.1.0