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

Method intersects

classes/range.js:173–193  ·  view source on GitHub ↗
(range, options)

Source from the content-addressed store, hash-verified

171 }
172
173 intersects (range, options) {
174 if (!(range instanceof Range)) {
175 throw new TypeError('a Range is required')
176 }
177
178 return this.set.some((thisComparators) => {
179 return (
180 isSatisfiable(thisComparators, options) &&
181 range.set.some((rangeComparators) => {
182 return (
183 isSatisfiable(rangeComparators, options) &&
184 thisComparators.every((thisComparator) => {
185 return rangeComparators.every((rangeComparator) => {
186 return thisComparator.intersects(rangeComparator, options)
187 })
188 })
189 )
190 })
191 )
192 })
193 }
194
195 // if ANY of the sets match ALL of its comparators, then pass
196 test (version) {

Callers 5

isSatisfiableFunction · 0.45
comparator.jsFile · 0.45
range.jsFile · 0.45
intersects.jsFile · 0.45
intersectsFunction · 0.45

Calls 1

isSatisfiableFunction · 0.85

Tested by

no test coverage detected