A simple utility to calculate the depth of arrays, key-value objects, etc. and for deep/nested object comparison.
The highest level of nesting found in the array
The highest level of nesting found in the object
Strings, numbers, etc. are defined as zero.
- fork this repo
npm install
npm install -g jest
(if you don't have jest installed globally, you may need to run this)
npm run test
npm run test -- --verbose --coverage
An interactive coverage report should be generated at <repo root>/coverage/lcov-report/index.html
If you don't have lcov
installed, you can install it on Mac:
brew install lcov
or Ubuntu/Linux:
sudo apt update
sudo apt install lcov
- The
depth_finder_mongoose
module has mongoose as a dependency, in order to handle Mongoose/mongodb data types. Thedepth_finder
module will work without the mongoose dependency. - There is no plan to maintain this repo at this time. If you find it useful, great :)