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? | Readonly<Record<string, import("./attrs").AttrValue>> | undefined | — |
Returns
Node