(string: string)
| 332 | } |
| 333 | |
| 334 | function parseOperatorRange(string: string): Comparator | Comparator[] | null { |
| 335 | const groups = string.match(OPERATOR_XRANGE_REGEXP) |
| 336 | ?.groups as RangeRegExpGroups; |
| 337 | if (!groups) return parseComparator(string); |
| 338 | |
| 339 | switch (groups.operator) { |
| 340 | case "^": |
| 341 | return handleCaretOperator(groups); |
| 342 | case "~": |
| 343 | case "~>": |
| 344 | return handleTildeOperator(groups); |
| 345 | case "<": |
| 346 | return handleLessThanOperator(groups); |
| 347 | case "<=": |
| 348 | return handleLessThanOrEqualOperator(groups); |
| 349 | case ">": |
| 350 | return handleGreaterThanOperator(groups); |
| 351 | case ">=": |
| 352 | return handleGreaterOrEqualOperator(groups); |
| 353 | default: |
| 354 | return handleEqualOperator(groups); |
| 355 | } |
| 356 | } |
| 357 | function parseOperatorRanges(string: string): (Comparator | null)[] { |
| 358 | return string.split(/\s+/).flatMap(parseOperatorRange); |
| 359 | } |
nothing calls this directly
no test coverage detected