Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

It iterates through a graph recursively

License

NotificationsYou must be signed in to change notification settings

nervgh/recursive-iterator

Repository files navigation

NPM versionBuild statusTest coverage

About

It iterates through a graph or a tree recursively.

Versions

  • for support ES5 see2.x.x versions

Getting started

Quick overview (es6)

letiterator=newRecursiveIterator(root/* {Object|Array} */,[bypassMode=0]/* {Number} */,[ignoreCircular=false]/* {Boolean} */,[maxDeep=100]/* {Number} */)let{value, done}=iterator.next()let{parent, node, key, path, deep}=value// parent is parent node// node is current node// key is key of node// path is path to node// deep is current deep

Example (es6)

letroot={object:{number:1},string:'foo'}for(let{node, path}ofnewRecursiveIterator(root)){console.log(path.join('.'),node)}// object    Object {number: 1}// object.number    1// string    foo

Roadmap

Package managers

Bower

bower install recursive-iterator

You could find this module in bower likerecursive iterator.

NPM

npm install recursive-iterator

You could find this module in npm likerecursive iterator.

About

It iterates through a graph recursively

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp