MCPcopy
hub / github.com/Kong/insomnia / next

Function next

packages/insomnia-data/node-src/database/database-nedb.ts:481–499  ·  view source on GitHub ↗
(docs: T[])

Source from the content-addressed store, hash-verified

479 types = Object.keys(nedbBucket) as AllTypes[];
480 }
481 async function next(docs: T[]): Promise<T[]> {
482 const foundDocs: T[] = [];
483
484 for (const d of docs) {
485 for (const type of types) {
486 // If the doc is null, we want to search for parentId === null
487 const parent = await database.findOne<T>(type, { _id: d.parentId });
488 parent && foundDocs.push(parent);
489 }
490 }
491
492 if (foundDocs.length === 0) {
493 return docsToReturn;
494 }
495
496 // Continue searching for children
497 docsToReturn = [...docsToReturn, ...foundDocs];
498 return next(foundDocs);
499 }
500
501 return next([doc]);
502 },

Callers 5

createNedbDatabaseFunction · 0.70
clientCertificateAuthFunction · 0.50
oauthRoutesFunction · 0.50
registerROPCFunction · 0.50
index.tsFile · 0.50

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected