@futdevpro/fsm-dynamo 1.8.4 → 1.9.1
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/.eslintrc.json +9 -6
- package/lib/_constants/error-defaults.const.d.ts +2 -2
- package/lib/_constants/error-defaults.const.d.ts.map +1 -1
- package/lib/_constants/error-defaults.const.js +2 -2
- package/lib/_constants/error-defaults.const.js.map +1 -1
- package/lib/_constants/module-settings/custom-data-module-settings.const.d.ts +6 -2
- package/lib/_constants/module-settings/custom-data-module-settings.const.d.ts.map +1 -1
- package/lib/_constants/module-settings/custom-data-module-settings.const.js +9 -4
- package/lib/_constants/module-settings/custom-data-module-settings.const.js.map +1 -1
- package/lib/_constants/module-settings/test-module-settings.const.d.ts +8 -2
- package/lib/_constants/module-settings/test-module-settings.const.d.ts.map +1 -1
- package/lib/_constants/module-settings/test-module-settings.const.js +13 -8
- package/lib/_constants/module-settings/test-module-settings.const.js.map +1 -1
- package/lib/_constants/module-settings/usage-module-settings.const.d.ts +8 -2
- package/lib/_constants/module-settings/usage-module-settings.const.d.ts.map +1 -1
- package/lib/_constants/module-settings/usage-module-settings.const.js +13 -6
- package/lib/_constants/module-settings/usage-module-settings.const.js.map +1 -1
- package/lib/_enums/basic-property-type.enum.d.ts +1 -1
- package/lib/_enums/basic-property-type.enum.d.ts.map +1 -1
- package/lib/_enums/basic-property-type.enum.js +9 -9
- package/lib/_enums/basic-property-type.enum.js.map +1 -1
- package/lib/_enums/data-model-type.enum.d.ts +1 -1
- package/lib/_enums/data-model-type.enum.d.ts.map +1 -1
- package/lib/_enums/data-model-type.enum.js +7 -7
- package/lib/_enums/data-model-type.enum.js.map +1 -1
- package/lib/_enums/day-of-week.enum.d.ts +4 -4
- package/lib/_enums/day-of-week.enum.d.ts.map +1 -1
- package/lib/_enums/day-of-week.enum.js +21 -21
- package/lib/_enums/day-of-week.enum.js.map +1 -1
- package/lib/_enums/error-level.enum.d.ts +1 -1
- package/lib/_enums/error-level.enum.d.ts.map +1 -1
- package/lib/_enums/error-level.enum.js +13 -13
- package/lib/_enums/error-level.enum.js.map +1 -1
- package/lib/_enums/log-style.enum.d.ts +1 -1
- package/lib/_enums/log-style.enum.d.ts.map +1 -1
- package/lib/_enums/log-style.enum.js +27 -27
- package/lib/_enums/log-style.enum.js.map +1 -1
- package/lib/_enums/month.enum.d.ts +1 -1
- package/lib/_enums/month.enum.d.ts.map +1 -1
- package/lib/_enums/month.enum.js +16 -16
- package/lib/_enums/month.enum.js.map +1 -1
- package/lib/_enums/region.enum.d.ts +1 -1
- package/lib/_enums/region.enum.d.ts.map +1 -1
- package/lib/_enums/region.enum.js +9 -9
- package/lib/_enums/region.enum.js.map +1 -1
- package/lib/_enums/relative-date.enum.d.ts +1 -1
- package/lib/_enums/relative-date.enum.d.ts.map +1 -1
- package/lib/_enums/relative-date.enum.js +10 -10
- package/lib/_enums/relative-date.enum.js.map +1 -1
- package/lib/_enums/sub-region.enum.d.ts +1 -1
- package/lib/_enums/sub-region.enum.d.ts.map +1 -1
- package/lib/_enums/sub-region.enum.js +21 -21
- package/lib/_enums/sub-region.enum.js.map +1 -1
- package/lib/_enums/subdivision-region-type.enum.d.ts +1 -1
- package/lib/_enums/subdivision-region-type.enum.d.ts.map +1 -1
- package/lib/_enums/subdivision-region-type.enum.js +42 -42
- package/lib/_enums/subdivision-region-type.enum.js.map +1 -1
- package/lib/_models/control-models/daily-usage-data.control-model.d.ts +5 -5
- package/lib/_models/control-models/daily-usage-data.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/daily-usage-data.control-model.js +3 -3
- package/lib/_models/control-models/daily-usage-data.control-model.js.map +1 -1
- package/lib/_models/control-models/data-model-params.control-model.d.ts +13 -14
- package/lib/_models/control-models/data-model-params.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/data-model-params.control-model.js +9 -15
- package/lib/_models/control-models/data-model-params.control-model.js.map +1 -1
- package/lib/_models/control-models/data-property-params.control-model.d.ts +9 -9
- package/lib/_models/control-models/data-property-params.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/data-property-params.control-model.js +10 -10
- package/lib/_models/control-models/data-property-params.control-model.js.map +1 -1
- package/lib/_models/control-models/error.control-model.d.ts +15 -15
- package/lib/_models/control-models/error.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/error.control-model.js +18 -18
- package/lib/_models/control-models/error.control-model.js.map +1 -1
- package/lib/_models/control-models/error.control-model.spec.js +34 -34
- package/lib/_models/control-models/error.control-model.spec.js.map +1 -1
- package/lib/_models/control-models/poll.control-model.d.ts +2 -2
- package/lib/_models/control-models/poll.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/poll.control-model.js +8 -8
- package/lib/_models/control-models/poll.control-model.js.map +1 -1
- package/lib/_models/control-models/range-value.control-model.d.ts +20 -20
- package/lib/_models/control-models/range-value.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/range-value.control-model.js +15 -15
- package/lib/_models/control-models/range-value.control-model.js.map +1 -1
- package/lib/_models/control-models/usage-action.control-model.d.ts +3 -3
- package/lib/_models/control-models/usage-action.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/usage-action.control-model.js +3 -3
- package/lib/_models/control-models/usage-action.control-model.js.map +1 -1
- package/lib/_models/control-models/usage-data.control-model.d.ts +6 -6
- package/lib/_models/control-models/usage-data.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/usage-data.control-model.js +3 -3
- package/lib/_models/control-models/usage-data.control-model.js.map +1 -1
- package/lib/_models/data-models/custom-data.data-model.d.ts +7 -7
- package/lib/_models/data-models/custom-data.data-model.d.ts.map +1 -1
- package/lib/_models/data-models/custom-data.data-model.js +4 -4
- package/lib/_models/data-models/custom-data.data-model.js.map +1 -1
- package/lib/_models/data-models/metadata.data-model.d.ts +5 -5
- package/lib/_models/data-models/metadata.data-model.d.ts.map +1 -1
- package/lib/_models/data-models/metadata.data-model.js +3 -3
- package/lib/_models/data-models/metadata.data-model.js.map +1 -1
- package/lib/_models/data-models/usage-session.data-model.d.ts +10 -10
- package/lib/_models/data-models/usage-session.data-model.d.ts.map +1 -1
- package/lib/_models/data-models/usage-session.data-model.js +4 -4
- package/lib/_models/data-models/usage-session.data-model.js.map +1 -1
- package/lib/_models/interfaces/error-defaults.interface.d.ts +1 -1
- package/lib/_models/interfaces/error-defaults.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/location/country-division.interface.d.ts +1 -1
- package/lib/_models/interfaces/location/country-division.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/location/country-iso.interface.d.ts +7 -7
- package/lib/_models/interfaces/location/country-iso.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/location/country-phone-code.interface.d.ts +1 -1
- package/lib/_models/interfaces/location/country-phone-code.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/location/division-collection.interface.d.ts +1 -1
- package/lib/_models/interfaces/location/division-collection.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/location/division-region-data.interface.d.ts +4 -4
- package/lib/_models/interfaces/location/division-region-data.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/location/geo-ip-location.interface.d.ts +1 -1
- package/lib/_models/interfaces/location/geo-ip-location.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/location/location-coordinates.interface.d.ts +1 -1
- package/lib/_models/interfaces/location/location-coordinates.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/paged.interace.d.ts +1 -1
- package/lib/_models/interfaces/paged.interace.d.ts.map +1 -1
- package/lib/_models/interfaces/random-weight.interface.d.ts +1 -1
- package/lib/_models/interfaces/random-weight.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/route-settings.interface.d.ts +4 -4
- package/lib/_models/interfaces/route-settings.interface.d.ts.map +1 -1
- package/lib/_utils/array.util.d.ts +4 -4
- package/lib/_utils/array.util.d.ts.map +1 -1
- package/lib/_utils/array.util.js +3 -3
- package/lib/_utils/array.util.js.map +1 -1
- package/lib/_utils/array.util.spec.js +5 -5
- package/lib/_utils/array.util.spec.js.map +1 -1
- package/lib/_utils/box-bounds.util.d.ts +12 -12
- package/lib/_utils/box-bounds.util.d.ts.map +1 -1
- package/lib/_utils/box-bounds.util.js +7 -7
- package/lib/_utils/box-bounds.util.js.map +1 -1
- package/lib/_utils/index.d.ts +0 -1
- package/lib/_utils/index.d.ts.map +1 -1
- package/lib/_utils/index.js +0 -1
- package/lib/_utils/index.js.map +1 -1
- package/lib/_utils/location.util.d.ts +4 -4
- package/lib/_utils/location.util.d.ts.map +1 -1
- package/lib/_utils/location.util.js +9 -9
- package/lib/_utils/location.util.js.map +1 -1
- package/lib/_utils/log.util.d.ts +17 -17
- package/lib/_utils/log.util.d.ts.map +1 -1
- package/lib/_utils/log.util.js +25 -25
- package/lib/_utils/log.util.js.map +1 -1
- package/lib/_utils/math.util.d.ts +1 -1
- package/lib/_utils/math.util.d.ts.map +1 -1
- package/lib/_utils/math.util.js +3 -3
- package/lib/_utils/math.util.js.map +1 -1
- package/lib/_utils/random.util.d.ts +5 -5
- package/lib/_utils/random.util.d.ts.map +1 -1
- package/lib/_utils/random.util.js +3 -3
- package/lib/_utils/random.util.js.map +1 -1
- package/lib/_utils/regex/password-regex.util.d.ts +2 -2
- package/lib/_utils/regex/password-regex.util.d.ts.map +1 -1
- package/lib/_utils/regex/password-regex.util.js +7 -7
- package/lib/_utils/regex/password-regex.util.js.map +1 -1
- package/lib/_utils/regex/username-regex.util.d.ts +1 -1
- package/lib/_utils/regex/username-regex.util.d.ts.map +1 -1
- package/lib/_utils/regex/username-regex.util.js +3 -3
- package/lib/_utils/regex/username-regex.util.js.map +1 -1
- package/lib/_utils/regex.util.d.ts +1 -1
- package/lib/_utils/regex.util.d.ts.map +1 -1
- package/lib/_utils/regex.util.js +2 -2
- package/lib/_utils/regex.util.js.map +1 -1
- package/lib/_utils/regions.util.d.ts +12 -12
- package/lib/_utils/regions.util.d.ts.map +1 -1
- package/lib/_utils/regions.util.js +13 -13
- package/lib/_utils/regions.util.js.map +1 -1
- package/lib/_utils/round-list.util.d.ts +2 -2
- package/lib/_utils/round-list.util.d.ts.map +1 -1
- package/lib/_utils/round-list.util.js +3 -3
- package/lib/_utils/round-list.util.js.map +1 -1
- package/lib/_utils/shared.static-service.d.ts +2 -2
- package/lib/_utils/shared.static-service.d.ts.map +1 -1
- package/lib/_utils/shared.static-service.js +8 -8
- package/lib/_utils/shared.static-service.js.map +1 -1
- package/lib/_utils/time.util.d.ts +16 -16
- package/lib/_utils/time.util.d.ts.map +1 -1
- package/lib/_utils/time.util.js +29 -29
- package/lib/_utils/time.util.js.map +1 -1
- package/lib/_utils/trigonometry.util.d.ts +4 -4
- package/lib/_utils/trigonometry.util.d.ts.map +1 -1
- package/lib/_utils/trigonometry.util.js +3 -3
- package/lib/_utils/trigonometry.util.js.map +1 -1
- package/lib/_utils/type-cloning-facility.util.d.ts +4 -4
- package/lib/_utils/type-cloning-facility.util.d.ts.map +1 -1
- package/lib/_utils/type-cloning-facility.util.js +3 -3
- package/lib/_utils/type-cloning-facility.util.js.map +1 -1
- package/lib/_utils/utilities.util.d.ts +25 -25
- package/lib/_utils/utilities.util.d.ts.map +1 -1
- package/lib/_utils/utilities.util.js +34 -34
- package/lib/_utils/utilities.util.js.map +1 -1
- package/lib/_utils/vector2.util.d.ts +36 -36
- package/lib/_utils/vector2.util.d.ts.map +1 -1
- package/lib/_utils/vector2.util.js +37 -37
- package/lib/_utils/vector2.util.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +157 -160
- package/src/_constants/error-defaults.const.ts +2 -2
- package/src/_constants/module-settings/custom-data-module-settings.const.ts +9 -4
- package/src/_constants/module-settings/test-module-settings.const.ts +13 -8
- package/src/_constants/module-settings/usage-module-settings.const.ts +13 -6
- package/src/_enums/basic-property-type.enum.ts +1 -1
- package/src/_enums/data-model-type.enum.ts +1 -1
- package/src/_enums/day-of-week.enum.ts +11 -11
- package/src/_enums/error-level.enum.ts +1 -1
- package/src/_enums/log-style.enum.ts +1 -1
- package/src/_enums/month.enum.ts +1 -1
- package/src/_enums/region.enum.ts +1 -1
- package/src/_enums/relative-date.enum.ts +1 -1
- package/src/_enums/sub-region.enum.ts +1 -1
- package/src/_enums/subdivision-region-type.enum.ts +1 -1
- package/src/_models/control-models/daily-usage-data.control-model.ts +5 -5
- package/src/_models/control-models/data-model-params.control-model.ts +15 -25
- package/src/_models/control-models/data-property-params.control-model.ts +15 -15
- package/src/_models/control-models/error.control-model.spec.ts +69 -69
- package/src/_models/control-models/error.control-model.ts +80 -80
- package/src/_models/control-models/poll.control-model.ts +8 -8
- package/src/_models/control-models/range-value.control-model.ts +58 -58
- package/src/_models/control-models/usage-action.control-model.ts +3 -3
- package/src/_models/control-models/usage-data.control-model.ts +6 -6
- package/src/_models/data-models/custom-data.data-model.ts +13 -12
- package/src/_models/data-models/metadata.data-model.ts +5 -5
- package/src/_models/data-models/usage-session.data-model.ts +28 -27
- package/src/_models/interfaces/error-defaults.interface.ts +1 -1
- package/src/_models/interfaces/location/country-division.interface.ts +1 -1
- package/src/_models/interfaces/location/country-iso.interface.ts +7 -7
- package/src/_models/interfaces/location/country-phone-code.interface.ts +1 -1
- package/src/_models/interfaces/location/division-collection.interface.ts +1 -1
- package/src/_models/interfaces/location/division-region-data.interface.ts +4 -4
- package/src/_models/interfaces/location/geo-ip-location.interface.ts +1 -1
- package/src/_models/interfaces/location/location-coordinates.interface.ts +1 -1
- package/src/_models/interfaces/paged.interace.ts +1 -1
- package/src/_models/interfaces/random-weight.interface.ts +1 -1
- package/src/_models/interfaces/route-settings.interface.ts +4 -4
- package/src/_utils/array.util.spec.ts +7 -7
- package/src/_utils/array.util.ts +4 -4
- package/src/_utils/box-bounds.util.ts +19 -19
- package/src/_utils/index.ts +0 -1
- package/src/_utils/location.util.ts +13 -13
- package/src/_utils/log.util.ts +36 -36
- package/src/_utils/math.util.ts +1 -1
- package/src/_utils/random.util.ts +9 -5
- package/src/_utils/regex/password-regex.util.ts +5 -5
- package/src/_utils/regex/username-regex.util.ts +2 -2
- package/src/_utils/regex.util.ts +1 -1
- package/src/_utils/regions.util.ts +33 -33
- package/src/_utils/round-list.util.ts +2 -2
- package/src/_utils/shared.static-service.ts +8 -8
- package/src/_utils/time.util.ts +40 -40
- package/src/_utils/trigonometry.util.ts +4 -4
- package/src/_utils/type-cloning-facility.util.ts +4 -4
- package/src/_utils/utilities.util.ts +31 -27
- package/src/_utils/vector2.util.ts +67 -67
- package/tsconfig.json +2 -1
- package/lib/_utils/metadata.util.d.ts +0 -2
- package/lib/_utils/metadata.util.d.ts.map +0 -1
- package/lib/_utils/metadata.util.js +0 -32
- package/lib/_utils/metadata.util.js.map +0 -1
- package/src/_utils/metadata.util.ts +0 -31
|
@@ -4,7 +4,7 @@ const defaultErrorMsg = ' failed. ' +
|
|
|
4
4
|
'containes object hooks for its own objects, therefore its creating an object loop. ' +
|
|
5
5
|
'See further information in the detailed error:\n\n';
|
|
6
6
|
|
|
7
|
-
export function
|
|
7
|
+
export function DynamoFM_clone<T>(object: T): T {
|
|
8
8
|
try {
|
|
9
9
|
return object ? JSON.parse(JSON.stringify(object)) as T : object;
|
|
10
10
|
} catch (error) {
|
|
@@ -16,11 +16,11 @@ export function Dynamo_clone<T>(object: T): T {
|
|
|
16
16
|
throw error;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
export const
|
|
20
|
-
export const
|
|
21
|
-
export const
|
|
19
|
+
export const DynamoFM_copy = DynamoFM_clone;
|
|
20
|
+
export const DFM_clone = DynamoFM_clone;
|
|
21
|
+
export const DFM_copy = DynamoFM_clone;
|
|
22
22
|
|
|
23
|
-
export function
|
|
23
|
+
export function DynamoFM_surfaceClone<T>(object: T): T {
|
|
24
24
|
try {
|
|
25
25
|
const result = {};
|
|
26
26
|
|
|
@@ -38,11 +38,11 @@ export function Dynamo_surfaceClone<T>(object: T): T {
|
|
|
38
38
|
throw error;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
export const
|
|
42
|
-
export const
|
|
43
|
-
export const
|
|
41
|
+
export const DynamoFM_surfaceCopy = DynamoFM_surfaceClone;
|
|
42
|
+
export const DFM_surfaceClone = DynamoFM_surfaceClone;
|
|
43
|
+
export const DFM_surfaceCopy = DynamoFM_surfaceClone;
|
|
44
44
|
|
|
45
|
-
export function
|
|
45
|
+
export function DynamoFM_sameObjects<T>(objA: T, objB: T): boolean {
|
|
46
46
|
try {
|
|
47
47
|
return JSON.stringify(objA) === JSON.stringify(objB);
|
|
48
48
|
} catch (error) {
|
|
@@ -54,32 +54,32 @@ export function Dynamo_sameObjects<T>(objA: T, objB: T): boolean {
|
|
|
54
54
|
throw error;
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
export const
|
|
57
|
+
export const DFM_sameObjects = DynamoFM_sameObjects;
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* sets values if its existing on To, even if its null (but if undefined)
|
|
61
61
|
* @param setOn
|
|
62
62
|
* @param setTo
|
|
63
63
|
*/
|
|
64
|
-
export function
|
|
64
|
+
export function DynamoFM_setExisitngValuesOnly(setOn: any, setTo: any): void {
|
|
65
65
|
for (const key in setTo) {
|
|
66
66
|
if (setTo[key] != undefined) {
|
|
67
67
|
setOn[key] = setTo[key];
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
export const
|
|
71
|
+
export const DFM_setExisitngValuesOnly = DynamoFM_setExisitngValuesOnly;
|
|
72
72
|
|
|
73
|
-
export function
|
|
73
|
+
export function DynamoFM_delay(ms: number): Promise<void> {
|
|
74
74
|
return new Promise((resolve): any => setTimeout(resolve, ms));
|
|
75
75
|
}
|
|
76
|
-
export const
|
|
77
|
-
export const
|
|
78
|
-
export const
|
|
79
|
-
export const
|
|
80
|
-
export const
|
|
76
|
+
export const DynamoFM_sleep = DynamoFM_delay;
|
|
77
|
+
export const DynamoFM_wait = DynamoFM_delay;
|
|
78
|
+
export const DFM_delay = DynamoFM_delay;
|
|
79
|
+
export const DFM_sleep = DynamoFM_delay;
|
|
80
|
+
export const DFM_wait = DynamoFM_delay;
|
|
81
81
|
|
|
82
|
-
export type
|
|
82
|
+
export type DynamoFM_SortDirection = 0 | 1 | -1
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* You might be use getSortForTrueFn instead for a shorter expression
|
|
@@ -92,12 +92,16 @@ export type Dynamo_SortDirection = 0 | 1 | -1
|
|
|
92
92
|
* @example
|
|
93
93
|
* codes.sort((a,b) => sortForTrue(a,b,(c: Code) => c.haveImg));
|
|
94
94
|
*/
|
|
95
|
-
export function
|
|
95
|
+
export function DynamoFM_sortForTrue<T>(
|
|
96
|
+
a: T,
|
|
97
|
+
b: T,
|
|
98
|
+
check: (a: T) => boolean
|
|
99
|
+
): DynamoFM_SortDirection {
|
|
96
100
|
const isA = check(a);
|
|
97
101
|
|
|
98
102
|
return isA === check(b) ? 0 : isA ? -1 : 1;
|
|
99
103
|
}
|
|
100
|
-
export const
|
|
104
|
+
export const DFM_sortForTrue = DynamoFM_sortForTrue;
|
|
101
105
|
|
|
102
106
|
/**
|
|
103
107
|
*
|
|
@@ -107,13 +111,13 @@ export const D_sortForTrue = Dynamo_sortForTrue;
|
|
|
107
111
|
* @example
|
|
108
112
|
* codes.sort(getSortForTrueFn((c: Code) => c.haveImg));
|
|
109
113
|
*/
|
|
110
|
-
export function
|
|
111
|
-
checkFor: (a: T) => boolean): (a: T, b: T) =>
|
|
112
|
-
return (a: T, b: T):
|
|
114
|
+
export function DynamoFM_getSortForTrueFn<T>(
|
|
115
|
+
checkFor: (a: T) => boolean): (a: T, b: T) => DynamoFM_SortDirection {
|
|
116
|
+
return (a: T, b: T): DynamoFM_SortDirection => DynamoFM_sortForTrue<T>(a, b, checkFor);
|
|
113
117
|
}
|
|
114
|
-
export const
|
|
118
|
+
export const DFM_getSortForTrueFn = DynamoFM_getSortForTrueFn;
|
|
115
119
|
|
|
116
|
-
export function
|
|
120
|
+
export function DynamoFM_JSONListify<T>(JSONList): T[] {
|
|
117
121
|
const result: T[] = [];
|
|
118
122
|
|
|
119
123
|
for (let i = 0; JSONList[i]; i++) {
|
|
@@ -122,5 +126,5 @@ export function Dynamo_JSONListify<T>(JSONList): T[] {
|
|
|
122
126
|
|
|
123
127
|
return result;
|
|
124
128
|
}
|
|
125
|
-
export const
|
|
129
|
+
export const DFM_JSONListify = DynamoFM_JSONListify;
|
|
126
130
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { DynamoFM_Trigonometry } from './trigonometry.util';
|
|
3
3
|
|
|
4
|
-
export type
|
|
5
|
-
export class
|
|
4
|
+
export type DFM_Vector2 = DynamoFM_Vector2;
|
|
5
|
+
export class DynamoFM_Vector2 {
|
|
6
6
|
readonly isVector2: boolean = true;
|
|
7
7
|
|
|
8
8
|
private _x: number = 0;
|
|
@@ -30,18 +30,18 @@ export class Dynamo_Vector2 {
|
|
|
30
30
|
return this._magintude;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
static readonly zero:
|
|
34
|
-
static readonly up:
|
|
35
|
-
static readonly down:
|
|
36
|
-
static readonly right:
|
|
37
|
-
static readonly left:
|
|
33
|
+
static readonly zero: DynamoFM_Vector2 = new DynamoFM_Vector2(0, 0);
|
|
34
|
+
static readonly up: DynamoFM_Vector2 = new DynamoFM_Vector2(0, 1);
|
|
35
|
+
static readonly down: DynamoFM_Vector2 = new DynamoFM_Vector2(0, -1);
|
|
36
|
+
static readonly right: DynamoFM_Vector2 = new DynamoFM_Vector2(1, 0);
|
|
37
|
+
static readonly left: DynamoFM_Vector2 = new DynamoFM_Vector2(-1, 0);
|
|
38
38
|
|
|
39
39
|
constructor(
|
|
40
|
-
x: number |
|
|
40
|
+
x: number | DynamoFM_Vector2 = 0,
|
|
41
41
|
y: number = 0
|
|
42
42
|
) {
|
|
43
|
-
if ((x as
|
|
44
|
-
const v = x as
|
|
43
|
+
if ((x as DynamoFM_Vector2).isVector2) {
|
|
44
|
+
const v = x as DynamoFM_Vector2;
|
|
45
45
|
|
|
46
46
|
x = v.x;
|
|
47
47
|
y = v.y;
|
|
@@ -57,83 +57,83 @@ export class Dynamo_Vector2 {
|
|
|
57
57
|
return true;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
static distance(a:
|
|
60
|
+
static distance(a: DynamoFM_Vector2, b: DynamoFM_Vector2): number {
|
|
61
61
|
return this.minus(a, b).magintude;
|
|
62
62
|
}
|
|
63
|
-
distanceTo?(to:
|
|
64
|
-
return
|
|
63
|
+
distanceTo?(to: DynamoFM_Vector2): number {
|
|
64
|
+
return DynamoFM_Vector2.distance(this, to);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
static minus(a:
|
|
67
|
+
static minus(a: DynamoFM_Vector2, b: DynamoFM_Vector2): DynamoFM_Vector2 {
|
|
68
68
|
return this.plus(a, this.negative(b));
|
|
69
69
|
}
|
|
70
|
-
minus?(vector:
|
|
71
|
-
this.newValues(
|
|
70
|
+
minus?(vector: DynamoFM_Vector2): void {
|
|
71
|
+
this.newValues(DynamoFM_Vector2.minus(this, vector));
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
static plus(a:
|
|
75
|
-
return new
|
|
74
|
+
static plus(a: DynamoFM_Vector2, b: DynamoFM_Vector2): DynamoFM_Vector2 {
|
|
75
|
+
return new DynamoFM_Vector2(a.x + b.x, a.y + b.y);
|
|
76
76
|
}
|
|
77
|
-
plus?(vector:
|
|
78
|
-
this.newValues(
|
|
77
|
+
plus?(vector: DynamoFM_Vector2): void {
|
|
78
|
+
this.newValues(DynamoFM_Vector2.plus(this, vector));
|
|
79
79
|
}
|
|
80
80
|
static add = this.plus;
|
|
81
81
|
add? = this.plus;
|
|
82
82
|
|
|
83
83
|
/** returns new multiplied Vector2 */
|
|
84
|
-
static multiply(v:
|
|
85
|
-
return new
|
|
84
|
+
static multiply(v: DynamoFM_Vector2, n: number): DynamoFM_Vector2 {
|
|
85
|
+
return new DynamoFM_Vector2(v.x * n, v.y * n);
|
|
86
86
|
}
|
|
87
87
|
multiply?(n: number): void {
|
|
88
|
-
this.newValues(
|
|
88
|
+
this.newValues(DynamoFM_Vector2.multiply(this, n));
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
/** returns new divided Vector2 */
|
|
92
|
-
static divide(v:
|
|
93
|
-
return new
|
|
92
|
+
static divide(v: DynamoFM_Vector2, n: number): DynamoFM_Vector2 {
|
|
93
|
+
return new DynamoFM_Vector2(v.x / n, v.y / n);
|
|
94
94
|
}
|
|
95
95
|
divide?(n: number): void {
|
|
96
|
-
this.newValues(
|
|
96
|
+
this.newValues(DynamoFM_Vector2.divide(this, n));
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
static negative(v:
|
|
100
|
-
return new
|
|
99
|
+
static negative(v: DynamoFM_Vector2): DynamoFM_Vector2 {
|
|
100
|
+
return new DynamoFM_Vector2(-v.x, -v.y);
|
|
101
101
|
}
|
|
102
|
-
getNegative?():
|
|
103
|
-
return
|
|
102
|
+
getNegative?(): DynamoFM_Vector2 {
|
|
103
|
+
return DynamoFM_Vector2.negative(this);
|
|
104
104
|
}
|
|
105
105
|
negate?(): void {
|
|
106
|
-
this.newValues(
|
|
106
|
+
this.newValues(DynamoFM_Vector2.negative(this));
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
static rebase(v:
|
|
109
|
+
static rebase(v: DynamoFM_Vector2, baseFrom: DynamoFM_Vector2, baseTo: DynamoFM_Vector2): DynamoFM_Vector2 {
|
|
110
110
|
return this.plus(v, this.minus(baseTo, baseFrom));
|
|
111
111
|
}
|
|
112
|
-
rebase?(baseFrom:
|
|
113
|
-
this.newValues(
|
|
112
|
+
rebase?(baseFrom: DynamoFM_Vector2, baseTo: DynamoFM_Vector2): void {
|
|
113
|
+
this.newValues(DynamoFM_Vector2.rebase(this, baseFrom, baseTo));
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
static rotate(vector:
|
|
117
|
-
const rad =
|
|
116
|
+
static rotate(vector: DynamoFM_Vector2, angle: number): DynamoFM_Vector2 {
|
|
117
|
+
const rad = DynamoFM_Trigonometry.angleToRadians(angle);
|
|
118
118
|
|
|
119
119
|
return this.rotateRad(vector, rad);
|
|
120
120
|
}
|
|
121
|
-
static rotateRad(vector:
|
|
121
|
+
static rotateRad(vector: DynamoFM_Vector2, rad: number): DynamoFM_Vector2 {
|
|
122
122
|
const cos = Math.cos(rad);
|
|
123
123
|
const sin = Math.sin(rad);
|
|
124
124
|
const newX = (vector.x * cos) - (vector.y * sin);
|
|
125
125
|
const newY = (vector.x * sin) + (vector.y * cos);
|
|
126
126
|
|
|
127
|
-
return new
|
|
127
|
+
return new DynamoFM_Vector2(newX, newY);
|
|
128
128
|
}
|
|
129
129
|
rotate?(angle: number): void {
|
|
130
|
-
this.newValues(
|
|
130
|
+
this.newValues(DynamoFM_Vector2.rotate(this, angle));
|
|
131
131
|
}
|
|
132
132
|
rotateRad?(rad: number): void {
|
|
133
|
-
this.newValues(
|
|
133
|
+
this.newValues(DynamoFM_Vector2.rotateRad(this, rad));
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
private newValues(newV:
|
|
136
|
+
private newValues(newV: DynamoFM_Vector2): void {
|
|
137
137
|
this.newXY(newV.x, newV.y);
|
|
138
138
|
}
|
|
139
139
|
newXY?(newX: number, newY: number): void {
|
|
@@ -144,55 +144,55 @@ export class Dynamo_Vector2 {
|
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
//// AI-ed
|
|
147
|
-
angle?(from:
|
|
148
|
-
return
|
|
147
|
+
angle?(from: DynamoFM_Vector2, to: DynamoFM_Vector2): number {
|
|
148
|
+
return DynamoFM_Vector2.angle(from, to);
|
|
149
149
|
}
|
|
150
|
-
static angle(from:
|
|
151
|
-
return
|
|
150
|
+
static angle(from: DynamoFM_Vector2, to: DynamoFM_Vector2): number {
|
|
151
|
+
return DynamoFM_Trigonometry.radiansToAngle(DynamoFM_Vector2.angleRad(from, to));
|
|
152
152
|
}
|
|
153
|
-
static angleRad(from:
|
|
153
|
+
static angleRad(from: DynamoFM_Vector2, to: DynamoFM_Vector2): number {
|
|
154
154
|
return Math.atan2(to.y - from.y, to.x - from.x);
|
|
155
155
|
}
|
|
156
156
|
deg?(): number {
|
|
157
|
-
return
|
|
157
|
+
return DynamoFM_Vector2.deg(this);
|
|
158
158
|
}
|
|
159
|
-
static deg(vector:
|
|
160
|
-
return
|
|
159
|
+
static deg(vector: DynamoFM_Vector2): number {
|
|
160
|
+
return DynamoFM_Trigonometry.radiansToAngle(DynamoFM_Vector2.rad(vector));
|
|
161
161
|
}
|
|
162
|
-
static rad(vector:
|
|
162
|
+
static rad(vector: DynamoFM_Vector2): number {
|
|
163
163
|
return Math.atan2(vector.y, vector.x);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
floor?():
|
|
167
|
-
return
|
|
166
|
+
floor?(): DynamoFM_Vector2 {
|
|
167
|
+
return DynamoFM_Vector2.floor(this);
|
|
168
168
|
}
|
|
169
|
-
static floor(v:
|
|
170
|
-
return new
|
|
169
|
+
static floor(v: DynamoFM_Vector2): DynamoFM_Vector2 {
|
|
170
|
+
return new DynamoFM_Vector2(Math.floor(v.x), Math.floor(v.y));
|
|
171
171
|
}
|
|
172
172
|
/////
|
|
173
173
|
|
|
174
|
-
direction?(to:
|
|
175
|
-
return
|
|
174
|
+
direction?(to: DynamoFM_Vector2): DynamoFM_Vector2 {
|
|
175
|
+
return DynamoFM_Vector2.direction(this, to);
|
|
176
176
|
}
|
|
177
|
-
static direction(from:
|
|
178
|
-
return
|
|
177
|
+
static direction(from: DynamoFM_Vector2, to: DynamoFM_Vector2): DynamoFM_Vector2 {
|
|
178
|
+
return DynamoFM_Vector2.minus(to, from);
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
static normalize(v:
|
|
182
|
-
return
|
|
181
|
+
static normalize(v: DynamoFM_Vector2): DynamoFM_Vector2 {
|
|
182
|
+
return DynamoFM_Vector2.multiply(v, 1 / v.magintude);
|
|
183
183
|
}
|
|
184
184
|
normalize?(): void {
|
|
185
|
-
this.newValues(
|
|
185
|
+
this.newValues(DynamoFM_Vector2.normalize(this));
|
|
186
186
|
}
|
|
187
|
-
normalized?():
|
|
188
|
-
return
|
|
187
|
+
normalized?(): DynamoFM_Vector2 {
|
|
188
|
+
return DynamoFM_Vector2.normalize(this);
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
private calcMagnitude?(): void {
|
|
192
|
-
this._magintude =
|
|
192
|
+
this._magintude = DynamoFM_Trigonometry.getHypotenuse(this._x, this._y);
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
clone?():
|
|
196
|
-
return new
|
|
195
|
+
clone?(): DynamoFM_Vector2 {
|
|
196
|
+
return new DynamoFM_Vector2(this._x, this._y);
|
|
197
197
|
}
|
|
198
198
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"incremental": true,
|
|
4
|
-
"target": "es2022",
|
|
5
4
|
"module": "commonjs",
|
|
5
|
+
"target": "es2022",
|
|
6
6
|
"lib": [
|
|
7
7
|
"es6",
|
|
8
8
|
"es2018",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"moduleResolution": "node",
|
|
19
19
|
"esModuleInterop": true,
|
|
20
20
|
"skipLibCheck": true,
|
|
21
|
+
"allowSyntheticDefaultImports": true,
|
|
21
22
|
"forceConsistentCasingInFileNames": true,
|
|
22
23
|
"resolveJsonModule": true
|
|
23
24
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.util.d.ts","sourceRoot":"","sources":["../../src/_utils/metadata.util.ts"],"names":[],"mappings":""}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/*
|
|
4
|
-
export class Dynamo_Metadata_Tool {
|
|
5
|
-
|
|
6
|
-
static updateMetadata<T extends Dynamo_Metadata>(data: T, issuer: string, id?: string): T {
|
|
7
|
-
if (!data) {
|
|
8
|
-
return data;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (!data._id && id) {
|
|
12
|
-
data._id = id;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if (!data.__created) {
|
|
16
|
-
data.__created = new Date();
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
if (!data.__createdBy) {
|
|
20
|
-
data.__createdBy = issuer;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
data.__lastModified = new Date();
|
|
24
|
-
data.__lastModifiedBy = issuer;
|
|
25
|
-
data.__v = data.__v ? data.__v + 1 : 1;
|
|
26
|
-
|
|
27
|
-
return data;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
*/
|
|
32
|
-
//# sourceMappingURL=metadata.util.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.util.js","sourceRoot":"","sources":["../../src/_utils/metadata.util.ts"],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Dynamo_Metadata } from '../_models';
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
export class Dynamo_Metadata_Tool {
|
|
5
|
-
|
|
6
|
-
static updateMetadata<T extends Dynamo_Metadata>(data: T, issuer: string, id?: string): T {
|
|
7
|
-
if (!data) {
|
|
8
|
-
return data;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (!data._id && id) {
|
|
12
|
-
data._id = id;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if (!data.__created) {
|
|
16
|
-
data.__created = new Date();
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
if (!data.__createdBy) {
|
|
20
|
-
data.__createdBy = issuer;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
data.__lastModified = new Date();
|
|
24
|
-
data.__lastModifiedBy = issuer;
|
|
25
|
-
data.__v = data.__v ? data.__v + 1 : 1;
|
|
26
|
-
|
|
27
|
-
return data;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
*/
|