MCPcopy Create free account
hub / github.com/Effect-TS/effect / compile

Function compile

packages/effect/src/SemVerRange.ts:558–566  ·  view source on GitHub ↗
(self: SemVerRangeImpl, includePrerelease: boolean)

Source from the content-addressed store, hash-verified

556}
557
558const compile = (self: SemVerRangeImpl, includePrerelease: boolean): (version: SemVer) => boolean => {
559 const sets = self.sets.map((set) => set.flatMap((comparator) => expand(comparator, includePrerelease)))
560 return (version) =>
561 sets.some((bounds) =>
562 bounds.every((bound) => testBound(bound, version)) &&
563 (includePrerelease || version.prerelease.length === 0 ||
564 bounds.some((bound) => bound.prerelease.length > 0 && sameCore(bound, version)))
565 )
566}
567
568const matcher = (range: SemVerRange, options: MatchOptions | undefined): (version: SemVer) => boolean => {
569 const self = range as SemVerRangeImpl

Callers 7

matcherFunction · 0.70
getParserMethod · 0.70
compileMembersMethod · 0.70
parserMethod · 0.70
parseCaseFunction · 0.50
guardCaseFunction · 0.50
assertParseCaseFunction · 0.50

Calls 5

sameCoreFunction · 0.90
testBoundFunction · 0.85
someMethod · 0.80
expandFunction · 0.70
mapMethod · 0.45

Tested by

no test coverage detected