Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 748 Bytes

README.md

File metadata and controls

35 lines (25 loc) · 748 Bytes

@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.