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

Function getAbsolutePosition

ark/attest/cache/ts.ts:127–143  ·  view source on GitHub ↗
(
	file: ts.SourceFile,
	position: SourcePosition
)

Source from the content-addressed store, hash-verified

125 : undefined
126
127export const getAbsolutePosition = (
128 file: ts.SourceFile,
129 position: SourcePosition
130): number => {
131 const pos = ts.getPositionOfLineAndCharacter(
132 file,
133 // TS uses 0-based line and char #s
134 position.line - 1,
135 position.char - 1
136 )
137 if (!pos) {
138 throwInternalError(
139 `Absolute position ${printable(position)} does not exist in ${file.fileName}`
140 )
141 }
142 return pos
143}
144
145export type TsconfigInfo = {
146 path: string | undefined

Callers 2

getSnapCallArgsFunction · 0.90

Calls 2

throwInternalErrorFunction · 0.90
printableFunction · 0.90

Tested by

no test coverage detected