MCPcopy
hub / github.com/npm/node-semver / isSatisfiable

Function isSatisfiable

classes/range.js:245–259  ·  view source on GitHub ↗
(comparators, options)

Source from the content-addressed store, hash-verified

243// take a set of comparators and determine whether there
244// exists a version which can satisfy it
245const isSatisfiable = (comparators, options) => {
246 let result = true
247 const remainingComparators = comparators.slice()
248 let testComparator = remainingComparators.pop()
249
250 while (result && remainingComparators.length) {
251 result = remainingComparators.every((otherComparator) => {
252 return testComparator.intersects(otherComparator, options)
253 })
254
255 testComparator = remainingComparators.pop()
256 }
257
258 return result
259}
260
261// comprised of xranges, tildes, stars, and gtlt's at this point.
262// already replaced the hyphen ranges

Callers 1

intersectsMethod · 0.85

Calls 1

intersectsMethod · 0.45

Tested by

no test coverage detected