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

Function isPure

ark/aot/flat.ts:888–901  ·  view source on GitHub ↗
(statement: Node, source: string)

Source from the content-addressed store, hash-verified

886 ).name
887
888const isPure = (statement: Node, source: string): boolean => {
889 switch (statement.type) {
890 case "FunctionDeclaration":
891 case "EmptyStatement":
892 return true
893 case "VariableDeclaration":
894 return statement.declarations.every(
895 declarator =>
896 declarator.id.type === "Identifier" &&
897 (!declarator.init || isPureExpression(declarator.init, source))
898 )
899 }
900 return false
901}
902
903const isPureExpression = (node: Node, source: string): boolean => {
904 node = unwrapExpression(node)

Callers 1

keepReadMethod · 0.85

Calls 1

isPureExpressionFunction · 0.85

Tested by

no test coverage detected