Files
react-native-devtools-frontend/node_modules/unist-util-find-all-after
Tim van der Lippe efb716af67 Update linter packages
- Updates stylelint to 13.8.0
- Updates ESLint to 7.14.0
- Updates @typescript-eslint to 4.9.0

DISABLE_THIRD_PARTY_CHECK=NPM update
R=jacktfranklin@chromium.org

Change-Id: I207e204607ede782710e042c17d6510c7f696905
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2566806
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-12-01 16:04:40 +00:00
..
2020-06-11 06:20:04 +00:00
2020-12-01 16:04:40 +00:00
2020-06-11 06:20:04 +00:00
2020-12-01 16:04:40 +00:00
2020-12-01 16:04:40 +00:00

unist-util-find-all-after

Build Coverage Downloads Sponsors Backers Chat Size

unist utility to find nodes after another node.

Install

npm:

npm install unist-util-find-all-after

Use

var u = require('unist-builder')
var findAllAfter = require('unist-util-find-all-after')

var tree = u('tree', [
  u('leaf', 'leaf 1'),
  u('node', [u('leaf', 'leaf 2'), u('leaf', 'leaf 3')]),
  u('leaf', 'leaf 4'),
  u('node', [u('leaf', 'leaf 5')]),
  u('leaf', 'leaf 6'),
  u('void'),
  u('leaf', 'leaf 7')
])

console.log(findAllAfter(tree, 1, 'leaf'))

Yields:

[
  {type: 'leaf', value: 'leaf 4'},
  {type: 'leaf', value: 'leaf 6'},
  {type: 'leaf', value: 'leaf 7'}
]

API

findAllAfter(parent, node|index[, test])

Find all children after index (or node) in parent that pass test (when given).

Parameters
Returns

Array.<Node> — Children of parent passing test.

Contribute

See contributing.md in syntax-tree/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer