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

Function writtenAt

ark/aot/flat.ts:1781–1796  ·  view source on GitHub ↗
(read: Reference)

Source from the content-addressed store, hash-verified

1779 return text + code.slice(start, end)
1780 }
1781 const writtenAt = (read: Reference) => {
1782 const { init } = moving.get(read)!
1783 const text = textOf(init!.start, init!.end)
1784 const parent = read.id.parent
1785 return (
1786 parent?.type === "Property" && parent.shorthand ?
1787 `${read.id.name}: ${text}`
1788 : (
1789 (parent?.type === "CallExpression" ||
1790 parent?.type === "NewExpression") &&
1791 parent.callee === read.id
1792 ) ?
1793 `(${text})`
1794 : text
1795 )
1796 }
1797 const moved = new Set(moving.values())
1798 const isMoved = spansContaining([...moved].map(d => d.init!))
1799 for (const read of reads) {

Callers 2

textOfFunction · 0.85
writtenWhereReadFunction · 0.85

Calls 2

textOfFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected