rebuild function

Node Function(Node) rebuild(
  1. NodeBuilder transform(
    1. NodeBuilder
    ), {
  2. bool selfClosing = false,
})

Returns a function that rebuilds an arbitrary Node by applying the transform to it.

Implementation

Node Function(Node) rebuild(NodeBuilder Function(NodeBuilder) transform,
    {bool selfClosing = false}) {
  return (node) =>
      transform(NodeBuilder.from(node)).build(selfClosing: selfClosing);
}