MCPcopy Create free account
hub / github.com/Automattic/mongoose / _pushNestedArrayPaths

Function _pushNestedArrayPaths

lib/document.js:3324–3340  ·  view source on GitHub ↗
(val, paths, path)

Source from the content-addressed store, hash-verified

3322}
3323
3324function _pushNestedArrayPaths(val, paths, path) {
3325 if (val != null) {
3326 const numElements = val.length;
3327 for (let j = 0; j < numElements; ++j) {
3328 if (Array.isArray(val[j])) {
3329 _pushNestedArrayPaths(val[j], paths, path + '.' + j);
3330 } else {
3331 if (Array.isArray(paths)) {
3332 paths.push(path + '.' + j);
3333 } else {
3334 // Set
3335 paths.add(path + '.' + j);
3336 }
3337 }
3338 }
3339 }
3340}
3341
3342/*!
3343 * ignore

Callers 2

_getAllPathsToValidateFunction · 0.85
_addArrayPathsToValidateFunction · 0.85

Calls 1

addMethod · 0.80

Tested by

no test coverage detected