@punks/backend-core 0.0.31 → 0.0.33
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 +179 -131
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/functions/arrays/index.d.ts +10 -0
- package/dist/cjs/types/functions/arrays/processArrayDifferences.spec.d.ts +1 -0
- package/dist/cjs/types/functions/index.d.ts +1 -0
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/cjs/types/utils/array.d.ts +1 -0
- package/dist/cjs/types/utils/dates.d.ts +4 -0
- package/dist/cjs/types/utils/index.d.ts +1 -0
- package/dist/esm/index.js +177 -132
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/functions/arrays/index.d.ts +10 -0
- package/dist/esm/types/functions/arrays/processArrayDifferences.spec.d.ts +1 -0
- package/dist/esm/types/functions/index.d.ts +1 -0
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/esm/types/utils/array.d.ts +1 -0
- package/dist/esm/types/utils/dates.d.ts +4 -0
- package/dist/esm/types/utils/index.d.ts +1 -0
- package/dist/index.d.ts +18 -1
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const processArrayDifferences: <TItem, TInputItem, TId>({ elements, elementIdSelector, desiredItems, desiredItemSelector, }: {
|
|
2
|
+
elements: TItem[];
|
|
3
|
+
elementIdSelector: (item: TItem) => TId;
|
|
4
|
+
desiredItems: TInputItem[];
|
|
5
|
+
desiredItemSelector: (item: TInputItem) => TId;
|
|
6
|
+
}) => {
|
|
7
|
+
missingElements: TInputItem[];
|
|
8
|
+
exceedingElements: TItem[];
|
|
9
|
+
unchangedElements: TItem[];
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { processArrayDifferences } from "./arrays";
|
|
@@ -22,4 +22,5 @@ export declare const distinctElements: <T>(values: T[], comparer: (value: T) =>
|
|
|
22
22
|
export declare const jsonDistinct: <T>(values: T[]) => T[];
|
|
23
23
|
export declare const iterate: <T>(values: T[], action: (item: T, next?: T | undefined, prev?: T | undefined) => void) => void;
|
|
24
24
|
export declare const groupBy: <TKey, TValue>(values: TValue[], keySelector: (value: TValue) => TKey) => Map<TKey, TValue[]>;
|
|
25
|
+
export declare const subArrays: <T>(array1: T[], array2: T[], eqFn: (a: T, b: T) => boolean) => T[];
|
|
25
26
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from "./array";
|
|
2
|
+
export { addTime } from "./dates";
|
|
2
3
|
export { CsvColumnDefinition as ColumnDefinition, CsvBuildOptions, csvBuild, csvParse, } from "./csv";
|
|
3
4
|
export { getDirectoryFilePaths } from "./files";
|
|
4
5
|
export { joinPath, splitPath, ensureDirectory, getDirectoryPath } from "./paths";
|
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,17 @@ interface ILogger {
|
|
|
37
37
|
exception(message: string, error: Error, meta?: any): void;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
declare const processArrayDifferences: <TItem, TInputItem, TId>({ elements, elementIdSelector, desiredItems, desiredItemSelector, }: {
|
|
41
|
+
elements: TItem[];
|
|
42
|
+
elementIdSelector: (item: TItem) => TId;
|
|
43
|
+
desiredItems: TInputItem[];
|
|
44
|
+
desiredItemSelector: (item: TInputItem) => TId;
|
|
45
|
+
}) => {
|
|
46
|
+
missingElements: TInputItem[];
|
|
47
|
+
exceedingElements: TItem[];
|
|
48
|
+
unchangedElements: TItem[];
|
|
49
|
+
};
|
|
50
|
+
|
|
40
51
|
declare class Log {
|
|
41
52
|
private static enabled;
|
|
42
53
|
private static level;
|
|
@@ -83,6 +94,12 @@ declare const distinctElements: <T>(values: T[], comparer: (value: T) => any) =>
|
|
|
83
94
|
declare const jsonDistinct: <T>(values: T[]) => T[];
|
|
84
95
|
declare const iterate: <T>(values: T[], action: (item: T, next?: T | undefined, prev?: T | undefined) => void) => void;
|
|
85
96
|
declare const groupBy: <TKey, TValue>(values: TValue[], keySelector: (value: TValue) => TKey) => Map<TKey, TValue[]>;
|
|
97
|
+
declare const subArrays: <T>(array1: T[], array2: T[], eqFn: (a: T, b: T) => boolean) => T[];
|
|
98
|
+
|
|
99
|
+
declare const addTime: (date: Date, offset: {
|
|
100
|
+
value: number;
|
|
101
|
+
unit: "year" | "month" | "day" | "hour" | "minute" | "second";
|
|
102
|
+
}) => Date;
|
|
86
103
|
|
|
87
104
|
declare const csvParse: (data: string | string[] | Buffer, separator?: string) => Record<string, any>[];
|
|
88
105
|
interface CsvColumnDefinition<T> {
|
|
@@ -161,4 +178,4 @@ type ExcelParseOptions = {
|
|
|
161
178
|
};
|
|
162
179
|
declare const excelParse: (file: string | ArrayBuffer, options?: ExcelParseOptions) => any[];
|
|
163
180
|
|
|
164
|
-
export { CsvColumnDefinition as ColumnDefinition, CsvBuildOptions, Dict, ExcelKeyTransform, ExcelParseOptions, ExcelColumnDefinition as ExcelRowBuilder, ExcelSheetDefinition, ILogger, ILoggerProvider, IResolveServiceOptions, IServiceLocator, ITree, ITreeNode, Log, LogLevel, MetaSerializationType, RichText, TreeNodeBuilder, 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, range, removeUndefinedProps, selectMany, sleep, sort, splitPath, toCamelCase, toDict, toItemsDict, toItemsMap, toMap, toTitleCase, trim, trimEnd, trimStart };
|
|
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 };
|