R
fn

withType

tested

Return 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

ParameterTypeDescription
nodeNode
typestring
attrs?Readonly<Record<string, import("./attrs").AttrValue>> | undefined

Returns

Node