(node: node, id: NodeId)
| 307 | } |
| 308 | |
| 309 | export const withId = <node extends BaseNode>(node: node, id: NodeId): node => { |
| 310 | if (node.id === id) return node |
| 311 | if (isNode(nodesByRegisteredId[id])) |
| 312 | throwInternalError(`Unexpected attempt to overwrite node id ${id}`) |
| 313 | // have to ignore cache to force creation of new potentially cyclic id |
| 314 | return createNode({ |
| 315 | id, |
| 316 | kind: node.kind, |
| 317 | inner: node.inner, |
| 318 | meta: node.meta, |
| 319 | $: node.$, |
| 320 | ignoreCache: true |
| 321 | }) as never |
| 322 | } |
| 323 | |
| 324 | export const withMeta = <node extends BaseNode>( |
| 325 | node: node, |
no test coverage detected
searching dependent graphs…