11 lines
312 B
JavaScript
11 lines
312 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.default = checkArrayDepth;
|
|
function checkArrayDepth(arr, depth) {
|
|
if (!Array.isArray(arr))
|
|
return false;
|
|
if (depth === 1)
|
|
return true;
|
|
return arr.every((item) => checkArrayDepth(item, depth - 1));
|
|
}
|