MCPcopy Index your code
hub / github.com/tinyplex/tinybase / getPoolFunctions

Function getPoolFunctions

docs/pseudo.esm.sh/tinybase@9.0.0/index.js:373–384  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

371};
372var INTEGER = /^\d+$/;
373var getPoolFunctions = () => {
374 const pool = [];
375 let nextId = 0;
376 return [
377 (reuse) => (reuse ? arrayShift(pool) : null) ?? EMPTY_STRING + nextId++,
378 (id2) => {
379 if (test(INTEGER, id2) && size(pool) < 1e3) {
380 arrayPush(pool, id2);
381 }
382 }
383 ];
384};
385var getWildcardedLeaves = (deepIdSet, path = [EMPTY_STRING]) => {
386 const leaves = [];
387 const deep = (node, p) => p == size(path) ? arrayPush(leaves, node) : isNull(path[p]) ? collForEach(node, (node2) => deep(node2, p + 1)) : arrayForEach([path[p], null], (id2) => deep(mapGet(node, id2), p + 1));

Callers 3

getListenerFunctionsFunction · 0.70
setValidTableFunction · 0.70
getOrCreateTableFunction · 0.70

Calls 4

arrayShiftFunction · 0.70
testFunction · 0.70
sizeFunction · 0.70
arrayPushFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…