UNPKG

peekdepth

Version:

Get the max depth of a multi-dimensional array

11 lines (8 loc) 213 B
'use strict'; const peekdepth = require('../'); const assert = require('assert'); let nonArray; let depth; nonArray = null; depth = peekdepth(nonArray); assert.equal(0, depth, `depth should be 0 not ${depth}`);