detect-tree-changed
Detect tow tree what is updated
Installation
npm install detect-tree-changed# or use yarn yarn add detect-tree-changed
Usage
const detectTreeChanged = // => Map { node: 'Root': status: 'updated' ctx: ...}
It's shameless of use document of @moyuyc/visit-tree about the ctx
which is returned.
API
detectTreeChanged
Parameters
treeA
{T}treeB
{T}opt
Object {{}}opt.limit
The limit of changed node (optional, defaultInfinity
)opt.equal
The compare strategy of two node (optional, default(a,b)=>a===b
)opt.path
(optional, default'children'
)
Returns Map
Related
- @moyuyc/visit-tree - Visit tree by pre or post DFS.
- detect-one-changed - Detect first changed html and markdown between old text and new.
Contributing
- Fork it!
- Create your new branch:
git checkout -b feature-new
orgit checkout -b fix-which-bug
- Start your magic work now
- Make sure npm test passes
- Commit your changes:
git commit -am 'feat: some description (close #123)'
orgit commit -am 'fix: some description (fix #123)'
- Push to the branch:
git push
- Submit a pull request :)
Authors
This library is written and maintained by imcuttle, moyuyc95@gmail.com.
License
MIT - imcuttle 🐟