1.0.1 • Published 3 months ago

@luma-dev/unist-util-visit-fast v1.0.1

Weekly downloads
-
License
CC0-1.0
Repository
-
Last release
3 months ago

@luma-dev/unist-util-visit-fast

License

MIT and CC0

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.

1.0.1

3 months ago

1.0.0

3 months ago