@futdevpro/fsm-dynamo 1.14.9 → 1.14.11
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/build/_collections/constants/data-sizes.const.d.ts +3 -3
- package/build/_collections/constants/data-sizes.const.d.ts.map +1 -1
- package/build/_collections/constants/data-sizes.const.js +4 -3
- package/build/_collections/constants/data-sizes.const.js.map +1 -1
- package/build/_collections/utils/array.util.d.ts +189 -0
- package/build/_collections/utils/array.util.d.ts.map +1 -1
- package/build/_collections/utils/array.util.js +189 -0
- package/build/_collections/utils/array.util.js.map +1 -1
- package/build/_collections/utils/async.util.d.ts +29 -0
- package/build/_collections/utils/async.util.d.ts.map +1 -1
- package/build/_collections/utils/async.util.js +40 -0
- package/build/_collections/utils/async.util.js.map +1 -1
- package/build/_collections/utils/json-error-helper.util.d.ts +38 -0
- package/build/_collections/utils/json-error-helper.util.d.ts.map +1 -1
- package/build/_collections/utils/json-error-helper.util.js +38 -0
- package/build/_collections/utils/json-error-helper.util.js.map +1 -1
- package/build/_collections/utils/log.util.d.ts +195 -5
- package/build/_collections/utils/log.util.d.ts.map +1 -1
- package/build/_collections/utils/log.util.js +195 -5
- package/build/_collections/utils/log.util.js.map +1 -1
- package/build/_collections/utils/math/box-bounds.util.d.ts +36 -0
- package/build/_collections/utils/math/box-bounds.util.d.ts.map +1 -1
- package/build/_collections/utils/math/box-bounds.util.js +36 -0
- package/build/_collections/utils/math/box-bounds.util.js.map +1 -1
- package/build/_collections/utils/math/math.util.d.ts +48 -12
- package/build/_collections/utils/math/math.util.d.ts.map +1 -1
- package/build/_collections/utils/math/math.util.js +48 -14
- package/build/_collections/utils/math/math.util.js.map +1 -1
- package/build/_collections/utils/math/math.util.spec.js +0 -9
- package/build/_collections/utils/math/math.util.spec.js.map +1 -1
- package/build/_collections/utils/math/random.util.d.ts +30 -0
- package/build/_collections/utils/math/random.util.d.ts.map +1 -1
- package/build/_collections/utils/math/random.util.js +30 -0
- package/build/_collections/utils/math/random.util.js.map +1 -1
- package/build/_collections/utils/math/trigonometry.util.d.ts +30 -0
- package/build/_collections/utils/math/trigonometry.util.d.ts.map +1 -1
- package/build/_collections/utils/math/trigonometry.util.js +30 -0
- package/build/_collections/utils/math/trigonometry.util.js.map +1 -1
- package/build/_collections/utils/math/vector2.util.d.ts +247 -17
- package/build/_collections/utils/math/vector2.util.d.ts.map +1 -1
- package/build/_collections/utils/math/vector2.util.js +247 -19
- package/build/_collections/utils/math/vector2.util.js.map +1 -1
- package/build/_collections/utils/regex/password-regex.util.d.ts +12 -0
- package/build/_collections/utils/regex/password-regex.util.d.ts.map +1 -1
- package/build/_collections/utils/regex/password-regex.util.js +12 -0
- package/build/_collections/utils/regex/password-regex.util.js.map +1 -1
- package/build/_collections/utils/round-list.util.d.ts +39 -0
- package/build/_collections/utils/round-list.util.d.ts.map +1 -1
- package/build/_collections/utils/round-list.util.js +39 -0
- package/build/_collections/utils/round-list.util.js.map +1 -1
- package/build/_collections/utils/stack.util.d.ts +19 -0
- package/build/_collections/utils/stack.util.d.ts.map +1 -1
- package/build/_collections/utils/stack.util.js +19 -0
- package/build/_collections/utils/stack.util.js.map +1 -1
- package/build/_collections/utils/string.util.d.ts +17 -0
- package/build/_collections/utils/string.util.d.ts.map +1 -1
- package/build/_collections/utils/string.util.js +17 -0
- package/build/_collections/utils/string.util.js.map +1 -1
- package/build/_collections/utils/time.util.d.ts +136 -0
- package/build/_collections/utils/time.util.d.ts.map +1 -1
- package/build/_collections/utils/time.util.js +136 -0
- package/build/_collections/utils/time.util.js.map +1 -1
- package/build/_collections/utils/utilities.util.d.ts +17 -1
- package/build/_collections/utils/utilities.util.d.ts.map +1 -1
- package/build/_collections/utils/utilities.util.js +17 -1
- package/build/_collections/utils/utilities.util.js.map +1 -1
- package/build/_collections/utils/uuid.util.d.ts +6 -0
- package/build/_collections/utils/uuid.util.d.ts.map +1 -1
- package/build/_collections/utils/uuid.util.js +6 -0
- package/build/_collections/utils/uuid.util.js.map +1 -1
- package/build/_enums/data-model-type.enum.d.ts +6 -0
- package/build/_enums/data-model-type.enum.d.ts.map +1 -1
- package/build/_enums/data-model-type.enum.js +6 -0
- package/build/_enums/data-model-type.enum.js.map +1 -1
- package/build/_enums/http/http-call-type.enum.d.ts +8 -0
- package/build/_enums/http/http-call-type.enum.d.ts.map +1 -1
- package/build/_enums/http/http-call-type.enum.js +8 -0
- package/build/_enums/http/http-call-type.enum.js.map +1 -1
- package/build/_enums/http/http-event-type.enum.d.ts +5 -0
- package/build/_enums/http/http-event-type.enum.d.ts.map +1 -1
- package/build/_enums/http/http-event-type.enum.js +5 -0
- package/build/_enums/http/http-event-type.enum.js.map +1 -1
- package/build/_enums/time/day-of-week.enum.d.ts +14 -1
- package/build/_enums/time/day-of-week.enum.d.ts.map +1 -1
- package/build/_enums/time/day-of-week.enum.js +14 -1
- package/build/_enums/time/day-of-week.enum.js.map +1 -1
- package/build/_models/control-models/data-model-params.control-model.d.ts.map +1 -1
- package/build/_models/control-models/data-model-params.control-model.js +11 -1
- package/build/_models/control-models/data-model-params.control-model.js.map +1 -1
- package/build/_models/control-models/data-property-params.control-model.d.ts +8 -0
- package/build/_models/control-models/data-property-params.control-model.d.ts.map +1 -1
- package/build/_models/control-models/data-property-params.control-model.js +8 -0
- package/build/_models/control-models/data-property-params.control-model.js.map +1 -1
- package/build/_models/control-models/http/http-error-response.control-model.d.ts +25 -0
- package/build/_models/control-models/http/http-error-response.control-model.d.ts.map +1 -1
- package/build/_models/control-models/http/http-error-response.control-model.js +25 -0
- package/build/_models/control-models/http/http-error-response.control-model.js.map +1 -1
- package/build/_models/control-models/http/http-headers.control-model.d.ts +8 -0
- package/build/_models/control-models/http/http-headers.control-model.d.ts.map +1 -1
- package/build/_models/control-models/http/http-headers.control-model.js +8 -0
- package/build/_models/control-models/http/http-headers.control-model.js.map +1 -1
- package/build/_models/control-models/http/http-response.model-base.d.ts +9 -0
- package/build/_models/control-models/http/http-response.model-base.d.ts.map +1 -1
- package/build/_models/control-models/http/http-response.model-base.js +9 -0
- package/build/_models/control-models/http/http-response.model-base.js.map +1 -1
- package/build/_models/control-models/poll.control-model.d.ts +18 -0
- package/build/_models/control-models/poll.control-model.d.ts.map +1 -1
- package/build/_models/control-models/poll.control-model.js +18 -0
- package/build/_models/control-models/poll.control-model.js.map +1 -1
- package/build/_models/control-models/range-value.control-model.d.ts +141 -0
- package/build/_models/control-models/range-value.control-model.d.ts.map +1 -1
- package/build/_models/control-models/range-value.control-model.js +141 -0
- package/build/_models/control-models/range-value.control-model.js.map +1 -1
- package/build/_models/control-models/server-status.control-model.d.ts +10 -0
- package/build/_models/control-models/server-status.control-model.d.ts.map +1 -1
- package/build/_models/control-models/server-status.control-model.js +10 -0
- package/build/_models/control-models/server-status.control-model.js.map +1 -1
- package/build/_models/control-models/service-endpoint-settings-base.control-model.d.ts +12 -0
- package/build/_models/control-models/service-endpoint-settings-base.control-model.d.ts.map +1 -1
- package/build/_models/control-models/service-endpoint-settings-base.control-model.js +12 -0
- package/build/_models/control-models/service-endpoint-settings-base.control-model.js.map +1 -1
- package/build/_models/data-models/errors.data-model.d.ts +10 -0
- package/build/_models/data-models/errors.data-model.d.ts.map +1 -1
- package/build/_models/data-models/errors.data-model.js +10 -0
- package/build/_models/data-models/errors.data-model.js.map +1 -1
- package/build/_models/data-models/metadata.data-model.d.ts +26 -0
- package/build/_models/data-models/metadata.data-model.d.ts.map +1 -1
- package/build/_models/data-models/metadata.data-model.js +26 -0
- package/build/_models/data-models/metadata.data-model.js.map +1 -1
- package/build/_modules/ci-tools/_models/cit-ci-result-info.data-models.d.ts +23 -0
- package/build/_modules/ci-tools/_models/cit-ci-result-info.data-models.d.ts.map +1 -1
- package/build/_modules/ci-tools/_models/cit-ci-result-info.data-models.js +23 -0
- package/build/_modules/ci-tools/_models/cit-ci-result-info.data-models.js.map +1 -1
- package/build/_modules/custom-data/_models/cud.data-model.d.ts +7 -0
- package/build/_modules/custom-data/_models/cud.data-model.d.ts.map +1 -1
- package/build/_modules/custom-data/_models/cud.data-model.js +7 -0
- package/build/_modules/custom-data/_models/cud.data-model.js.map +1 -1
- package/build/_modules/location/_collections/loc-regions.util.d.ts +33 -0
- package/build/_modules/location/_collections/loc-regions.util.d.ts.map +1 -1
- package/build/_modules/location/_collections/loc-regions.util.js +33 -0
- package/build/_modules/location/_collections/loc-regions.util.js.map +1 -1
- package/build/_modules/location/_collections/loc.util.d.ts +10 -0
- package/build/_modules/location/_collections/loc.util.d.ts.map +1 -1
- package/build/_modules/location/_collections/loc.util.js +10 -0
- package/build/_modules/location/_collections/loc.util.js.map +1 -1
- package/futdevpro-fsm-dynamo-01.14.11.tgz +0 -0
- package/package.json +1 -1
- package/src/_collections/constants/data-sizes.const.ts +4 -4
- package/src/_collections/utils/array.util.ts +189 -0
- package/src/_collections/utils/async.util.ts +40 -0
- package/src/_collections/utils/json-error-helper.util.ts +38 -0
- package/src/_collections/utils/log.util.ts +194 -4
- package/src/_collections/utils/math/box-bounds.util.ts +36 -0
- package/src/_collections/utils/math/math.util.spec.ts +0 -10
- package/src/_collections/utils/math/math.util.ts +48 -16
- package/src/_collections/utils/math/random.util.ts +30 -0
- package/src/_collections/utils/math/trigonometry.util.ts +30 -0
- package/src/_collections/utils/math/vector2.util.ts +254 -24
- package/src/_collections/utils/regex/password-regex.util.ts +12 -0
- package/src/_collections/utils/round-list.util.ts +39 -0
- package/src/_collections/utils/stack.util.ts +19 -0
- package/src/_collections/utils/string.util.ts +17 -0
- package/src/_collections/utils/time.util.ts +136 -0
- package/src/_collections/utils/utilities.util.ts +17 -1
- package/src/_collections/utils/uuid.util.ts +6 -0
- package/src/_enums/data-model-type.enum.ts +6 -0
- package/src/_enums/http/http-call-type.enum.ts +8 -0
- package/src/_enums/http/http-event-type.enum.ts +5 -0
- package/src/_enums/time/day-of-week.enum.ts +14 -1
- package/src/_models/control-models/data-model-params.control-model.ts +11 -1
- package/src/_models/control-models/data-property-params.control-model.ts +8 -0
- package/src/_models/control-models/http/http-error-response.control-model.ts +25 -0
- package/src/_models/control-models/http/http-headers.control-model.ts +8 -0
- package/src/_models/control-models/http/http-response.model-base.ts +9 -0
- package/src/_models/control-models/poll.control-model.ts +18 -0
- package/src/_models/control-models/range-value.control-model.ts +141 -0
- package/src/_models/control-models/server-status.control-model.ts +10 -0
- package/src/_models/control-models/service-endpoint-settings-base.control-model.ts +12 -0
- package/src/_models/data-models/errors.data-model.ts +10 -0
- package/src/_models/data-models/metadata.data-model.ts +27 -0
- package/src/_modules/ci-tools/_models/cit-ci-result-info.data-models.ts +23 -0
- package/src/_modules/custom-data/_models/cud.data-model.ts +7 -0
- package/src/_modules/location/_collections/loc-regions.util.ts +34 -1
- package/src/_modules/location/_collections/loc.util.ts +10 -0
- package/futdevpro-fsm-dynamo-01.14.9.tgz +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* One byte is
|
|
2
|
+
* One byte is 8 bits
|
|
3
3
|
*/
|
|
4
|
-
export declare const byte =
|
|
4
|
+
export declare const byte = 8;
|
|
5
5
|
/**
|
|
6
6
|
* One kilobyte is 1024 bytes
|
|
7
7
|
*/
|
|
8
|
-
export declare const kilobyte
|
|
8
|
+
export declare const kilobyte = 1024;
|
|
9
9
|
/**
|
|
10
10
|
* One megabyte is 1024 kilobytes
|
|
11
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-sizes.const.d.ts","sourceRoot":"","sources":["../../../src/_collections/constants/data-sizes.const.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"data-sizes.const.d.ts","sourceRoot":"","sources":["../../../src/_collections/constants/data-sizes.const.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,IAAI,IAAI,CAAC;AACtB;;GAEG;AACH,eAAO,MAAM,QAAQ,OAAO,CAAC;AAC7B;;GAEG;AACH,eAAO,MAAM,QAAQ,QAAkB,CAAC;AACxC;;GAEG;AACH,eAAO,MAAM,QAAQ,QAAkB,CAAC;AACxC;;GAEG;AACH,eAAO,MAAM,QAAQ,QAAkB,CAAC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
//file méret számításoknál a byte a legkisebb egység amit használunk
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.terabyte = exports.gigabyte = exports.megabyte = exports.kilobyte = exports.byte = void 0;
|
|
4
5
|
/**
|
|
5
|
-
* One byte is
|
|
6
|
+
* One byte is 8 bits
|
|
6
7
|
*/
|
|
7
|
-
exports.byte =
|
|
8
|
+
exports.byte = 8;
|
|
8
9
|
/**
|
|
9
10
|
* One kilobyte is 1024 bytes
|
|
10
11
|
*/
|
|
11
|
-
exports.kilobyte =
|
|
12
|
+
exports.kilobyte = 1024;
|
|
12
13
|
/**
|
|
13
14
|
* One megabyte is 1024 kilobytes
|
|
14
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-sizes.const.js","sourceRoot":"","sources":["../../../src/_collections/constants/data-sizes.const.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"data-sizes.const.js","sourceRoot":"","sources":["../../../src/_collections/constants/data-sizes.const.ts"],"names":[],"mappings":";AAEA,oEAAoE;;;AAEpE;;GAEG;AACU,QAAA,IAAI,GAAG,CAAC,CAAC;AACtB;;GAEG;AACU,QAAA,QAAQ,GAAG,IAAI,CAAC;AAC7B;;GAEG;AACU,QAAA,QAAQ,GAAG,gBAAQ,GAAG,IAAI,CAAC;AACxC;;GAEG;AACU,QAAA,QAAQ,GAAG,gBAAQ,GAAG,IAAI,CAAC;AACxC;;GAEG;AACU,QAAA,QAAQ,GAAG,gBAAQ,GAAG,IAAI,CAAC"}
|
|
@@ -10,6 +10,14 @@ export declare class DyFM_Array {
|
|
|
10
10
|
* @param list - The array to iterate over.
|
|
11
11
|
* @param func - The function to apply to each element.
|
|
12
12
|
* @returns A promise that resolves when all elements have been processed.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const list: number[] = [ 1, 2, 3 ];
|
|
17
|
+
* await DyFM_Array.asyncForEach(list, async (element: number, index?: number, array?: number[]): Promise<void> => {
|
|
18
|
+
* console.log(element, index, array);
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
13
21
|
*/
|
|
14
22
|
static asyncForEach<T>(list: T[], func: (element: T, index?: number, array?: T[]) => Promise<void>): Promise<void>;
|
|
15
23
|
/**
|
|
@@ -18,6 +26,14 @@ export declare class DyFM_Array {
|
|
|
18
26
|
* @param list - The array to iterate over.
|
|
19
27
|
* @param func - The function to apply to each element.
|
|
20
28
|
* @returns A promise that resolves to the final result.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const list: number[] = [ 1, 2, 3 ];
|
|
33
|
+
* const result = await DyFM_Array.asyncForEachReturnToOne(0, list, async (element: number, dataCurrent: number, index?: number, array?: number[]): Promise<number> => {
|
|
34
|
+
* return dataCurrent + element;
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
21
37
|
*/
|
|
22
38
|
static asyncForEachReturnToOne<T, K>(startData: K, list: T[], func: (element: T, dataCurrent: K, index?: number, array?: T[]) => Promise<K>): Promise<K>;
|
|
23
39
|
/**
|
|
@@ -25,6 +41,14 @@ export declare class DyFM_Array {
|
|
|
25
41
|
* @param list - The array to iterate over.
|
|
26
42
|
* @param func - The function to apply to each element.
|
|
27
43
|
* @returns A promise that resolves to an array of results.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const list: number[] = [ 1, 2, 3 ];
|
|
48
|
+
* const result = await DyFM_Array.asyncForEachReturnToAll(list, async (element: number, index?: number, array?: number[]): Promise<number> => {
|
|
49
|
+
* return element * 2;
|
|
50
|
+
* });
|
|
51
|
+
* ```
|
|
28
52
|
*/
|
|
29
53
|
static asyncForEachReturnToAll<T, K>(list: T[], func: (element: T, index?: number, array?: T[]) => Promise<K>): Promise<K[]>;
|
|
30
54
|
/**
|
|
@@ -32,6 +56,15 @@ export declare class DyFM_Array {
|
|
|
32
56
|
* @param list - The array to iterate over.
|
|
33
57
|
* @param func - The function to apply to each element.
|
|
34
58
|
* @returns A promise that resolves to an array of results.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* const list: number[] = [ 1, 2, 3 ];
|
|
63
|
+
* const result = await DyFM_Array.asyncForEachAllAtOnce(list, async (element: number, index?: number, array?: number[]): Promise<number> => {
|
|
64
|
+
* return [ element * 2, element * 3 ];
|
|
65
|
+
* });
|
|
66
|
+
* console.log(result); // [ [ 2, 3 ], [ 4, 6 ], [ 6, 9 ] ]
|
|
67
|
+
* ```
|
|
35
68
|
*/
|
|
36
69
|
static asyncForEachAllAtOnce<T, R>(list: T[], func: (element: T, index?: number, array?: T[]) => Promise<R>): Promise<R[]>;
|
|
37
70
|
/**
|
|
@@ -39,6 +72,15 @@ export declare class DyFM_Array {
|
|
|
39
72
|
* @param list - The array to filter.
|
|
40
73
|
* @param filterFunc - The function to apply to each element.
|
|
41
74
|
* @returns A promise that resolves to an array of results.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* const list: number[] = [ 1, 2, 3 ];
|
|
79
|
+
* const result = await DyFM_Array.asyncFilter(list, async (element: number, index?: number, array?: number[]): Promise<boolean> => {
|
|
80
|
+
* return element % 2 === 0;
|
|
81
|
+
* });
|
|
82
|
+
* console.log(result); // [ 2 ]
|
|
83
|
+
* ```
|
|
42
84
|
*/
|
|
43
85
|
static asyncFilter<T>(list: T[], filterFunc: (element: T, index?: number, array?: T[]) => Promise<boolean>): Promise<T[]>;
|
|
44
86
|
/**
|
|
@@ -46,12 +88,28 @@ export declare class DyFM_Array {
|
|
|
46
88
|
* @param list - The array to map.
|
|
47
89
|
* @param mapFunc - The function to apply to each element.
|
|
48
90
|
* @returns A promise that resolves to an array of results.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```ts
|
|
94
|
+
* const list: number[] = [ 1, 2, 3 ];
|
|
95
|
+
* const result = await DyFM_Array.asyncMap(list, async (element: number, index?: number, array?: number[]): Promise<number> => {
|
|
96
|
+
* return element * 2;
|
|
97
|
+
* });
|
|
98
|
+
* console.log(result); // [ 2, 4, 6 ]
|
|
99
|
+
* ```
|
|
49
100
|
*/
|
|
50
101
|
static asyncMap<T, R>(list: T[], mapFunc: (element: T, index?: number, array?: T[]) => Promise<R>): Promise<R[]>;
|
|
51
102
|
/**
|
|
52
103
|
* Returns the last element of an array.
|
|
53
104
|
* @param array - The array to get the last element from.
|
|
54
105
|
* @returns The last element of the array, or null if the array is empty.
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```ts
|
|
109
|
+
* const list: number[] = [ 1, 2, 3 ];
|
|
110
|
+
* const result = DyFM_Array.last(list);
|
|
111
|
+
* console.log(result); // 3
|
|
112
|
+
* ```
|
|
55
113
|
*/
|
|
56
114
|
static last<T>(array: T[]): T | null;
|
|
57
115
|
/**
|
|
@@ -59,6 +117,13 @@ export declare class DyFM_Array {
|
|
|
59
117
|
* @param string - The string to check.
|
|
60
118
|
* @param array - The array to check.
|
|
61
119
|
* @returns True if the string is the last element of the array, false otherwise.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```ts
|
|
123
|
+
* const list: number[] = [ 1, 2, 3 ];
|
|
124
|
+
* const result = DyFM_Array.isLast(3, list);
|
|
125
|
+
* console.log(result); // true
|
|
126
|
+
* ```
|
|
62
127
|
*/
|
|
63
128
|
static isLast<T>(element: T, array: T[]): boolean;
|
|
64
129
|
/**
|
|
@@ -66,6 +131,13 @@ export declare class DyFM_Array {
|
|
|
66
131
|
* @param string - The string to check.
|
|
67
132
|
* @param array - The array to check.
|
|
68
133
|
* @returns True if the string is the last element of the array, false otherwise.
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```ts
|
|
137
|
+
* const list: number[] = [ 1, 2, 3 ];
|
|
138
|
+
* const result = DyFM_Array.isLastIndex(2, list);
|
|
139
|
+
* console.log(result); // true
|
|
140
|
+
* ```
|
|
69
141
|
*/
|
|
70
142
|
static isLastIndex<T>(index: number, array: T[]): boolean;
|
|
71
143
|
/**
|
|
@@ -73,18 +145,39 @@ export declare class DyFM_Array {
|
|
|
73
145
|
* @param string - The string to check.
|
|
74
146
|
* @param array - The array to check.
|
|
75
147
|
* @returns True if the string is the first element of the array, false otherwise.
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```ts
|
|
151
|
+
* const list: number[] = [ 1, 2, 3 ];
|
|
152
|
+
* const result = DyFM_Array.isFirst(1, list);
|
|
153
|
+
* console.log(result); // true
|
|
154
|
+
* ```
|
|
76
155
|
*/
|
|
77
156
|
static isFirst<T>(element: T, array: T[]): boolean;
|
|
78
157
|
/**
|
|
79
158
|
* Returns the last character of a string.
|
|
80
159
|
* @param string - The string to get the last character from.
|
|
81
160
|
* @returns The last character of the string, or null if the string is empty.
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```ts
|
|
164
|
+
* const string = 'hello';
|
|
165
|
+
* const result = DyFM_Array.lastCharacter(string);
|
|
166
|
+
* console.log(result); // 'o'
|
|
167
|
+
* ```
|
|
82
168
|
*/
|
|
83
169
|
static lastCharacter(string: string): string | null;
|
|
84
170
|
/**
|
|
85
171
|
* Returns the first element of an array.
|
|
86
172
|
* @param array - The array to get the first element from.
|
|
87
173
|
* @returns The first element of the array, or null if the array is empty.
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* ```ts
|
|
177
|
+
* const list: number[] = [ 1, 2, 3 ];
|
|
178
|
+
* const result = DyFM_Array.first(list);
|
|
179
|
+
* console.log(result); // 1
|
|
180
|
+
* ```
|
|
88
181
|
*/
|
|
89
182
|
static first<T>(array: T[]): T | null;
|
|
90
183
|
/**
|
|
@@ -92,6 +185,13 @@ export declare class DyFM_Array {
|
|
|
92
185
|
* @param array - The array to remove the element from.
|
|
93
186
|
* @param element - The element to remove from the array.
|
|
94
187
|
* @returns The array with the element removed.
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* ```ts
|
|
191
|
+
* const list: number[] = [ 1, 2, 3 ];
|
|
192
|
+
* const result = DyFM_Array.remove(list, 2);
|
|
193
|
+
* console.log(result); // [ 1, 3 ]
|
|
194
|
+
* ```
|
|
95
195
|
*/
|
|
96
196
|
static remove<T>(array: T[], element: T): T[];
|
|
97
197
|
/**
|
|
@@ -99,12 +199,28 @@ export declare class DyFM_Array {
|
|
|
99
199
|
* @param array - The array to find and remove the element from.
|
|
100
200
|
* @param func - The function to apply to each element.
|
|
101
201
|
* @returns The array with the element removed.
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* ```ts
|
|
205
|
+
* const list: number[] = [ 1, 2, 3 ];
|
|
206
|
+
* const result = DyFM_Array.findNRemove(list, (element: number, index?: number, array?: number[]): boolean => {
|
|
207
|
+
* return element === 2;
|
|
208
|
+
* });
|
|
209
|
+
* console.log(result); // [ 1, 3 ]
|
|
210
|
+
* ```
|
|
102
211
|
*/
|
|
103
212
|
static findNRemove<T>(array: T[], func: (element: T, index?: number, array?: T[]) => boolean): T[];
|
|
104
213
|
/**
|
|
105
214
|
* Shuffles an array.
|
|
106
215
|
* @param array - The array to shuffle.
|
|
107
216
|
* @returns The shuffled array.
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* ```ts
|
|
220
|
+
* const list: number[] = [ 1, 2, 3 ];
|
|
221
|
+
* const result = DyFM_Array.shuffle(list);
|
|
222
|
+
* console.log(result); // [ 3, 1, 2 ]
|
|
223
|
+
* ```
|
|
108
224
|
*/
|
|
109
225
|
static shuffle<T>(array: T[]): T[];
|
|
110
226
|
/**
|
|
@@ -113,6 +229,13 @@ export declare class DyFM_Array {
|
|
|
113
229
|
* @param pageIndex - The index of the page to return.
|
|
114
230
|
* @param pageSize - The size of the page.
|
|
115
231
|
* @returns The page of the array.
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* ```ts
|
|
235
|
+
* const list: number[] = [ 1, 2, 3, 4, 5, 6, 7, 8 ];
|
|
236
|
+
* const result = DyFM_Array.page(list, 0, 2);
|
|
237
|
+
* console.log(result); // [ 1, 2 ]
|
|
238
|
+
* ```
|
|
116
239
|
*/
|
|
117
240
|
static page<T>(array: T[], pageIndex: number, pageSize: number): T[];
|
|
118
241
|
/**
|
|
@@ -121,6 +244,13 @@ export declare class DyFM_Array {
|
|
|
121
244
|
* @param pageIndex - The index of the page to return.
|
|
122
245
|
* @param pageSize - The size of the page.
|
|
123
246
|
* @returns The page of the array.
|
|
247
|
+
*
|
|
248
|
+
* @example
|
|
249
|
+
* ```ts
|
|
250
|
+
* const list: number[] = [ 1, 2, 3, 4, 5, 6, 7, 8 ];
|
|
251
|
+
* const result = DyFM_Array.paged(list, 0, 2);
|
|
252
|
+
* console.log(result); // { pageIndex: 0, pageSize: 2, total: 8, totalPageCount: 4, items: [ 1, 2 ] }
|
|
253
|
+
* ```
|
|
124
254
|
*/
|
|
125
255
|
static paged<T>(array: T[], pageIndex: number, pageSize: number): DyFM_Paged<T>;
|
|
126
256
|
/**
|
|
@@ -129,24 +259,52 @@ export declare class DyFM_Array {
|
|
|
129
259
|
* @param indexA - The index of the first element to swap.
|
|
130
260
|
* @param indexB - The index of the second element to swap.
|
|
131
261
|
* @returns The array with the elements swapped.
|
|
262
|
+
*
|
|
263
|
+
* @example
|
|
264
|
+
* ```ts
|
|
265
|
+
* const list: number[] = [ 1, 2, 3 ];
|
|
266
|
+
* const result = DyFM_Array.swap(list, 0, 2);
|
|
267
|
+
* console.log(result); // [ 3, 2, 1 ]
|
|
268
|
+
* ```
|
|
132
269
|
*/
|
|
133
270
|
static swap<T>(array: T[], indexA: number, indexB: number): T[];
|
|
134
271
|
/**
|
|
135
272
|
* Checks if a string list has multiplications.
|
|
136
273
|
* @param stringList - The string list to check.
|
|
137
274
|
* @returns True if the string list has multiplications, false otherwise.
|
|
275
|
+
*
|
|
276
|
+
* @example
|
|
277
|
+
* ```ts
|
|
278
|
+
* const list: string[] = [ 'a', 'b', 'c', 'a' ];
|
|
279
|
+
* const result = DyFM_Array.stringListHasMultiplications(list);
|
|
280
|
+
* console.log(result); // true
|
|
281
|
+
* ```
|
|
138
282
|
*/
|
|
139
283
|
static stringListHasMultiplications(stringList: string[]): boolean;
|
|
140
284
|
/**
|
|
141
285
|
* Filters a string list to remove multiplications.
|
|
142
286
|
* @param stringList - The string list to filter.
|
|
143
287
|
* @returns The filtered string list.
|
|
288
|
+
*
|
|
289
|
+
* @example
|
|
290
|
+
* ```ts
|
|
291
|
+
* const list: string[] = [ 'a', 'b', 'c', 'a' ];
|
|
292
|
+
* const result = DyFM_Array.filterStringMultiplications(list);
|
|
293
|
+
* console.log(result); // [ 'a', 'b', 'c' ]
|
|
294
|
+
* ```
|
|
144
295
|
*/
|
|
145
296
|
static filterStringMultiplications(stringList: string[]): string[];
|
|
146
297
|
/**
|
|
147
298
|
* Gathers multiplications from a string list.
|
|
148
299
|
* @param stringList - The string list to gather multiplications from.
|
|
149
300
|
* @returns The gathered multiplications.
|
|
301
|
+
*
|
|
302
|
+
* @example
|
|
303
|
+
* ```ts
|
|
304
|
+
* const list: string[] = [ 'a', 'b', 'c', 'a' ];
|
|
305
|
+
* const result = DyFM_Array.gatherStringMultiplications(list);
|
|
306
|
+
* console.log(result); // [ [ 'a', 'a' ] ]
|
|
307
|
+
* ```
|
|
150
308
|
*/
|
|
151
309
|
static gatherStringMultiplications(stringList: string[]): string[][];
|
|
152
310
|
/**
|
|
@@ -154,6 +312,13 @@ export declare class DyFM_Array {
|
|
|
154
312
|
* @param dataList - The data list to check.
|
|
155
313
|
* @param byKey - The key to check for multiplications.
|
|
156
314
|
* @returns True if the data list has multiplications, false otherwise.
|
|
315
|
+
*
|
|
316
|
+
* @example
|
|
317
|
+
* ```ts
|
|
318
|
+
* const list: { _id: number, name: string }[] = [ { _id: 1, name: 'John' }, { _id: 2, name: 'Jane' }, { _id: 1, name: 'Bob' } ];
|
|
319
|
+
* const result = DyFM_Array.haveMultiplications(list, '_id');
|
|
320
|
+
* console.log(result); // true
|
|
321
|
+
* ```
|
|
157
322
|
*/
|
|
158
323
|
static haveMultiplications<T extends object>(dataList: T[], byKey?: keyof T): boolean;
|
|
159
324
|
/**
|
|
@@ -161,6 +326,13 @@ export declare class DyFM_Array {
|
|
|
161
326
|
* @param dataList - The data list to filter.
|
|
162
327
|
* @param byKey - The key to filter for multiplications.
|
|
163
328
|
* @returns The filtered data list.
|
|
329
|
+
*
|
|
330
|
+
* @example
|
|
331
|
+
* ```ts
|
|
332
|
+
* const list: { _id: number, name: string }[] = [ { _id: 1, name: 'John' }, { _id: 2, name: 'Jane' }, { _id: 1, name: 'Bob' } ];
|
|
333
|
+
* const result = DyFM_Array.filterMultiplications(list, '_id');
|
|
334
|
+
* console.log(result); // [ { _id: 1, name: 'John' } , { _id: 2, name: 'Jane' } ]
|
|
335
|
+
* ```
|
|
164
336
|
*/
|
|
165
337
|
static filterMultiplications<T extends object>(dataList: T[], byKey?: keyof T): T[];
|
|
166
338
|
/**
|
|
@@ -168,6 +340,13 @@ export declare class DyFM_Array {
|
|
|
168
340
|
* @param dataList - The data list to gather multiplications from.
|
|
169
341
|
* @param byKey - The key to gather multiplications from.
|
|
170
342
|
* @returns The gathered multiplications.
|
|
343
|
+
*
|
|
344
|
+
* @example
|
|
345
|
+
* ```ts
|
|
346
|
+
* const list: { _id: number, name: string }[] = [ { _id: 1, name: 'John' }, { _id: 2, name: 'Jane' }, { _id: 1, name: 'Bob' } ];
|
|
347
|
+
* const result = DyFM_Array.gatherMultiplications(list, '_id');
|
|
348
|
+
* console.log(result); // [ [ { _id: 1, name: 'John' }, { _id: 1, name: 'Bob' } ] ]
|
|
349
|
+
* ```
|
|
171
350
|
*/
|
|
172
351
|
static gatherMultiplications<T extends object>(dataList: T[], byKey?: keyof T): T[][];
|
|
173
352
|
/**
|
|
@@ -175,6 +354,15 @@ export declare class DyFM_Array {
|
|
|
175
354
|
* @param array - The array to find the element in.
|
|
176
355
|
* @param func - The function to apply to each element.
|
|
177
356
|
* @returns The element found, or null if no element is found.
|
|
357
|
+
*
|
|
358
|
+
* @example
|
|
359
|
+
* ```ts
|
|
360
|
+
* const list: number[] = [ 1, 2, 3 ];
|
|
361
|
+
* const result = DyFM_Array.findFromEnd(list, (element: number, index?: number, array?: number[]): boolean => {
|
|
362
|
+
* return element === 2;
|
|
363
|
+
* });
|
|
364
|
+
* console.log(result); // 2
|
|
365
|
+
* ```
|
|
178
366
|
*/
|
|
179
367
|
static findFromEnd<T>(array: T[], func: (element: T, index?: number, array?: T[]) => boolean): T | null;
|
|
180
368
|
/**
|
|
@@ -182,6 +370,7 @@ export declare class DyFM_Array {
|
|
|
182
370
|
* sorts so that the objects that have the value true for the checkFor function are at the beginning of the array
|
|
183
371
|
* @param checkFor
|
|
184
372
|
* @returns
|
|
373
|
+
*
|
|
185
374
|
*/
|
|
186
375
|
static getSortForTrueFn<T>(checkFor: (a: T) => boolean): (a: T, b: T) => DyFM_SortDirection;
|
|
187
376
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.util.d.ts","sourceRoot":"","sources":["../../../src/_collections/utils/array.util.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;AAG3C,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC;AAEnC,qBAAa,UAAU;IAErB
|
|
1
|
+
{"version":3,"file":"array.util.d.ts","sourceRoot":"","sources":["../../../src/_collections/utils/array.util.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,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