UNPKG
peekdepth
Version:
latest (2.0.1)
2.0.1
2.0.0
1.0.1
Get the max depth of a multi-dimensional array
github.com/ecman/peekdepth
ecman/peekdepth
peekdepth
/
test
/
non_array.js
11 lines
(8 loc)
•
213 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
'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}
`
);