@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.
- package/dist/cjs/index.js +25 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/utils/mappings.d.ts +4 -4
- package/dist/cjs/types/utils/objects.d.ts +4 -0
- package/dist/esm/index.js +25 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/utils/mappings.d.ts +4 -4
- package/dist/esm/types/utils/objects.d.ts +4 -0
- package/dist/index.d.ts +9 -5
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const mapOrThrow: <
|
|
2
|
-
mapper: (
|
|
3
|
-
throw: (
|
|
4
|
-
}) =>
|
|
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: <
|
|
110
|
-
mapper: (
|
|
111
|
-
throw: (
|
|
112
|
-
}) =>
|
|
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 };
|