@punks/backend-core 0.0.65 → 0.0.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +8 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/types/index.d.ts +1 -0
- package/dist/cjs/types/utils/threading.d.ts +1 -0
- package/dist/esm/index.js +8 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/types/index.d.ts +1 -0
- package/dist/esm/types/utils/threading.d.ts +1 -0
- package/dist/index.d.ts +3 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -386,6 +386,13 @@ const pluralize = (word) => {
|
|
|
386
386
|
function sleep(ms) {
|
|
387
387
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
388
388
|
}
|
|
389
|
+
const mapAsync = async (array, callback) => {
|
|
390
|
+
const result = [];
|
|
391
|
+
for (let i = 0; i < array.length; i++) {
|
|
392
|
+
result.push(await callback(array[i], i, array));
|
|
393
|
+
}
|
|
394
|
+
return result;
|
|
395
|
+
};
|
|
389
396
|
|
|
390
397
|
const buildNode = async (record, { ancestors, nodesDict, childrenDict, nodeBuilder, }) => {
|
|
391
398
|
const children = childrenDict.get(nodeBuilder.idSelector(record)) || [];
|
|
@@ -28801,6 +28808,7 @@ exports.jsonDistinct = jsonDistinct;
|
|
|
28801
28808
|
exports.jsonSerialize = jsonSerialize;
|
|
28802
28809
|
exports.last = last;
|
|
28803
28810
|
exports.logMemoryUsage = logMemoryUsage;
|
|
28811
|
+
exports.mapAsync = mapAsync;
|
|
28804
28812
|
exports.mapOrThrow = mapOrThrow;
|
|
28805
28813
|
exports.mergeDeep = mergeDeep;
|
|
28806
28814
|
exports.newUuid = newUuid;
|