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

Function shapeOfCode

ark/aot/precompile.ts:9222–9227  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

9220
9221// what a function's text means, however it's spaced and parenthesized
9222const shapeOfCode = (text: string): string =>
9223 JSON.stringify(parseCode("a.js", `(${text})`, {}).program.body, (k, v) =>
9224 k === "start" || k === "end" || k === "raw" || k === "parent" ?
9225 undefined
9226 : v
9227 )
9228
9229const siteKeyOf = (id: string, site: Span) => `${id}\0${site.start}:${site.end}`
9230

Callers 1

isSameTextMethod · 0.85

Calls 1

parseCodeFunction · 0.90

Tested by

no test coverage detected