MCPcopy Index your code
hub / github.com/parse-community/parse-server / findPointers

Function findPointers

src/RestQuery.js:1295–1316  ·  view source on GitHub ↗
(object, path)

Source from the content-addressed store, hash-verified

1293// Path is a list of fields to search into.
1294// Returns a list of pointers in REST format.
1295function findPointers(object, path) {
1296 if (Array.isArray(object)) {
1297 return object.map(x => findPointers(x, path)).flat();
1298 }
1299
1300 if (typeof object !== 'object' || !object) {
1301 return [];
1302 }
1303
1304 if (path.length == 0) {
1305 if (object === null || object.__type == 'Pointer') {
1306 return [object];
1307 }
1308 return [];
1309 }
1310
1311 var subobject = object[path[0]];
1312 if (!subobject) {
1313 return [];
1314 }
1315 return findPointers(subobject, path.slice(1));
1316}
1317
1318// Object may be a list of REST-format objects to replace pointers
1319// in, or it may be a single object.

Callers 1

includePathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…