fn
withType
testedReturn a copy of node with a new type (and optionally new attrs).
Signature
ts
export function withType(node: Node, type: string, attrs?: Attrs): Node{ ... }Parameters
| Parameter | Type | Description |
|---|---|---|
node | Node | — |
type | string | — |
attrs? | Attrs | — |
Returns
Node| Property | Type | Description |
|---|---|---|
id | string | — |
type | string | — |
attrs | Attrs | — |
content | Content | — |