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

Function complement

packages/effect/src/IgnoreFile.ts:660–673  ·  view source on GitHub ↗
(ranges: ReadonlyArray<number>)

Source from the content-addressed store, hash-verified

658
659// Sorted, non-overlapping ranges, as the POSIX tables are
660const complement = (ranges: ReadonlyArray<number>): Array<number> => {
661 const out: Array<number> = []
662 let next = 0
663 for (let i = 0; i < ranges.length; i += 2) {
664 if (ranges[i] > next) {
665 out.push(next, ranges[i] - 1)
666 }
667 next = ranges[i + 1] + 1
668 }
669 if (next <= 0x10ffff) {
670 out.push(next, 0x10ffff)
671 }
672 return out
673}
674
675const isAsciiAlphanumeric = (char: string): boolean => /^[A-Za-z0-9]$/.test(char)
676

Callers 1

parseDockerClassFunction · 0.85

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected