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

Function isLeafIn

ark/schema/units.ts:77–89  ·  view source on GitHub ↗
(node: BaseNode, byId: Record<string, BaseNode>)

Source from the content-addressed store, hash-verified

75
76// leaves read no object property
77const isLeafIn = (node: BaseNode, byId: Record<string, BaseNode>): boolean => {
78 if (!node.isRoot()) return false
79 for (const id in node.byId) {
80 const reference = node.byId[id]
81 if (
82 reference !== byId[id] ||
83 reference.is("structure") ||
84 reference.is("alias")
85 )
86 return false
87 }
88 return true
89}
90
91export const precompile = (
92 references: readonly BaseNode[],

Callers 2

precompileFunction · 0.85
bindUnitFunction · 0.85

Calls 1

isMethod · 0.80

Tested by

no test coverage detected