MCPcopy Create free account
hub / github.com/Azure/powershell / testSet

Function testSet

lib/index.js:6600–6634  ·  view source on GitHub ↗
(set, version, options)

Source from the content-addressed store, hash-verified

6598}
6599
6600function testSet (set, version, options) {
6601 for (var i = 0; i < set.length; i++) {
6602 if (!set[i].test(version)) {
6603 return false
6604 }
6605 }
6606
6607 if (version.prerelease.length && !options.includePrerelease) {
6608 // Find the set of versions that are allowed to have prereleases
6609 // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
6610 // That should allow `1.2.3-pr.2` to pass.
6611 // However, `1.2.4-alpha.notready` should NOT be allowed,
6612 // even though it's within the range set by the comparators.
6613 for (i = 0; i < set.length; i++) {
6614 debug(set[i].semver)
6615 if (set[i].semver === ANY) {
6616 continue
6617 }
6618
6619 if (set[i].semver.prerelease.length > 0) {
6620 var allowed = set[i].semver
6621 if (allowed.major === version.major &&
6622 allowed.minor === version.minor &&
6623 allowed.patch === version.patch) {
6624 return true
6625 }
6626 }
6627 }
6628
6629 // Version has a -pre, but it's not one of the ones we like.
6630 return false
6631 }
6632
6633 return true
6634}
6635
6636exports.satisfies = satisfies
6637function satisfies (version, range, options) {

Callers 1

index.jsFile · 0.85

Calls 1

debugFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…