json-level
1.0.1 • Public • Published json level
Calculate the given JSON object's depth.
Installation
npm install json-level --save
Example
import jsonLevel from 'json-level';
const emptyObj = {};
const level1 = { a: 1 };
const level2 = { b: level1 };
const level3 = { c: level2 };
console.log(jsonLevel(emptyObj));
console.log(jsonLevel(level1));
console.log(jsonLevel(level2));
console.log(jsonLevel(level3));
Package Sidebar
Install
Weekly Downloads