Giter Site home page Giter Site logo

mrzmmr / unist-util-find-all-after Goto Github PK

View Code? Open in Web Editor NEW

This project forked from syntax-tree/unist-util-find-all-after

0.0 1.0 0.0 56 KB

utility to find nodes after another node

Home Page: https://unifiedjs.com

License: MIT License

JavaScript 86.86% TypeScript 13.14%

unist-util-find-all-after's Introduction

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.

Related

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

unist-util-find-all-after's People

Contributors

greenkeeperio-bot avatar roang-zero1 avatar wooorm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.