@punks/backend-core 0.0.34 → 0.0.36
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 +26 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/utils/dates.d.ts +6 -1
- package/dist/cjs/types/utils/index.d.ts +1 -1
- package/dist/cjs/types/utils/{objects.d.ts → objects/index.d.ts} +1 -0
- package/dist/esm/index.js +25 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/utils/dates.d.ts +6 -1
- package/dist/esm/types/utils/index.d.ts +1 -1
- package/dist/esm/types/utils/{objects.d.ts → objects/index.d.ts} +1 -0
- package/dist/esm/types/utils/objects/mergeDeep.spec.d.ts +1 -0
- package/dist/esm/types/utils/objects/removeUndefinedProps.spec.d.ts +1 -0
- package/dist/index.d.ts +8 -2
- package/package.json +1 -1
- /package/dist/cjs/types/utils/{objects.test.d.ts → objects/mergeDeep.spec.d.ts} +0 -0
- /package/dist/{esm/types/utils/objects.test.d.ts → cjs/types/utils/objects/removeUndefinedProps.spec.d.ts} +0 -0
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
export type TimeUnit = "years" | "months" | "days" | "hours" | "minutes" | "seconds" | "milliseconds";
|
|
1
2
|
export declare const addTime: (date: Date, offset: {
|
|
2
3
|
value: number;
|
|
3
|
-
unit:
|
|
4
|
+
unit: TimeUnit;
|
|
5
|
+
}) => Date;
|
|
6
|
+
export declare const subtractTime: (date: Date, offset: {
|
|
7
|
+
value: number;
|
|
8
|
+
unit: TimeUnit;
|
|
4
9
|
}) => Date;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "./array";
|
|
2
|
-
export { addTime } from "./dates";
|
|
2
|
+
export { addTime, subtractTime, TimeUnit } from "./dates";
|
|
3
3
|
export { CsvColumnDefinition as ColumnDefinition, CsvBuildOptions, csvBuild, csvParse, } from "./csv";
|
|
4
4
|
export { getDirectoryFilePaths } from "./files";
|
|
5
5
|
export { joinPath, splitPath, ensureDirectory, getDirectoryPath } from "./paths";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -96,9 +96,14 @@ declare const iterate: <T>(values: T[], action: (item: T, next?: T | undefined,
|
|
|
96
96
|
declare const groupBy: <TKey, TValue>(values: TValue[], keySelector: (value: TValue) => TKey) => Map<TKey, TValue[]>;
|
|
97
97
|
declare const subArrays: <T>(array1: T[], array2: T[], eqFn: (a: T, b: T) => boolean) => T[];
|
|
98
98
|
|
|
99
|
+
type TimeUnit = "years" | "months" | "days" | "hours" | "minutes" | "seconds" | "milliseconds";
|
|
99
100
|
declare const addTime: (date: Date, offset: {
|
|
100
101
|
value: number;
|
|
101
|
-
unit:
|
|
102
|
+
unit: TimeUnit;
|
|
103
|
+
}) => Date;
|
|
104
|
+
declare const subtractTime: (date: Date, offset: {
|
|
105
|
+
value: number;
|
|
106
|
+
unit: TimeUnit;
|
|
102
107
|
}) => Date;
|
|
103
108
|
|
|
104
109
|
declare const csvParse: (data: string | string[] | Buffer, separator?: string) => Record<string, any>[];
|
|
@@ -138,6 +143,7 @@ declare const buildObject: <T>(...props: {
|
|
|
138
143
|
key: string;
|
|
139
144
|
value: any;
|
|
140
145
|
}[]) => T;
|
|
146
|
+
declare const mergeDeep: <T>(a: any, b: any) => T;
|
|
141
147
|
|
|
142
148
|
declare const pluralize: (word: string) => string;
|
|
143
149
|
|
|
@@ -178,4 +184,4 @@ type ExcelParseOptions = {
|
|
|
178
184
|
};
|
|
179
185
|
declare const excelParse: (file: string | ArrayBuffer, options?: ExcelParseOptions) => any[];
|
|
180
186
|
|
|
181
|
-
export { CsvColumnDefinition as ColumnDefinition, CsvBuildOptions, Dict, ExcelKeyTransform, ExcelParseOptions, ExcelColumnDefinition as ExcelRowBuilder, ExcelSheetDefinition, ILogger, ILoggerProvider, IResolveServiceOptions, IServiceLocator, ITree, ITreeNode, Log, LogLevel, MetaSerializationType, RichText, TreeNodeBuilder, addTime, buildObject, buildTree, byField, byFieldDesc, camelToKebabCase, camelToSnakeCase, csvBuild, csvParse, distinct, distinctElements, ensureDirectory, ensureStartSlash, ensureTailingSlash, excelBuild, excelParse, first, flatten, getDirectoryFilePaths, getDirectoryPath, groupBy, indexes, isNullOrUndefined, iterate, joinPath, jsonDistinct, last, mapOrThrow, newUuid, notNull, notUndefined, pluralize, processArrayDifferences, range, removeUndefinedProps, selectMany, sleep, sort, splitPath, subArrays, toCamelCase, toDict, toItemsDict, toItemsMap, toMap, toTitleCase, trim, trimEnd, trimStart };
|
|
187
|
+
export { CsvColumnDefinition as ColumnDefinition, CsvBuildOptions, Dict, ExcelKeyTransform, ExcelParseOptions, ExcelColumnDefinition as ExcelRowBuilder, ExcelSheetDefinition, ILogger, ILoggerProvider, IResolveServiceOptions, IServiceLocator, ITree, ITreeNode, Log, LogLevel, MetaSerializationType, RichText, TimeUnit, TreeNodeBuilder, addTime, buildObject, buildTree, byField, byFieldDesc, camelToKebabCase, camelToSnakeCase, csvBuild, csvParse, distinct, distinctElements, ensureDirectory, ensureStartSlash, ensureTailingSlash, excelBuild, excelParse, first, flatten, getDirectoryFilePaths, getDirectoryPath, groupBy, indexes, isNullOrUndefined, iterate, joinPath, jsonDistinct, last, mapOrThrow, mergeDeep, newUuid, notNull, notUndefined, pluralize, processArrayDifferences, range, removeUndefinedProps, selectMany, sleep, sort, splitPath, subArrays, subtractTime, toCamelCase, toDict, toItemsDict, toItemsMap, toMap, toTitleCase, trim, trimEnd, trimStart };
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|