@luma-dev/unist-util-visit-fast
v1.0.1
Published
Faster version of unist-util-visit
Downloads
4
Readme
@luma-dev/unist-util-visit-fast
License
Install
npm i @luma-dev/unist-util-visit-fast
Usage
import {
visit,
CONTINUE,
STEP_OVER,
REPLACE,
EXIT,
BREAK,
DELETE,
DELETE_EXIT,
DELETE_BREAK,
} from "@luma-dev/unist-util-visit-fast";
Please refer to src/__tests__/visit.spec.ts
Why?
unist-util-visit took $O(n^2)$ time when you have $n$ children. This library just takes $O(n)$ time.
Quick benchmark for the key point logic.