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

Function pureAnnotationOf

ark/aot/link.ts:1753–1759  ·  view source on GitHub ↗
(
	source: string,
	call: Span
)

Source from the content-addressed store, hash-verified

1751const pureAnnotated = /\/\*\s*[#@]__PURE__\s*\*\/\s*$/
1752
1753export const pureAnnotationOf = (
1754 source: string,
1755 call: Span
1756): string | undefined =>
1757 pureAnnotated.exec(
1758 source.slice(Math.max(0, call.start - 32), call.start)
1759 )?.[0]
1760
1761export const statementOf = (node: Node): Node => {
1762 while (node.parent && node.parent.type !== "Program") node = node.parent

Callers 4

creationsInFunction · 0.90
keptAnnotationsInFunction · 0.90
isPureExpressionFunction · 0.90
readAllowsAsCreatedMethod · 0.85

Calls 1

execMethod · 0.80

Tested by

no test coverage detected