datasquirel/dist/package-shared/utils/check-array-depth.js
Benjamin Toby 8ac8b8eb51 Updates
2025-07-28 07:23:45 +01:00

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));
}