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

Function implementNode

ark/schema/shared/implement.ts:383–399  ·  view source on GitHub ↗
(
	_: nodeImplementationInputOf<d>
)

Source from the content-addressed store, hash-verified

381}
382
383export const implementNode = <d extends BaseNodeDeclaration = never>(
384 _: nodeImplementationInputOf<d>
385): nodeImplementationOf<d> => {
386 const implementation: UnknownNodeImplementation = _ as never
387 if (implementation.ownErr) {
388 Object.assign(
389 implementation.defaults,
390 errorWriters,
391 errorWritersByCode[implementation.kind as never]
392 )
393 implementation.defaults.expected ??= ctx =>
394 "description" in ctx ?
395 (ctx.description as string)
396 : implementation.defaults.description(ctx as never)
397 }
398 return implementation as never
399}

Callers 15

predicate.tsFile · 0.90
domain.tsFile · 0.90
intersection.tsFile · 0.90
proto.tsFile · 0.90
union.tsFile · 0.90
unit.tsFile · 0.90
alias.tsFile · 0.90
morph.tsFile · 0.90
required.tsFile · 0.90
index.tsFile · 0.90
sequence.tsFile · 0.90
structure.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected