@punks/backend-core 0.0.26 → 0.0.28

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,4 +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;
1
+ export declare const mapOrThrow: <T>({ mapper, throw: throwFn, }: {
2
+ mapper: () => T | undefined;
3
+ throw: () => void;
4
+ }) => T;
@@ -2,3 +2,7 @@ export declare const removeUndefinedProps: <T extends Record<string, any>>(obj:
2
2
  recursive?: boolean;
3
3
  }) => T;
4
4
  export declare const isNullOrUndefined: (value: any) => boolean;
5
+ export declare const buildObject: <T>(...props: {
6
+ key: string;
7
+ value: any;
8
+ }[]) => T;
package/dist/index.d.ts CHANGED
@@ -101,15 +101,19 @@ declare const removeUndefinedProps: <T extends Record<string, any>>(obj: T, opti
101
101
  recursive?: boolean;
102
102
  }) => T;
103
103
  declare const isNullOrUndefined: (value: any) => boolean;
104
+ declare const buildObject: <T>(...props: {
105
+ key: string;
106
+ value: any;
107
+ }[]) => T;
104
108
 
105
109
  declare const pluralize: (word: string) => string;
106
110
 
107
111
  declare function sleep(ms: number): Promise<unknown>;
108
112
 
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
+ declare const mapOrThrow: <T>({ mapper, throw: throwFn, }: {
114
+ mapper: () => T | undefined;
115
+ throw: () => void;
116
+ }) => T;
113
117
 
114
118
  declare const newUuid: () => string;
115
119
 
@@ -134,4 +138,4 @@ type ExcelParseOptions = {
134
138
  };
135
139
  declare const excelParse: (file: string | ArrayBuffer, options?: ExcelParseOptions) => any[];
136
140
 
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 };
141
+ export { CsvColumnDefinition as ColumnDefinition, CsvBuildOptions, Dict, ExcelKeyTransform, ExcelParseOptions, ExcelColumnDefinition as ExcelRowBuilder, ExcelSheetDefinition, ILogger, ILoggerProvider, IResolveServiceOptions, IServiceLocator, Log, LogLevel, RichText, buildObject, 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.26",
3
+ "version": "0.0.28",
4
4
  "description": "WebPunks Backend Core",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",