@punks/backend-core 0.0.30 → 0.0.32
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 +157 -116
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/abstractions/logging.d.ts +4 -0
- 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/logging/service.d.ts +3 -1
- package/dist/cjs/types/utils/array.d.ts +1 -0
- package/dist/esm/index.js +156 -117
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/abstractions/logging.d.ts +4 -0
- 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/logging/service.d.ts +3 -1
- package/dist/esm/types/utils/array.d.ts +1 -0
- package/dist/index.d.ts +19 -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";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { ILogger, LogLevel } from "../abstractions";
|
|
1
|
+
import { ILogger, LogLevel, MetaSerializationType } from "../abstractions";
|
|
2
2
|
export declare class Log {
|
|
3
3
|
private static enabled;
|
|
4
4
|
private static level;
|
|
5
|
+
private static metaSerialization;
|
|
6
|
+
static setSerializationType(type: MetaSerializationType): void;
|
|
5
7
|
static setLevel(level: LogLevel): void;
|
|
6
8
|
static enable(): void;
|
|
7
9
|
static disable(): void;
|
|
@@ -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 {};
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,10 @@ declare enum LogLevel {
|
|
|
16
16
|
Error = 3,
|
|
17
17
|
Fatal = 4
|
|
18
18
|
}
|
|
19
|
+
declare enum MetaSerializationType {
|
|
20
|
+
None = 0,
|
|
21
|
+
JSON = 1
|
|
22
|
+
}
|
|
19
23
|
interface ILoggerProvider {
|
|
20
24
|
debug(message: string, meta?: any): void;
|
|
21
25
|
info(message: string, meta?: any): void;
|
|
@@ -33,9 +37,22 @@ interface ILogger {
|
|
|
33
37
|
exception(message: string, error: Error, meta?: any): void;
|
|
34
38
|
}
|
|
35
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
|
+
|
|
36
51
|
declare class Log {
|
|
37
52
|
private static enabled;
|
|
38
53
|
private static level;
|
|
54
|
+
private static metaSerialization;
|
|
55
|
+
static setSerializationType(type: MetaSerializationType): void;
|
|
39
56
|
static setLevel(level: LogLevel): void;
|
|
40
57
|
static enable(): void;
|
|
41
58
|
static disable(): void;
|
|
@@ -77,6 +94,7 @@ declare const distinctElements: <T>(values: T[], comparer: (value: T) => any) =>
|
|
|
77
94
|
declare const jsonDistinct: <T>(values: T[]) => T[];
|
|
78
95
|
declare const iterate: <T>(values: T[], action: (item: T, next?: T | undefined, prev?: T | undefined) => void) => void;
|
|
79
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[];
|
|
80
98
|
|
|
81
99
|
declare const csvParse: (data: string | string[] | Buffer, separator?: string) => Record<string, any>[];
|
|
82
100
|
interface CsvColumnDefinition<T> {
|
|
@@ -155,4 +173,4 @@ type ExcelParseOptions = {
|
|
|
155
173
|
};
|
|
156
174
|
declare const excelParse: (file: string | ArrayBuffer, options?: ExcelParseOptions) => any[];
|
|
157
175
|
|
|
158
|
-
export { CsvColumnDefinition as ColumnDefinition, CsvBuildOptions, Dict, ExcelKeyTransform, ExcelParseOptions, ExcelColumnDefinition as ExcelRowBuilder, ExcelSheetDefinition, ILogger, ILoggerProvider, IResolveServiceOptions, IServiceLocator, ITree, ITreeNode, Log, LogLevel, 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 };
|
|
176
|
+
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, processArrayDifferences, range, removeUndefinedProps, selectMany, sleep, sort, splitPath, subArrays, toCamelCase, toDict, toItemsDict, toItemsMap, toMap, toTitleCase, trim, trimEnd, trimStart };
|