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

Function readsMatch

ark/schema/units.ts:820–833  ·  view source on GitHub ↗
(
	written: WrittenUnit,
	component: readonly BaseNode[],
	s: ContentNamingState
)

Source from the content-addressed store, hash-verified

818}
819
820const readsMatch = (
821 written: WrittenUnit,
822 component: readonly BaseNode[],
823 s: ContentNamingState
824): boolean => {
825 if (written.component.length !== component.length) return false
826 for (let i = 0; i < component.length; i++)
827 if (written.component[i] !== component[i]) return false
828 for (const [id, name] of written.namesRead)
829 if (s.names[id] !== name) return false
830 for (const [id, node] of written.reachedRead)
831 if (s.byId[id]?.node !== node) return false
832 return true
833}
834
835const writeComponent = (
836 component: readonly BaseNode[],

Callers 1

unitsOfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected