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

Function sourceLocation

packages/tools/api-diff/src/Snapshot.ts:38–46  ·  view source on GitHub ↗
(path: Path.Path, root: string, node: ts.Node)

Source from the content-addressed store, hash-verified

36 path.relative(root, location).split(path.sep).join("/")
37
38const sourceLocation = (path: Path.Path, root: string, node: ts.Node): SourceLocation => {
39 const source = node.getSourceFile()
40 const position = source.getLineAndCharacterOfPosition(node.getStart(source, false))
41 return {
42 file: normalizedPath(path, root, source.fileName),
43 line: position.line + 1,
44 column: position.character + 1
45 }
46}
47
48const modifiers = (node: ts.Node): ReadonlyArray<string> | undefined => {
49 if (!ts.canHaveModifiers(node)) {

Callers 1

extractSnapshotFunction · 0.85

Calls 1

normalizedPathFunction · 0.85

Tested by

no test coverage detected