MCPcopy Create free account
hub / github.com/denoland/std / parseComparator

Function parseComparator

semver/parse_range.ts:23–31  ·  view source on GitHub ↗
(comparator: string)

Source from the content-addressed store, hash-verified

21};
22
23function parseComparator(comparator: string): Comparator | null {
24 const match = comparator.match(COMPARATOR_REGEXP);
25 const groups = match?.groups;
26
27 if (!groups) return null;
28
29 const { operator } = groups as ComparatorRegExpGroup;
30 return { operator: operator || undefined, ...ANY };
31}
32
33function isWildcard(id?: string): boolean {
34 return !id || id.toLowerCase() === "x" || id === "*";

Callers 1

parseOperatorRangeFunction · 0.85

Calls 1

matchMethod · 0.80

Tested by

no test coverage detected