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

Function writtenOf

ark/schema/units.ts:919–931  ·  view source on GitHub ↗
(opts: UnitOptions)

Source from the content-addressed store, hash-verified

917const keysNothing: ContentKeyOf = () => undefined
918
919const writtenOf = (opts: UnitOptions): WrittenByCompiler => {
920 let byKeyOf = writtenByOptions.get(opts.compiler)
921 if (!byKeyOf) writtenByOptions.set(opts.compiler, (byKeyOf = new WeakMap()))
922 const keyOf = opts.keyOf ?? keysNothing
923 let written = byKeyOf.get(keyOf)
924 if (!written) {
925 byKeyOf.set(
926 keyOf,
927 (written = { contents: new WeakMap(), units: new WeakMap() })
928 )
929 }
930 return written
931}
932
933// a node's content holding no value by identity
934interface WrittenContent {

Callers 1

nameReferencesFunction · 0.70

Calls 2

getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected