MCPcopy Create free account
hub / github.com/arktypeio/arktype / commaBetween

Function commaBetween

ark/aot/flat.ts:2533–2543  ·  view source on GitHub ↗
(
	code: string,
	start: number,
	end: number
)

Source from the content-addressed store, hash-verified

2531
2532// the comma separating two elements, past their parentheses and comments
2533const commaBetween = (
2534 code: string,
2535 start: number,
2536 end: number
2537): number | undefined => {
2538 for (let i = start; i < end; i++) {
2539 if (code[i] === ",") return i
2540 if (code.startsWith("/*", i)) i = code.indexOf("*/", i + 2) + 1
2541 else if (code.startsWith("//", i)) i = code.indexOf("\n", i)
2542 }
2543}

Callers 1

writeFlatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected