@punks/backend-core 0.0.24 → 0.0.26

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,3 +1,4 @@
1
1
  export * from "./abstractions";
2
2
  export * from "./logging";
3
+ export * from "./types";
3
4
  export * from "./utils";
@@ -6,5 +6,6 @@ export * from "./strings";
6
6
  export * from "./objects";
7
7
  export * from "./text";
8
8
  export * from "./threading";
9
+ export * from "./mappings";
9
10
  export * from "./uid";
10
11
  export { ExcelSheetDefinition, ExcelKeyTransform, ExcelColumnDefinition as ExcelRowBuilder, ExcelParseOptions, excelBuild, excelParse, } from "./xls";
@@ -0,0 +1,4 @@
1
+ export declare const mapOrThrow: <TInput, TOutput>(input: TInput, { mapper, throw: throwFn, }: {
2
+ mapper: (input: TInput) => TOutput | undefined;
3
+ throw: (input: TInput) => void;
4
+ }) => TOutput;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  /// <reference types="node" />
2
+ import { PortableTextBlock } from '@portabletext/types';
3
+
2
4
  interface IResolveServiceOptions {
3
5
  optional?: boolean;
4
6
  }
@@ -40,6 +42,8 @@ declare class Log {
40
42
  static getLogger(loggerName: string): ILogger;
41
43
  }
42
44
 
45
+ type RichText = PortableTextBlock[];
46
+
43
47
  declare const range: (start: number, end: number) => number[];
44
48
  declare const indexes: (startIndex: number, count: number) => number[];
45
49
  interface Dict<TVal> {
@@ -102,6 +106,11 @@ declare const pluralize: (word: string) => string;
102
106
 
103
107
  declare function sleep(ms: number): Promise<unknown>;
104
108
 
109
+ declare const mapOrThrow: <TInput, TOutput>(input: TInput, { mapper, throw: throwFn, }: {
110
+ mapper: (input: TInput) => TOutput | undefined;
111
+ throw: (input: TInput) => void;
112
+ }) => TOutput;
113
+
105
114
  declare const newUuid: () => string;
106
115
 
107
116
  interface ExcelColumnDefinition<T> {
@@ -125,4 +134,4 @@ type ExcelParseOptions = {
125
134
  };
126
135
  declare const excelParse: (file: string | ArrayBuffer, options?: ExcelParseOptions) => any[];
127
136
 
128
- export { CsvColumnDefinition as ColumnDefinition, CsvBuildOptions, Dict, ExcelKeyTransform, ExcelParseOptions, ExcelColumnDefinition as ExcelRowBuilder, ExcelSheetDefinition, ILogger, ILoggerProvider, IResolveServiceOptions, IServiceLocator, Log, LogLevel, byField, byFieldDesc, camelToKebabCase, camelToSnakeCase, csvBuild, csvParse, distinct, distinctElements, ensureDirectory, ensureStartSlash, ensureTailingSlash, excelBuild, excelParse, first, flatten, getDirectoryFilePaths, getDirectoryPath, indexes, isNullOrUndefined, iterate, joinPath, jsonDistinct, last, newUuid, notNull, notUndefined, pluralize, range, removeUndefinedProps, selectMany, sleep, sort, splitPath, toCamelCase, toDict, toItemsDict, toItemsMap, toMap, toTitleCase, trim, trimEnd, trimStart };
137
+ export { CsvColumnDefinition as ColumnDefinition, CsvBuildOptions, Dict, ExcelKeyTransform, ExcelParseOptions, ExcelColumnDefinition as ExcelRowBuilder, ExcelSheetDefinition, ILogger, ILoggerProvider, IResolveServiceOptions, IServiceLocator, Log, LogLevel, RichText, byField, byFieldDesc, camelToKebabCase, camelToSnakeCase, csvBuild, csvParse, distinct, distinctElements, ensureDirectory, ensureStartSlash, ensureTailingSlash, excelBuild, excelParse, first, flatten, getDirectoryFilePaths, getDirectoryPath, indexes, isNullOrUndefined, iterate, joinPath, jsonDistinct, last, mapOrThrow, newUuid, notNull, notUndefined, pluralize, range, removeUndefinedProps, selectMany, sleep, sort, splitPath, toCamelCase, toDict, toItemsDict, toItemsMap, toMap, toTitleCase, trim, trimEnd, trimStart };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@punks/backend-core",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "description": "WebPunks Backend Core",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",