(where, depth)
| 367 | } |
| 368 | const maxDepth = rc.queryDepth; |
| 369 | const checkDepth = (where, depth) => { |
| 370 | if (depth > maxDepth) { |
| 371 | throw new Parse.Error( |
| 372 | Parse.Error.INVALID_QUERY, |
| 373 | `Query condition nesting depth exceeds maximum allowed depth of ${maxDepth}` |
| 374 | ); |
| 375 | } |
| 376 | if (typeof where !== 'object' || where === null) { |
| 377 | return; |
| 378 | } |
| 379 | for (const op of ['$or', '$and', '$nor']) { |
| 380 | if (Array.isArray(where[op])) { |
| 381 | for (const subQuery of where[op]) { |
| 382 | checkDepth(subQuery, depth + 1); |
| 383 | } |
| 384 | } |
| 385 | } |
| 386 | }; |
| 387 | checkDepth(this.restWhere, 0); |
| 388 | }; |
| 389 |
no outgoing calls
no test coverage detected