@lowentry/utils 1.15.1 → 1.15.3

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/jest.config.js CHANGED
@@ -1,9 +1,10 @@
1
1
  export default {
2
- globals:{
3
- extensionsToTreatAsEsm:['.ts', '.js'],
4
- 'ts-jest': {
5
- useESM:true,
6
- },
2
+ preset: 'ts-jest/presets/js-with-ts-esm',
3
+ globals: {
4
+ extensionsToTreatAsEsm:['.ts', '.js', '.mjs', '.mjsx'],
7
5
  },
8
- preset: 'ts-jest/presets/js-with-ts-esm',
6
+ transform: {
7
+ '^.+\\.[tj]sx?$|^.+\\.mjsx?$':['ts-jest', {useESM:true}],
8
+ },
9
+ moduleFileExtensions:['ts', 'tsx', 'js', 'jsx', 'mjs', 'mjsx', 'json', 'node'],
9
10
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowentry/utils",
3
- "version": "1.15.1",
3
+ "version": "1.15.3",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./index.js",
package/src/LeUtils.js CHANGED
@@ -2645,6 +2645,7 @@ export const LeUtils = {
2645
2645
  {
2646
2646
  return btoa(string);
2647
2647
  }
2648
+ //@ts-ignore - Node.js fallback
2648
2649
  return Buffer.from(string).toString('base64');
2649
2650
  },
2650
2651
 
@@ -2661,6 +2662,7 @@ export const LeUtils = {
2661
2662
  {
2662
2663
  return atob(base64string);
2663
2664
  }
2665
+ //@ts-ignore - Node.js fallback
2664
2666
  return Buffer.from(base64string, 'base64').toString();
2665
2667
  },
2666
2668
 
package/tsconfig.json CHANGED
@@ -1,49 +1,27 @@
1
1
  {
2
- "include": [
3
- "tsconfig.d.ts",
4
- "src"
5
- ],
6
- "exclude": [
7
- "node_modules"
8
- ],
9
2
  "compilerOptions": {
10
- "lib": [
11
- "dom",
12
- "dom.iterable",
13
- "es5",
14
- "es6",
15
- "es2016",
16
- "es2017",
17
- "es2018",
18
- "es2019",
19
- "es2020",
20
- "es2021",
21
- "es2022",
22
- "es2023",
23
- "esnext"
24
- ],
25
3
  "allowJs": true,
26
- "declaration": true,
27
- "declarationMap": false,
28
- "esModuleInterop": true,
29
- "jsx": "react-jsx",
30
- "module": "esnext",
31
- "moduleResolution": "node",
32
- "outDir": "./build",
33
- "removeComments": false,
34
- "skipLibCheck": true,
35
- "strict": true,
36
- "stripInternal": true,
37
- "target": "esnext",
38
4
  "checkJs": true,
5
+ "strict": true,
6
+ "noEmit": true,
39
7
  "noImplicitAny": false,
40
8
  "noImplicitThis": false,
41
9
  "alwaysStrict": true,
42
10
  "resolveJsonModule": true,
11
+ "esModuleInterop": true,
43
12
  "allowSyntheticDefaultImports": true,
44
- "emitDeclarationOnly": true
13
+ "jsx": "react-jsx",
14
+ "target": "esnext",
15
+ "module": "esnext",
16
+ "moduleResolution": "node",
17
+ "skipLibCheck": true,
18
+ "types": []
45
19
  },
46
- "typeAcquisition": {
47
- "include": []
48
- }
20
+ "include": [
21
+ "tsconfig.d.ts",
22
+ "src"
23
+ ],
24
+ "exclude": [
25
+ "node_modules"
26
+ ]
49
27
  }
@@ -1,15 +0,0 @@
1
- export function ISSET(value: any): boolean;
2
- export function IS_ARRAY(value: any): boolean;
3
- export function ARRAY(value: any): any[];
4
- export function IS_OBJECT(value: any): boolean;
5
- export function OBJECT(value: any): object;
6
- export function STRING(value: any): string;
7
- export function STRING_ANY(...values: any): string;
8
- export function INT(value: any): number;
9
- export function INT_ANY(...values: any): number;
10
- export function FLOAT(value: any): number;
11
- export function FLOAT_ANY(...values: any): number;
12
- export function INT_LAX(value: any): number;
13
- export function INT_LAX_ANY(...values: any): number;
14
- export function FLOAT_LAX(value: any): number;
15
- export function FLOAT_LAX_ANY(...values: any): number;
@@ -1,217 +0,0 @@
1
- export namespace LeUtils {
2
- export { FastDeepEqual as equals };
3
- export function clone(value: any): any;
4
- export function onDomReady(callback: Function): {
5
- remove: Function;
6
- };
7
- export function parseVersionString(versionString: string | any): {
8
- major: (number);
9
- minor: (number);
10
- patch: (number);
11
- toString: (() => string);
12
- equals: ((arg0: string | any) => boolean);
13
- smallerThan: ((arg0: string | any) => boolean);
14
- smallerThanOrEquals: ((arg0: string | any) => boolean);
15
- largerThan: ((arg0: string | any) => boolean);
16
- largerThanOrEquals: ((arg0: string | any) => boolean);
17
- };
18
- export function contains(array: any[] | object | Function, value: any): boolean;
19
- export function containsCaseInsensitive(array: any[] | object | Function, value: any): boolean;
20
- export function containsAll(array: any[] | object | Function, values: any[] | object | Function): boolean;
21
- export function containsAllCaseInsensitive(array: any[] | object | Function, values: any[] | object | Function): boolean;
22
- export function containsAny(array: any[] | object | Function, values: any[] | object | Function): boolean;
23
- export function containsAnyCaseInsensitive(array: any[] | object | Function, values: any[] | object | Function): boolean;
24
- export function containsNone(array: any[] | object | Function, values: any[] | object | Function): boolean;
25
- export function containsNoneCaseInsensitive(array: any[] | object | Function, values: any[] | object | Function): boolean;
26
- export function findIndexValue(elements: any[] | object | Function, callback: (value: any, index: any) => boolean | void, optionalSkipHasOwnPropertyCheck?: boolean): {
27
- index: any;
28
- value: any;
29
- } | null;
30
- export function findIndex(elements: any[] | object | Function, callback: (value: any, index: any) => boolean | void, optionalSkipHasOwnPropertyCheck?: boolean): any | null;
31
- export function find(elements: any[] | object | Function, callback: (value: any, index: any) => boolean | void, optionalSkipHasOwnPropertyCheck?: boolean): any | null;
32
- export function getValueAtIndex(elements: any, index: any, optionalSkipHasOwnPropertyCheck?: boolean): any;
33
- export function supportsEach(elements: any): boolean;
34
- export function eachIterator(elements: any, optionalSkipHasOwnPropertyCheck?: boolean): Generator<any, void, any>;
35
- export function each(elements: any, callback: (value: any, index?: any) => boolean | void, optionalSkipHasOwnPropertyCheck?: boolean): any;
36
- export function eachAsync(elements: any, asyncCallback: any, parallelCount?: number, optionalSkipHasOwnPropertyCheck?: boolean): Promise<any>;
37
- export function getEmptySimplifiedCollection(elements: any): [boolean, any[] | object | Map<any, any>, (value: any, index: any) => void];
38
- export function filter(elements: any, callback?: (value: any, index: any) => boolean | undefined, optionalSkipHasOwnPropertyCheck?: boolean): any;
39
- export function map(elements: any, callback?: (value: any, index: any) => any, optionalSkipHasOwnPropertyCheck?: boolean): any;
40
- export function mapToArray(elements: any, callback?: (value: any, index: any) => any, optionalSkipHasOwnPropertyCheck?: boolean): any[];
41
- export function mapToArraySorted(elements: any, comparator: (valueA: any, valueB: any) => number, callback?: (value: any, index: any) => any, optionalSkipHasOwnPropertyCheck?: boolean): any[];
42
- export function sortKeys(elements: any, comparator: (valueA: any, valueB: any) => number, optionalSkipHasOwnPropertyCheck?: boolean): any[];
43
- export function flattenArray(array: any): any[];
44
- export function flattenToArray(elements: any, optionalSkipHasOwnPropertyCheck?: boolean): any[];
45
- export function compare(a: any, b: any): number;
46
- export function compareNumbers(a: number, b: number): number;
47
- export function compareNumericStrings(a: string | number, b: string | number): number;
48
- export function compareTimestampStrings(a: string, b: string): number;
49
- export function isEmptyObject(obj: object, optionalSkipHasOwnPropertyCheck?: boolean | undefined): boolean;
50
- export function getObjectFieldsCount(obj: object, optionalSkipHasOwnPropertyCheck?: boolean | undefined): number;
51
- export function isGeneratorFunction(func: any): any;
52
- export function setTimeout(callback: (deltaTime: number) => any, ms: number): {
53
- remove: Function;
54
- };
55
- export function setInterval(callback: (deltaTime: number) => any, intervalMs?: number, fireImmediately?: boolean): {
56
- remove: Function;
57
- };
58
- export function setAnimationFrameTimeout(callback: (deltaTime: number) => any, frames?: number): {
59
- remove: Function;
60
- };
61
- export function setAnimationFrameInterval(callback: (deltaTime: number) => any, intervalFrames?: number, fireImmediately?: boolean): {
62
- remove: Function;
63
- };
64
- export function promiseTimeout(ms: number): Promise<number>;
65
- export function promiseAnimationFrameTimeout(frames: number): Promise<number>;
66
- export function fetch(url: string, options?: {
67
- retries?: number | null;
68
- delay?: number | ((attempt: number) => number) | null;
69
- } | object | null): {
70
- then: Function;
71
- catch: Function;
72
- finally: Function;
73
- remove: Function;
74
- isRemoved: Function;
75
- };
76
- export function cachedFetch(url: any, options: any, responseFunction: any): Promise<any>;
77
- export function platformIsMobile(): boolean;
78
- export function platformHasCursor(): boolean;
79
- export function capitalize(string: string): string;
80
- export function endsWithAny(string: string, endingCharsStringOrArray: string | string[]): boolean;
81
- export function startsWithAny(string: string, startingCharsStringOrArray: string | string[]): boolean;
82
- export function trimEnd(string: string, trimCharsStringOrArray: string | string[]): string;
83
- export function trimStart(string: string, trimCharsStringOrArray: string | string[]): string;
84
- export function trim(string: string, trimCharsStringOrArray: string | string[]): string;
85
- export function purgeSentence(sentence: string): string;
86
- export function purgeErrorMessage(error: any): string;
87
- export function generateNamePermutations(...names: string[]): string[];
88
- export function increaseNumericStringByOne(string: string): string;
89
- export function uniqueId(): string;
90
- export function timestamp(now?: number | null | undefined): string;
91
- export function getEmptyImageSrc(): string;
92
- export function getPercentage(part: number | string, total: number | string): number;
93
- export function getImagePixels(image: HTMLImageElement): Uint8ClampedArray;
94
- export function getColoredImage(image: HTMLImageElement, color: string): string;
95
- export function rgbToHex(rgb: number[]): string;
96
- export function hexToRgb(hexstring: string): number[];
97
- export function rgbToHsl(rgb: number[]): number[];
98
- export function hslToRgb(hsl: any): number[];
99
- export function rgbToLab(rgb: number[]): number[];
100
- export function getDifferenceBetweenRgb(rgbA: number[], rgbB: number[]): number;
101
- export function getDifferenceBetweenLab(labA: number[], labB: number[]): number;
102
- export function getRgbOfGradient(gradient: {
103
- percentage?: number[];
104
- }, percentage: number): number[];
105
- export function getRgbBetween(startRgb: number[], endRgb: number[], percentage: number): number[];
106
- export function btoa(string: string): string;
107
- export function atob(base64string: string): string;
108
- export function utf8ToBase64(string: string): string;
109
- export function base64ToUtf8(base64string: string): string;
110
- export function base64ToHex(base64string: string): string;
111
- export function hexToBase64(hexstring: string): string;
112
- export function base64ToBytes(base64string: string): Uint8Array;
113
- export function bytesToBase64(arraybuffer: ArrayLike<number> | ArrayBuffer): string;
114
- export function downloadFile(base64string: string, fileName?: string, mimeType?: string): void;
115
- export function localStorageGet(id: string): any;
116
- export function localStorageSet(id: string, data: any): void;
117
- export function localStorageRemove(id: string): void;
118
- export function isCurrentHostPrivate(): boolean;
119
- export function isGivenHostPrivate(host: string): boolean;
120
- export function createTreeSet(elements: any[], comparator: (valueA: any, valueB: any) => number): {
121
- getElements: (() => any[]);
122
- getComparator: (() => ((valueA: any, valueB: any) => number));
123
- size: (() => number);
124
- isEmpty: (() => boolean);
125
- contains: ((value: any) => boolean);
126
- first: (() => any | undefined);
127
- last: (() => any | undefined);
128
- pollFirst: (() => any | undefined);
129
- pollLast: (() => any | undefined);
130
- add: ((value: any) => void);
131
- addAll: ((values: any) => void);
132
- getEqualValue: ((value: any) => any);
133
- getEqualValueOrAdd: ((value: any) => any);
134
- };
135
- export function createTransactionalValue(value?: any): {
136
- value: any;
137
- changes: {
138
- id: string;
139
- value: any;
140
- }[];
141
- };
142
- export function isTransactionalValueValid(transactionalValue: {
143
- value: any;
144
- changes: {
145
- id: string;
146
- value: any;
147
- }[];
148
- }): boolean;
149
- export function transactionalValueToString(transactionalValue: {
150
- value: any;
151
- changes: {
152
- id: string;
153
- value: any;
154
- }[];
155
- }): string;
156
- export function transactionSetAndCommit(transactionalValue: {
157
- value: any;
158
- changes: {
159
- id: string;
160
- value: any;
161
- }[];
162
- }, value: any): void;
163
- export function transactionSetWithoutCommitting(transactionalValue: {
164
- value: any;
165
- changes: {
166
- id: string;
167
- value: any;
168
- }[];
169
- }, value: any): string;
170
- export function transactionCommitChange(transactionalValue: {
171
- value: any;
172
- changes: {
173
- id: string;
174
- value: any;
175
- }[];
176
- }, changeId: string): boolean;
177
- export function transactionCancelChange(transactionalValue: {
178
- value: any;
179
- changes: {
180
- id: string;
181
- value: any;
182
- }[];
183
- }, changeId: string): boolean;
184
- export function transactionIsChangeRelevant(transactionalValue: {
185
- value: any;
186
- changes: {
187
- id: string;
188
- value: any;
189
- }[];
190
- }, changeId: string): boolean;
191
- export function transactionGetCommittedValue(transactionalValue: {
192
- value: any;
193
- changes: {
194
- id: string;
195
- value: any;
196
- }[];
197
- }): any;
198
- export function transactionGetValue(transactionalValue: {
199
- value: any;
200
- changes: {
201
- id: string;
202
- value: any;
203
- }[];
204
- }): any;
205
- export function createWorkerThread(name: string): {
206
- worker: Worker | null;
207
- sendMessage: (data: any, options: {
208
- timeout: number | undefined;
209
- } | undefined) => Promise<any>;
210
- };
211
- export function sendWorkerMessage(workerName: any, data: any, options: any): any;
212
- export function purgeEmail(email: string): string;
213
- export function isFocusClear(): boolean;
214
- export function getUserLocale(): any;
215
- export function getUserLocaleDateFormat(): any;
216
- }
217
- import FastDeepEqual from 'fast-deep-equal';
package/build/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export { LeUtils } from "./LeUtils.js";
2
- export { ISSET, IS_ARRAY, ARRAY, IS_OBJECT, OBJECT, STRING, STRING_ANY, INT, INT_ANY, FLOAT, FLOAT_ANY, INT_LAX, INT_LAX_ANY, FLOAT_LAX, FLOAT_LAX_ANY } from "./LeTypes.js";