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

Function _pushNestedArrayPaths

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

Source from the content-addressed store, hash-verified

3338}
3339
3340function _pushNestedArrayPaths(val, paths, path) {
3341 if (val != null) {
3342 const numElements = val.length;
3343 for (let j = 0; j < numElements; ++j) {
3344 if (Array.isArray(val[j])) {
3345 _pushNestedArrayPaths(val[j], paths, path + '.' + j);
3346 } else {
3347 if (Array.isArray(paths)) {
3348 paths.push(path + '.' + j);
3349 } else {
3350 // Set
3351 paths.add(path + '.' + j);
3352 }
3353 }
3354 }
3355 }
3356}
3357
3358/*!
3359 * ignore

Callers 2

_getAllPathsToValidateFunction · 0.85
_addArrayPathsToValidateFunction · 0.85

Calls 1

addMethod · 0.80

Tested by

no test coverage detected