@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.
@@ -1,2 +1,3 @@
1
1
  import { PortableTextBlock } from "@portabletext/types";
2
2
  export type RichText = PortableTextBlock[];
3
+ export type Optional<T> = T | undefined;
@@ -1 +1,2 @@
1
1
  export declare function sleep(ms: number): Promise<unknown>;
2
+ export declare const mapAsync: <T, R>(array: T[], callback: (value: T, index: number, array: T[]) => Promise<R>) => Promise<R[]>;
package/dist/esm/index.js CHANGED
@@ -358,6 +358,13 @@ const pluralize = (word) => {
358
358
  function sleep(ms) {
359
359
  return new Promise((resolve) => setTimeout(resolve, ms));
360
360
  }
361
+ const mapAsync = async (array, callback) => {
362
+ const result = [];
363
+ for (let i = 0; i < array.length; i++) {
364
+ result.push(await callback(array[i], i, array));
365
+ }
366
+ return result;
367
+ };
361
368
 
362
369
  const buildNode = async (record, { ancestors, nodesDict, childrenDict, nodeBuilder, }) => {
363
370
  const children = childrenDict.get(nodeBuilder.idSelector(record)) || [];
@@ -28736,5 +28743,5 @@ const processArrayItemMove = (items, input) => {
28736
28743
  }));
28737
28744
  };
28738
28745
 
28739
- export { ConsoleLogger, DatadogLogger, ExcelKeyTransform, FileLogger, Log, LogLevel, MetaSerializationType, addTime, buildObject, buildTree, buildUrl, byField, byFieldDesc, camelToKebabCase, camelToSnakeCase, createDayPath, csvBuild, csvParse, deserializeQueryString, distinct, distinctElements, ensureDirectory, ensureStartSlash, ensureTailingSlash, excelBuild, excelParse, first, flatten, getDirectoryFilePaths, getDirectoryPath, getQueryParameter, groupBy, indexes, isNullOrUndefined, iterate, joinPath, jsonDistinct, jsonSerialize, last, logMemoryUsage, mapOrThrow, mergeDeep, newUuid, notNull, notUndefined, pluralize, processArrayDifferences, processArrayItemMove, range, removeUndefinedProps, selectMany, serializeQueryString, sleep, sort, splitPath, subArrays, subtractTime, toArrayDict, toCamelCase, toDict, toItemsDict, toItemsMap, toMap, toTitleCase, trim$1 as trim, trimEnd, trimStart, updateQueryParameters };
28746
+ export { ConsoleLogger, DatadogLogger, ExcelKeyTransform, FileLogger, Log, LogLevel, MetaSerializationType, addTime, buildObject, buildTree, buildUrl, byField, byFieldDesc, camelToKebabCase, camelToSnakeCase, createDayPath, csvBuild, csvParse, deserializeQueryString, distinct, distinctElements, ensureDirectory, ensureStartSlash, ensureTailingSlash, excelBuild, excelParse, first, flatten, getDirectoryFilePaths, getDirectoryPath, getQueryParameter, groupBy, indexes, isNullOrUndefined, iterate, joinPath, jsonDistinct, jsonSerialize, last, logMemoryUsage, mapAsync, mapOrThrow, mergeDeep, newUuid, notNull, notUndefined, pluralize, processArrayDifferences, processArrayItemMove, range, removeUndefinedProps, selectMany, serializeQueryString, sleep, sort, splitPath, subArrays, subtractTime, toArrayDict, toCamelCase, toDict, toItemsDict, toItemsMap, toMap, toTitleCase, trim$1 as trim, trimEnd, trimStart, updateQueryParameters };
28740
28747
  //# sourceMappingURL=index.js.map