summaryrefslogtreecommitdiffstats
path: root/node_modules/mongoose/lib/helpers/arrayDepth.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/mongoose/lib/helpers/arrayDepth.js')
-rw-r--r--node_modules/mongoose/lib/helpers/arrayDepth.js30
1 files changed, 0 insertions, 30 deletions
diff --git a/node_modules/mongoose/lib/helpers/arrayDepth.js b/node_modules/mongoose/lib/helpers/arrayDepth.js
deleted file mode 100644
index 2c6f2e5..0000000
--- a/node_modules/mongoose/lib/helpers/arrayDepth.js
+++ /dev/null
@@ -1,30 +0,0 @@
-'use strict';
-
-module.exports = arrayDepth;
-
-function arrayDepth(arr) {
- if (!Array.isArray(arr)) {
- return { min: 0, max: 0, containsNonArrayItem: true };
- }
- if (arr.length === 0) {
- return { min: 1, max: 1, containsNonArrayItem: false };
- }
-
- const res = arrayDepth(arr[0]);
-
- for (let i = 1; i < arr.length; ++i) {
- const _res = arrayDepth(arr[i]);
- if (_res.min < res.min) {
- res.min = _res.min;
- }
- if (_res.max > res.max) {
- res.max = _res.max;
- }
- res.containsNonArrayItem = res.containsNonArrayItem || _res.containsNonArrayItem;
- }
-
- res.min = res.min + 1;
- res.max = res.max + 1;
-
- return res;
-} \ No newline at end of file