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

Function segmentAt

ark/aot/host.ts:636–646  ·  view source on GitHub ↗
(
	line: SourceMapSegment[] | undefined,
	column: number
)

Source from the content-addressed store, hash-verified

634
635// the last segment starting at or before the column, sorted by column
636const segmentAt = (
637 line: SourceMapSegment[] | undefined,
638 column: number
639): [number, number, number, number] | undefined => {
640 let mapped: SourceMapSegment | undefined
641 for (const segment of line ?? []) {
642 if (segment[0] > column) break
643 mapped = segment
644 }
645 return mapped?.length === 1 ? undefined : (mapped as never)
646}
647
648export const specifierOf = (importer: string, file: string): string => {
649 const path = relative(dirname(importer), file).split("\\").join("/")

Callers 1

mapToSourceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected