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

Function withMeta

ark/schema/parse.ts:491–506  ·  view source on GitHub ↗
(
	node: node,
	meta: ArkEnv.meta,
	id?: NodeId
)

Source from the content-addressed store, hash-verified

489}
490
491export const withMeta = <node extends BaseNode>(
492 node: node,
493 meta: ArkEnv.meta,
494 id?: NodeId
495): node => {
496 if (id && isNode(nodesById.get(id)))
497 throwInternalError(`Unexpected attempt to overwrite node id ${id}`)
498 return createNode({
499 id,
500 alias: meta.alias,
501 kind: node.kind,
502 inner: node.inner,
503 meta,
504 $: node.$
505 }) as never
506}

Callers 1

parseNodeFunction · 0.85

Calls 4

isNodeFunction · 0.90
throwInternalErrorFunction · 0.90
createNodeFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected