@futdevpro/fsm-dynamo 1.10.37 → 1.10.39
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/.github/workflows/main.yml +11 -51
- package/build/_collections/constants/error-defaults.const.d.ts +8 -0
- package/build/_collections/constants/error-defaults.const.d.ts.map +1 -1
- package/build/_collections/constants/error-defaults.const.js +8 -0
- package/build/_collections/constants/error-defaults.const.js.map +1 -1
- package/build/_collections/constants/global-settings.const.d.ts +8 -0
- package/build/_collections/constants/global-settings.const.d.ts.map +1 -1
- package/build/_collections/constants/global-settings.const.js +9 -0
- package/build/_collections/constants/global-settings.const.js.map +1 -1
- package/build/_collections/constants/numbers.const.d.ts +32 -0
- package/build/_collections/constants/numbers.const.d.ts.map +1 -1
- package/build/_collections/constants/numbers.const.js +32 -0
- package/build/_collections/constants/numbers.const.js.map +1 -1
- package/build/_collections/constants/times.const.d.ts +31 -0
- package/build/_collections/constants/times.const.d.ts.map +1 -1
- package/build/_collections/constants/times.const.js +31 -0
- package/build/_collections/constants/times.const.js.map +1 -1
- package/build/_collections/utils/array.util.d.ts +136 -7
- package/build/_collections/utils/array.util.d.ts.map +1 -1
- package/build/_collections/utils/array.util.js +132 -2
- package/build/_collections/utils/array.util.js.map +1 -1
- package/build/_collections/utils/array.util.spec.js.map +1 -1
- package/build/_collections/utils/log.util.d.ts +123 -0
- package/build/_collections/utils/log.util.d.ts.map +1 -1
- package/build/_collections/utils/log.util.js +123 -0
- package/build/_collections/utils/log.util.js.map +1 -1
- package/build/_collections/utils/math/box-bounds.spec.js +2 -5
- package/build/_collections/utils/math/box-bounds.spec.js.map +1 -1
- package/build/_collections/utils/math/box-bounds.util.d.ts +52 -6
- package/build/_collections/utils/math/box-bounds.util.d.ts.map +1 -1
- package/build/_collections/utils/math/box-bounds.util.js +57 -5
- package/build/_collections/utils/math/box-bounds.util.js.map +1 -1
- package/build/_collections/utils/math/box-bounds.util.spec.js +1 -1
- package/build/_collections/utils/math/box-bounds.util.spec.js.map +1 -1
- package/build/_collections/utils/math/math.util.d.ts +30 -0
- package/build/_collections/utils/math/math.util.d.ts.map +1 -1
- package/build/_collections/utils/math/math.util.js +30 -0
- package/build/_collections/utils/math/math.util.js.map +1 -1
- package/build/_collections/utils/math/random.util.d.ts +19 -2
- package/build/_collections/utils/math/random.util.d.ts.map +1 -1
- package/build/_collections/utils/math/random.util.js +22 -0
- package/build/_collections/utils/math/random.util.js.map +1 -1
- package/build/_collections/utils/math/random.util.spec.js.map +1 -1
- package/build/_collections/utils/math/vector2.util.d.ts +142 -20
- package/build/_collections/utils/math/vector2.util.d.ts.map +1 -1
- package/build/_collections/utils/math/vector2.util.js +126 -0
- package/build/_collections/utils/math/vector2.util.js.map +1 -1
- package/build/_collections/utils/round-list.util.d.ts +36 -1
- package/build/_collections/utils/round-list.util.d.ts.map +1 -1
- package/build/_collections/utils/round-list.util.js +35 -0
- package/build/_collections/utils/round-list.util.js.map +1 -1
- package/build/_collections/utils/shared.util.js.map +1 -1
- package/build/_collections/utils/stack.util.js +3 -3
- package/build/_collections/utils/stack.util.js.map +1 -1
- package/build/_collections/utils/string.util.d.ts +8 -1
- package/build/_collections/utils/string.util.d.ts.map +1 -1
- package/build/_collections/utils/string.util.js +8 -1
- package/build/_collections/utils/string.util.js.map +1 -1
- package/build/_collections/utils/time.util.d.ts +29 -0
- package/build/_collections/utils/time.util.d.ts.map +1 -1
- package/build/_collections/utils/time.util.js +29 -0
- package/build/_collections/utils/time.util.js.map +1 -1
- package/build/_collections/utils/type-cloning-facility.util.d.ts +29 -3
- package/build/_collections/utils/type-cloning-facility.util.d.ts.map +1 -1
- package/build/_collections/utils/type-cloning-facility.util.js +53 -3
- package/build/_collections/utils/type-cloning-facility.util.js.map +1 -1
- package/build/_collections/utils/utilities.util.d.ts +49 -2
- package/build/_collections/utils/utilities.util.d.ts.map +1 -1
- package/build/_collections/utils/utilities.util.js +53 -1
- package/build/_collections/utils/utilities.util.js.map +1 -1
- package/build/_collections/utils/utilities.util.spec.js.map +1 -1
- package/build/_collections/utils/uuid.util.d.ts +5 -0
- package/build/_collections/utils/uuid.util.d.ts.map +1 -1
- package/build/_collections/utils/uuid.util.js +5 -0
- package/build/_collections/utils/uuid.util.js.map +1 -1
- package/build/_enums/basic-property-type.enum.d.ts +8 -0
- package/build/_enums/basic-property-type.enum.d.ts.map +1 -1
- package/build/_enums/basic-property-type.enum.js +8 -0
- package/build/_enums/basic-property-type.enum.js.map +1 -1
- package/build/_enums/data-model-type.enum.d.ts +8 -4
- package/build/_enums/data-model-type.enum.d.ts.map +1 -1
- package/build/_enums/data-model-type.enum.js +8 -4
- package/build/_enums/data-model-type.enum.js.map +1 -1
- package/build/_enums/environment-flag.enum.d.ts +18 -0
- package/build/_enums/environment-flag.enum.d.ts.map +1 -1
- package/build/_enums/environment-flag.enum.js +18 -0
- package/build/_enums/environment-flag.enum.js.map +1 -1
- package/build/_enums/error-level.enum.d.ts +10 -0
- package/build/_enums/error-level.enum.d.ts.map +1 -1
- package/build/_enums/error-level.enum.js +10 -0
- package/build/_enums/error-level.enum.js.map +1 -1
- package/build/_enums/http-call-type.enum.d.ts +6 -2
- package/build/_enums/http-call-type.enum.d.ts.map +1 -1
- package/build/_enums/http-call-type.enum.js +6 -2
- package/build/_enums/http-call-type.enum.js.map +1 -1
- package/build/_enums/http-response-type.enum.d.ts +8 -0
- package/build/_enums/http-response-type.enum.d.ts.map +1 -1
- package/build/_enums/http-response-type.enum.js +8 -0
- package/build/_enums/http-response-type.enum.js.map +1 -1
- package/build/_enums/log-style.enum.d.ts +8 -0
- package/build/_enums/log-style.enum.d.ts.map +1 -1
- package/build/_enums/log-style.enum.js +8 -0
- package/build/_enums/log-style.enum.js.map +1 -1
- package/build/_enums/time/day-of-week.enum.d.ts +13 -1
- package/build/_enums/time/day-of-week.enum.d.ts.map +1 -1
- package/build/_enums/time/day-of-week.enum.js +13 -1
- package/build/_enums/time/day-of-week.enum.js.map +1 -1
- package/build/_enums/time/month.enum.d.ts +8 -0
- package/build/_enums/time/month.enum.d.ts.map +1 -1
- package/build/_enums/time/month.enum.js +8 -0
- package/build/_enums/time/month.enum.js.map +1 -1
- package/build/_enums/time/relative-date.enum.d.ts +10 -0
- package/build/_enums/time/relative-date.enum.d.ts.map +1 -1
- package/build/_enums/time/relative-date.enum.js +10 -0
- package/build/_enums/time/relative-date.enum.js.map +1 -1
- package/build/_models/control-models/data-model-params.control-model.d.ts +4 -4
- 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.map +1 -1
- 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.map +1 -1
- package/build/_models/control-models/error.control-model.spec.js.map +1 -1
- package/build/_models/interfaces/box-bounds.interface.d.ts +8 -0
- package/build/_models/interfaces/box-bounds.interface.d.ts.map +1 -0
- package/build/_models/interfaces/box-bounds.interface.js +3 -0
- package/build/_models/interfaces/box-bounds.interface.js.map +1 -0
- package/build/_models/interfaces/environment/global-settings.interface.d.ts +1 -0
- package/build/_models/interfaces/environment/global-settings.interface.d.ts.map +1 -1
- package/build/_models/interfaces/route-settings.interface.d.ts +6 -1
- package/build/_models/interfaces/route-settings.interface.d.ts.map +1 -1
- package/build/_modules/crypto/_collections/crypto.util.d.ts +11 -17
- package/build/_modules/crypto/_collections/crypto.util.d.ts.map +1 -1
- package/build/_modules/crypto/_collections/crypto.util.js +74 -58
- package/build/_modules/crypto/_collections/crypto.util.js.map +1 -1
- package/build/_modules/crypto/_collections/crypto.util.spec.js +390 -0
- package/build/_modules/crypto/_collections/crypto.util.spec.js.map +1 -1
- package/build/_modules/custom-data/_collections/cud-module-settings.const.d.ts +6 -0
- package/build/_modules/custom-data/_collections/cud-module-settings.const.d.ts.map +1 -1
- package/build/_modules/custom-data/_collections/cud-module-settings.const.js +6 -0
- package/build/_modules/custom-data/_collections/cud-module-settings.const.js.map +1 -1
- package/build/_modules/custom-data/_models/cud.data-model.d.ts +3 -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 +3 -0
- package/build/_modules/custom-data/_models/cud.data-model.js.map +1 -1
- package/build/_modules/location/_collections/loc-country-divisions.const.d.ts +1 -0
- package/build/_modules/location/_collections/loc-country-divisions.const.d.ts.map +1 -1
- package/build/_modules/location/_collections/loc-country-divisions.const.js +1 -0
- package/build/_modules/location/_collections/loc-country-divisions.const.js.map +1 -1
- package/build/_modules/location/_collections/loc-regions.util.d.ts +4 -0
- package/build/_modules/location/_collections/loc-regions.util.d.ts.map +1 -1
- package/build/_modules/location/_collections/loc-regions.util.js +4 -0
- package/build/_modules/location/_collections/loc-regions.util.js.map +1 -1
- package/build/_modules/location/_collections/loc.util.d.ts +9 -0
- package/build/_modules/location/_collections/loc.util.d.ts.map +1 -1
- package/build/_modules/location/_collections/loc.util.js +9 -0
- package/build/_modules/location/_collections/loc.util.js.map +1 -1
- package/build/_modules/location/_enums/loc-region.enum.d.ts +3 -0
- package/build/_modules/location/_enums/loc-region.enum.d.ts.map +1 -1
- package/build/_modules/location/_enums/loc-region.enum.js +3 -0
- package/build/_modules/location/_enums/loc-region.enum.js.map +1 -1
- package/build/_modules/location/_enums/loc-sub-region.enum.d.ts +3 -0
- package/build/_modules/location/_enums/loc-sub-region.enum.d.ts.map +1 -1
- package/build/_modules/location/_enums/loc-sub-region.enum.js +3 -0
- package/build/_modules/location/_enums/loc-sub-region.enum.js.map +1 -1
- package/build/_modules/location/_enums/loc-subdivision-region-type.enum.d.ts +37 -34
- package/build/_modules/location/_enums/loc-subdivision-region-type.enum.d.ts.map +1 -1
- package/build/_modules/location/_enums/loc-subdivision-region-type.enum.js +3 -0
- package/build/_modules/location/_enums/loc-subdivision-region-type.enum.js.map +1 -1
- package/build/_modules/location/_models/loc-coordinates.interface.d.ts +1 -0
- package/build/_modules/location/_models/loc-coordinates.interface.d.ts.map +1 -1
- package/build/_modules/open-ai/_enums/open-ai-model.enum.d.ts +10 -7
- package/build/_modules/open-ai/_enums/open-ai-model.enum.d.ts.map +1 -1
- package/build/_modules/open-ai/_enums/open-ai-model.enum.js +3 -0
- package/build/_modules/open-ai/_enums/open-ai-model.enum.js.map +1 -1
- package/build/_modules/pipe/_enums/pip-range-pipe-setting.enum.d.ts +3 -0
- package/build/_modules/pipe/_enums/pip-range-pipe-setting.enum.d.ts.map +1 -1
- package/build/_modules/pipe/_enums/pip-range-pipe-setting.enum.js +3 -0
- package/build/_modules/pipe/_enums/pip-range-pipe-setting.enum.js.map +1 -1
- package/build/_modules/pipe/_enums/pip.enum.d.ts +14 -0
- package/build/_modules/pipe/_enums/pip.enum.d.ts.map +1 -1
- package/build/_modules/pipe/_enums/pip.enum.js +11 -0
- package/build/_modules/pipe/_enums/pip.enum.js.map +1 -1
- package/build/_modules/socket/_enums/sck-event-key.enum.d.ts +3 -0
- package/build/_modules/socket/_enums/sck-event-key.enum.d.ts.map +1 -1
- package/build/_modules/socket/_enums/sck-event-key.enum.js +3 -0
- package/build/_modules/socket/_enums/sck-event-key.enum.js.map +1 -1
- package/build/_modules/socket/_models/sck-client-params.control-model.d.ts +12 -0
- package/build/_modules/socket/_models/sck-client-params.control-model.d.ts.map +1 -1
- package/build/_modules/socket/_models/sck-client-params.control-model.js +12 -0
- package/build/_modules/socket/_models/sck-client-params.control-model.js.map +1 -1
- package/build/_modules/socket/_models/sck-socket-event.control-model.d.ts +12 -1
- package/build/_modules/socket/_models/sck-socket-event.control-model.d.ts.map +1 -1
- package/build/_modules/socket/_models/sck-socket-event.control-model.js +12 -1
- package/build/_modules/socket/_models/sck-socket-event.control-model.js.map +1 -1
- package/build/_modules/socket/_services/sck-client.service-base.d.ts +4 -0
- package/build/_modules/socket/_services/sck-client.service-base.d.ts.map +1 -1
- package/build/_modules/socket/_services/sck-client.service-base.js +4 -0
- package/build/_modules/socket/_services/sck-client.service-base.js.map +1 -1
- package/build/_modules/test/_collections/tst-module-settings.const.d.ts +9 -0
- package/build/_modules/test/_collections/tst-module-settings.const.d.ts.map +1 -1
- package/build/_modules/test/_collections/tst-module-settings.const.js +9 -0
- package/build/_modules/test/_collections/tst-module-settings.const.js.map +1 -1
- package/build/_modules/usage/_models/usg-action.control-model.d.ts +13 -0
- package/build/_modules/usage/_models/usg-action.control-model.d.ts.map +1 -1
- package/build/_modules/usage/_models/usg-action.control-model.js +13 -0
- package/build/_modules/usage/_models/usg-action.control-model.js.map +1 -1
- package/build/_modules/usage/_models/usg-daily-usage-data.control-model.d.ts +14 -0
- package/build/_modules/usage/_models/usg-daily-usage-data.control-model.d.ts.map +1 -1
- package/build/_modules/usage/_models/usg-daily-usage-data.control-model.js +14 -0
- package/build/_modules/usage/_models/usg-daily-usage-data.control-model.js.map +1 -1
- package/build/_modules/usage/_models/usg-data.control-model.d.ts +16 -0
- package/build/_modules/usage/_models/usg-data.control-model.d.ts.map +1 -1
- package/build/_modules/usage/_models/usg-data.control-model.js +16 -0
- package/build/_modules/usage/_models/usg-data.control-model.js.map +1 -1
- package/build/_modules/usage/_models/usg-session.data-model.d.ts +17 -0
- package/build/_modules/usage/_models/usg-session.data-model.d.ts.map +1 -1
- package/build/_modules/usage/_models/usg-session.data-model.js +17 -0
- package/build/_modules/usage/_models/usg-session.data-model.js.map +1 -1
- package/build/_modules/usage/_models/usg-session.data-model.spec.js.map +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/futdevpro-fsm-dynamo-01.10.39.tgz +0 -0
- package/package.json +9 -5
- package/src/_collections/constants/error-defaults.const.ts +8 -0
- package/src/_collections/constants/global-settings.const.ts +12 -2
- package/src/_collections/constants/numbers.const.ts +32 -0
- package/src/_collections/constants/times.const.ts +37 -0
- package/src/_collections/utils/array.util.spec.ts +36 -38
- package/src/_collections/utils/array.util.ts +146 -12
- package/src/_collections/utils/log.util.ts +126 -2
- package/src/_collections/utils/math/box-bounds.spec.ts +8 -13
- package/src/_collections/utils/math/box-bounds.util.spec.ts +3 -3
- package/src/_collections/utils/math/box-bounds.util.ts +65 -12
- package/src/_collections/utils/math/math.util.ts +30 -6
- package/src/_collections/utils/math/random.util.spec.ts +7 -7
- package/src/_collections/utils/math/random.util.ts +27 -4
- package/src/_collections/utils/math/vector2.util.ts +148 -21
- package/src/_collections/utils/round-list.util.ts +36 -3
- package/src/_collections/utils/shared.util.ts +17 -17
- package/src/_collections/utils/stack.util.ts +6 -6
- package/src/_collections/utils/string.util.ts +8 -1
- package/src/_collections/utils/time.util.ts +37 -2
- package/src/_collections/utils/type-cloning-facility.util.ts +57 -8
- package/src/_collections/utils/utilities.util.spec.ts +2 -2
- package/src/_collections/utils/utilities.util.ts +61 -8
- package/src/_collections/utils/uuid.util.ts +5 -0
- package/src/_enums/basic-property-type.enum.ts +8 -0
- package/src/_enums/data-model-type.enum.ts +11 -6
- package/src/_enums/environment-flag.enum.ts +18 -0
- package/src/_enums/error-level.enum.ts +10 -0
- package/src/_enums/http-call-type.enum.ts +6 -2
- package/src/_enums/http-response-type.enum.ts +8 -0
- package/src/_enums/log-style.enum.ts +8 -0
- package/src/_enums/time/day-of-week.enum.ts +13 -1
- package/src/_enums/time/month.enum.ts +8 -0
- package/src/_enums/time/relative-date.enum.ts +10 -0
- package/src/_models/control-models/data-model-params.control-model.ts +6 -6
- package/src/_models/control-models/data-property-params.control-model.ts +1 -1
- package/src/_models/control-models/error.control-model.spec.ts +2 -2
- package/src/_models/interfaces/box-bounds.interface.ts +8 -0
- package/src/_models/interfaces/environment/global-settings.interface.ts +2 -0
- package/src/_models/interfaces/route-settings.interface.ts +6 -1
- package/src/_modules/crypto/_collections/crypto.util.spec.ts +428 -0
- package/src/_modules/crypto/_collections/crypto.util.ts +88 -52
- package/src/_modules/custom-data/_collections/cud-module-settings.const.ts +6 -0
- package/src/_modules/custom-data/_models/cud.data-model.ts +3 -0
- package/src/_modules/location/_collections/loc-country-divisions.const.ts +2 -1
- package/src/_modules/location/_collections/loc-regions.util.ts +4 -0
- package/src/_modules/location/_collections/loc.util.ts +13 -5
- package/src/_modules/location/_enums/loc-region.enum.ts +3 -0
- package/src/_modules/location/_enums/loc-sub-region.enum.ts +3 -0
- package/src/_modules/location/_enums/loc-subdivision-region-type.enum.ts +37 -34
- package/src/_modules/location/_models/loc-coordinates.interface.ts +1 -0
- package/src/_modules/open-ai/_enums/open-ai-model.enum.ts +11 -8
- package/src/_modules/pipe/_enums/pip-range-pipe-setting.enum.ts +3 -0
- package/src/_modules/pipe/_enums/pip.enum.ts +17 -3
- package/src/_modules/socket/_enums/sck-event-key.enum.ts +3 -0
- package/src/_modules/socket/_models/sck-client-params.control-model.ts +12 -0
- package/src/_modules/socket/_models/sck-socket-event.control-model.ts +12 -1
- package/src/_modules/socket/_services/sck-client.service-base.ts +4 -0
- package/src/_modules/test/_collections/tst-module-settings.const.ts +9 -0
- package/src/_modules/usage/_models/usg-action.control-model.ts +13 -0
- package/src/_modules/usage/_models/usg-daily-usage-data.control-model.ts +14 -0
- package/src/_modules/usage/_models/usg-data.control-model.ts +16 -0
- package/src/_modules/usage/_models/usg-session.data-model.spec.ts +2 -1
- package/src/_modules/usage/_models/usg-session.data-model.ts +17 -0
- package/src/index.ts +1 -0
- package/tsconfig.json +1 -0
- package/futdevpro-fsm-dynamo-01.10.37.tgz +0 -0
|
@@ -8,6 +8,10 @@ const log_style_enum_1 = require("../../_enums/log-style.enum");
|
|
|
8
8
|
* such as success, error, warn, info and highlighted for each of them.
|
|
9
9
|
*/
|
|
10
10
|
class DyFM_Log {
|
|
11
|
+
/**
|
|
12
|
+
* Sets the style of the console log.
|
|
13
|
+
* @param styles - The styles to set.
|
|
14
|
+
*/
|
|
11
15
|
static setStyle(styles) {
|
|
12
16
|
let styleSets = '';
|
|
13
17
|
styles.forEach((style) => {
|
|
@@ -15,9 +19,19 @@ class DyFM_Log {
|
|
|
15
19
|
});
|
|
16
20
|
console.log(styleSets);
|
|
17
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Resets the style of the console log.
|
|
24
|
+
*/
|
|
18
25
|
static resetStyle() {
|
|
19
26
|
console.log(log_style_enum_1.DyFM_LogStyle.reset);
|
|
20
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Adds a style to the console log.
|
|
30
|
+
* @param input - The input to add the style to.
|
|
31
|
+
* @param styles - The styles to add.
|
|
32
|
+
* @param dontReset - Whether to not reset the style.
|
|
33
|
+
* @returns The input with the style added.
|
|
34
|
+
*/
|
|
21
35
|
static addStyle(input, styles, dontReset) {
|
|
22
36
|
let result = '';
|
|
23
37
|
styles.forEach((style) => {
|
|
@@ -29,6 +43,15 @@ class DyFM_Log {
|
|
|
29
43
|
}
|
|
30
44
|
return result;
|
|
31
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Logs a success message.
|
|
48
|
+
* @param message - The message to log.
|
|
49
|
+
* @param optionalParams - The optional parameters to log.
|
|
50
|
+
*/ /**
|
|
51
|
+
* Logs a success message.
|
|
52
|
+
* @param message - The message to log.
|
|
53
|
+
* @param optionalParams - The optional parameters to log.
|
|
54
|
+
*/
|
|
32
55
|
static success(message, ...optionalParams) {
|
|
33
56
|
if (0 < optionalParams.length) {
|
|
34
57
|
console.log(`${log_style_enum_1.DyFM_LogStyle.green}${message}`, ...optionalParams, log_style_enum_1.DyFM_LogStyle.reset);
|
|
@@ -41,6 +64,11 @@ class DyFM_Log {
|
|
|
41
64
|
* @deprecated use DyFM_Log.success instead
|
|
42
65
|
*/
|
|
43
66
|
static logSuccess = this.success;
|
|
67
|
+
/**
|
|
68
|
+
* Logs an error message.
|
|
69
|
+
* @param message - The message to log.
|
|
70
|
+
* @param optionalParams - The optional parameters to log.
|
|
71
|
+
*/
|
|
44
72
|
static error(message, ...optionalParams) {
|
|
45
73
|
if (0 < optionalParams.length) {
|
|
46
74
|
console.error(`${log_style_enum_1.DyFM_LogStyle.red}${message}`, ...optionalParams, log_style_enum_1.DyFM_LogStyle.reset);
|
|
@@ -53,6 +81,11 @@ class DyFM_Log {
|
|
|
53
81
|
* @deprecated use DyFM_Log.error instead
|
|
54
82
|
*/
|
|
55
83
|
static logError = this.error;
|
|
84
|
+
/**
|
|
85
|
+
* Logs a warning message.
|
|
86
|
+
* @param message - The message to log.
|
|
87
|
+
* @param optionalParams - The optional parameters to log.
|
|
88
|
+
*/
|
|
56
89
|
static warn(message, ...optionalParams) {
|
|
57
90
|
if (0 < optionalParams.length) {
|
|
58
91
|
console.warn(`${log_style_enum_1.DyFM_LogStyle.yellow}${message}`, ...optionalParams, log_style_enum_1.DyFM_LogStyle.reset);
|
|
@@ -71,17 +104,38 @@ class DyFM_Log {
|
|
|
71
104
|
static logWarning = this.warn;
|
|
72
105
|
// ez azért nem egy sima "static readonly info = console.info;",
|
|
73
106
|
// mert azon nincs rajta az első input típusa, ami csak string lehet
|
|
107
|
+
/**
|
|
108
|
+
* Logs an info message.
|
|
109
|
+
* @param message - The message to log.
|
|
110
|
+
* @param optionalParams - The optional parameters to log.
|
|
111
|
+
*/
|
|
74
112
|
static info(message, ...optionalParams) {
|
|
75
113
|
console.info(message, ...optionalParams);
|
|
76
114
|
}
|
|
77
115
|
// ez azért nem egy sima "static readonly log = console.log;",
|
|
78
116
|
// mert azon nincs rajta az első input típusa, ami csak string lehet
|
|
117
|
+
/**
|
|
118
|
+
* Logs a log message.
|
|
119
|
+
* @param message - The message to log.
|
|
120
|
+
* @param optionalParams - The optional parameters to log.
|
|
121
|
+
*/
|
|
79
122
|
static log(message, ...optionalParams) {
|
|
80
123
|
console.log(message, ...optionalParams);
|
|
81
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* Gets a highlighted message.
|
|
127
|
+
* @param message - The message to highlight.
|
|
128
|
+
* @param optionalParams - The optional parameters to highlight.
|
|
129
|
+
* @returns The highlighted message.
|
|
130
|
+
*/
|
|
82
131
|
static getHighlighted(message, ...optionalParams) {
|
|
83
132
|
return `${log_style_enum_1.DyFM_LogStyle.white}${log_style_enum_1.DyFM_LogStyle.bright}${message}${log_style_enum_1.DyFM_LogStyle.reset}`;
|
|
84
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* Logs a highlighted message.
|
|
136
|
+
* @param message - The message to highlight.
|
|
137
|
+
* @param optionalParams - The optional parameters to highlight.
|
|
138
|
+
*/
|
|
85
139
|
static highlighted(message, ...optionalParams) {
|
|
86
140
|
if (0 < optionalParams.length) {
|
|
87
141
|
console.log(`${log_style_enum_1.DyFM_LogStyle.white}${log_style_enum_1.DyFM_LogStyle.bright}${message}`, ...optionalParams, log_style_enum_1.DyFM_LogStyle.reset);
|
|
@@ -90,12 +144,22 @@ class DyFM_Log {
|
|
|
90
144
|
console.log(`${log_style_enum_1.DyFM_LogStyle.white}${log_style_enum_1.DyFM_LogStyle.bright}${message}${log_style_enum_1.DyFM_LogStyle.reset}`);
|
|
91
145
|
}
|
|
92
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* Tests a log message.
|
|
149
|
+
* @param message - The message to test.
|
|
150
|
+
* @param optionalParams - The optional parameters to test.
|
|
151
|
+
*/
|
|
93
152
|
static testLog(message, ...optionalParams) {
|
|
94
153
|
this.log('\n\n' + this.h_solid + '\n');
|
|
95
154
|
this.log(message, ...optionalParams);
|
|
96
155
|
this.log('\n' + this.h_solid + '\n\n');
|
|
97
156
|
}
|
|
98
157
|
static test = DyFM_Log.testLog;
|
|
158
|
+
/**
|
|
159
|
+
* Logs a highlighted log message.
|
|
160
|
+
* @param message - The message to highlight.
|
|
161
|
+
* @param optionalParams - The optional parameters to highlight.
|
|
162
|
+
*/
|
|
99
163
|
static highlightedLog(message, ...optionalParams) {
|
|
100
164
|
this.log('\n\n' + this.h_before);
|
|
101
165
|
this.log(' ' + this.h_before);
|
|
@@ -106,11 +170,21 @@ class DyFM_Log {
|
|
|
106
170
|
this.log(this.h_after + '\n\n');
|
|
107
171
|
}
|
|
108
172
|
static H_log = DyFM_Log.highlightedLog;
|
|
173
|
+
/**
|
|
174
|
+
* Tests an info message.
|
|
175
|
+
* @param message - The message to test.
|
|
176
|
+
* @param optionalParams - The optional parameters to test.
|
|
177
|
+
*/
|
|
109
178
|
static testInfo(message, ...optionalParams) {
|
|
110
179
|
this.info('\n\n' + this.h_solid + '\n');
|
|
111
180
|
this.info(message, ...optionalParams);
|
|
112
181
|
this.info('\n' + this.h_solid + '\n\n');
|
|
113
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* Logs a highlighted info message.
|
|
185
|
+
* @param message - The message to highlight.
|
|
186
|
+
* @param optionalParams - The optional parameters to highlight.
|
|
187
|
+
*/
|
|
114
188
|
static highlightedInfo(message, ...optionalParams) {
|
|
115
189
|
this.info('\n\n' + this.h_before);
|
|
116
190
|
this.info(' ' + this.h_before);
|
|
@@ -121,11 +195,21 @@ class DyFM_Log {
|
|
|
121
195
|
this.info(this.h_after + '\n\n');
|
|
122
196
|
}
|
|
123
197
|
static H_info = DyFM_Log.highlightedInfo;
|
|
198
|
+
/**
|
|
199
|
+
* Tests an error message.
|
|
200
|
+
* @param message - The message to test.
|
|
201
|
+
* @param optionalParams - The optional parameters to test.
|
|
202
|
+
*/
|
|
124
203
|
static testError(message, ...optionalParams) {
|
|
125
204
|
this.error('\n\n' + this.h_solid + '\n');
|
|
126
205
|
this.error(message, ...optionalParams);
|
|
127
206
|
this.error('\n' + this.h_solid + '\n\n');
|
|
128
207
|
}
|
|
208
|
+
/**
|
|
209
|
+
* Logs a highlighted error message.
|
|
210
|
+
* @param message - The message to highlight.
|
|
211
|
+
* @param optionalParams - The optional parameters to highlight.
|
|
212
|
+
*/
|
|
129
213
|
static highlightedError(message, ...optionalParams) {
|
|
130
214
|
this.error('\n\n' + this.h_before);
|
|
131
215
|
this.error(' ' + this.h_before);
|
|
@@ -136,11 +220,21 @@ class DyFM_Log {
|
|
|
136
220
|
this.error(this.h_after + '\n\n');
|
|
137
221
|
}
|
|
138
222
|
static H_error = DyFM_Log.highlightedError;
|
|
223
|
+
/**
|
|
224
|
+
* Tests a warning message.
|
|
225
|
+
* @param message - The message to test.
|
|
226
|
+
* @param optionalParams - The optional parameters to test.
|
|
227
|
+
*/
|
|
139
228
|
static testWarn(message, ...optionalParams) {
|
|
140
229
|
this.warn('\n\n' + this.h_solid + '\n');
|
|
141
230
|
this.warn(message, ...optionalParams);
|
|
142
231
|
this.warn('\n' + this.h_solid + '\n\n');
|
|
143
232
|
}
|
|
233
|
+
/**
|
|
234
|
+
* Logs a highlighted warning message.
|
|
235
|
+
* @param message - The message to highlight.
|
|
236
|
+
* @param optionalParams - The optional parameters to highlight.
|
|
237
|
+
*/
|
|
144
238
|
static highlightedWarn(message, ...optionalParams) {
|
|
145
239
|
this.warn('\n\n' + this.h_before);
|
|
146
240
|
this.warn(' ' + this.h_before);
|
|
@@ -151,11 +245,21 @@ class DyFM_Log {
|
|
|
151
245
|
this.warn(this.h_after + '\n\n');
|
|
152
246
|
}
|
|
153
247
|
static H_warn = DyFM_Log.highlightedWarn;
|
|
248
|
+
/**
|
|
249
|
+
* Tests a success message.
|
|
250
|
+
* @param message - The message to test.
|
|
251
|
+
* @param optionalParams - The optional parameters to test.
|
|
252
|
+
*/
|
|
154
253
|
static testSuccess(message, ...optionalParams) {
|
|
155
254
|
this.success('\n\n' + this.h_solid + '\n');
|
|
156
255
|
this.success(message, ...optionalParams);
|
|
157
256
|
this.success('\n' + this.h_solid + '\n\n');
|
|
158
257
|
}
|
|
258
|
+
/**
|
|
259
|
+
* Logs a highlighted success message.
|
|
260
|
+
* @param message - The message to highlight.
|
|
261
|
+
* @param optionalParams - The optional parameters to highlight.
|
|
262
|
+
*/
|
|
159
263
|
static highlightedSuccess(message, ...optionalParams) {
|
|
160
264
|
this.success('\n\n' + this.h_before);
|
|
161
265
|
this.success(' ' + this.h_before);
|
|
@@ -172,26 +276,45 @@ class DyFM_Log {
|
|
|
172
276
|
static h_before = '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\';
|
|
173
277
|
// eslint-disable-next-line max-len
|
|
174
278
|
static h_after = '/////////////////////////////////////////////////////////////////////////////';
|
|
279
|
+
/**
|
|
280
|
+
* Removes the log styles from a message.
|
|
281
|
+
* @param message - The message to remove the styles from.
|
|
282
|
+
* @returns The message without the styles.
|
|
283
|
+
*/
|
|
175
284
|
static removeLogStyles(message) {
|
|
176
285
|
for (const styleKey of Object(log_style_enum_1.DyFM_LogStyle)) {
|
|
177
286
|
message = message.replace(new RegExp(log_style_enum_1.DyFM_LogStyle[styleKey], 'g'), '');
|
|
178
287
|
}
|
|
179
288
|
return message;
|
|
180
289
|
}
|
|
290
|
+
/**
|
|
291
|
+
* Silences all logs.
|
|
292
|
+
*/
|
|
181
293
|
static silenceLogs() {
|
|
182
294
|
console.log = () => { };
|
|
183
295
|
}
|
|
296
|
+
/**
|
|
297
|
+
* Silences non-error logs.
|
|
298
|
+
*/
|
|
184
299
|
static silenceNonErrorLogs() {
|
|
185
300
|
console.log = () => { };
|
|
186
301
|
console.info = () => { };
|
|
187
302
|
console.warn = () => { };
|
|
188
303
|
}
|
|
304
|
+
/**
|
|
305
|
+
* Silences all logs.
|
|
306
|
+
*/
|
|
189
307
|
static silenceConsole() {
|
|
190
308
|
console.log = () => { };
|
|
191
309
|
console.info = () => { };
|
|
192
310
|
console.warn = () => { };
|
|
193
311
|
console.error = () => { };
|
|
194
312
|
}
|
|
313
|
+
/**
|
|
314
|
+
* Adds breaks and tabs to the string parameters.
|
|
315
|
+
* @param params - The parameters to add the breaks and tabs to.
|
|
316
|
+
* @returns The parameters with the breaks and tabs added.
|
|
317
|
+
*/
|
|
195
318
|
static addBreaksAndTabsToStringParams(params) {
|
|
196
319
|
return params.map((param) => {
|
|
197
320
|
if (typeof param === 'string') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.util.js","sourceRoot":"","sources":["../../../src/_collections/utils/log.util.ts"],"names":[],"mappings":";;;AACA,gEAA4D;AAK5D;;;;GAIG;AACH,MAAa,QAAQ;IAEnB,MAAM,CAAC,QAAQ,CAAC,MAAuB;QACrC,IAAI,SAAS,GAAG,EAAE,CAAC;QAEnB,MAAM,CAAC,OAAO,CAAC,CAAC,KAAoB,EAAQ,EAAE;YAC5C,SAAS,IAAI,KAAK,CAAC;QACrB,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACzB,CAAC;
|
|
1
|
+
{"version":3,"file":"log.util.js","sourceRoot":"","sources":["../../../src/_collections/utils/log.util.ts"],"names":[],"mappings":";;;AACA,gEAA4D;AAK5D;;;;GAIG;AACH,MAAa,QAAQ;IAEnB;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,MAAuB;QACrC,IAAI,SAAS,GAAG,EAAE,CAAC;QAEnB,MAAM,CAAC,OAAO,CAAC,CAAC,KAAoB,EAAQ,EAAE;YAC5C,SAAS,IAAI,KAAK,CAAC;QACrB,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,UAAU;QACf,OAAO,CAAC,GAAG,CAAC,8BAAa,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,KAAa,EAAE,MAAuB,EAAE,SAAmB;QACzE,IAAI,MAAM,GAAG,EAAE,CAAC;QAEhB,MAAM,CAAC,OAAO,CAAC,CAAC,KAAoB,EAAQ,EAAE;YAC5C,MAAM,IAAI,KAAK,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,MAAM,IAAI,KAAK,CAAC;QAEhB,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,8BAAa,CAAC,KAAK,CAAC;QAChC,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAA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;OAIG;IACH,MAAM,CAAC,8BAA8B,CAAC,MAAa;QACjD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAU,EAAU,EAAE;YACvC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBAC9B,OAAO,QAAQ,GAAG,KAAK,CAAC;YAC1B,CAAC;iBAAM,CAAC;gBACN,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;;AAtWH,4BAuWC"}
|
|
@@ -7,7 +7,7 @@ xdescribe('| DyFM_BoxBounds', () => {
|
|
|
7
7
|
const mockPosition = new vector2_util_1.DyFM_Vector2_Util({ x: 0, y: 0 });
|
|
8
8
|
const mockSize = new vector2_util_1.DyFM_Vector2_Util({ x: 10, y: 10 });
|
|
9
9
|
beforeEach(() => {
|
|
10
|
-
boxBounds = new box_bounds_util_1.
|
|
10
|
+
boxBounds = new box_bounds_util_1.DyFM_BoxBounds_Util(mockPosition, mockSize);
|
|
11
11
|
});
|
|
12
12
|
it('| should set position correctly ()', () => {
|
|
13
13
|
const newPosition = new vector2_util_1.DyFM_Vector2_Util({ x: 5, y: 5 });
|
|
@@ -29,12 +29,10 @@ xdescribe('| DyFM_BoxBounds', () => {
|
|
|
29
29
|
});
|
|
30
30
|
it('| should calculate center correctly', () => {
|
|
31
31
|
const expectedCenter = new vector2_util_1.DyFM_Vector2_Util({ x: 10, y: 10 });
|
|
32
|
-
boxBounds['calcCenter']();
|
|
33
32
|
expect(boxBounds.center).toEqual(expectedCenter);
|
|
34
33
|
});
|
|
35
34
|
it('| should calculate center margin correctly', () => {
|
|
36
35
|
const expectedCenterMargin = new vector2_util_1.DyFM_Vector2_Util({ x: -5, y: -5 });
|
|
37
|
-
boxBounds['calcCenter']();
|
|
38
36
|
expect(boxBounds.centerMargin).toEqual(expectedCenterMargin);
|
|
39
37
|
});
|
|
40
38
|
it('| should return true for constructed method', () => {
|
|
@@ -52,9 +50,8 @@ xdescribe('| DyFM_BoxBounds', () => {
|
|
|
52
50
|
});
|
|
53
51
|
it('| should clone and return a new instance', () => {
|
|
54
52
|
const clonedBoxBounds = boxBounds.clone();
|
|
55
|
-
expect(clonedBoxBounds).toBeInstanceOf(box_bounds_util_1.
|
|
53
|
+
expect(clonedBoxBounds).toBeInstanceOf(box_bounds_util_1.DyFM_BoxBounds_Util);
|
|
56
54
|
expect(clonedBoxBounds).toEqual(boxBounds);
|
|
57
55
|
});
|
|
58
|
-
// Add more test cases as needed
|
|
59
56
|
});
|
|
60
57
|
//# sourceMappingURL=box-bounds.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"box-bounds.spec.js","sourceRoot":"","sources":["../../../../src/_collections/utils/math/box-bounds.spec.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"box-bounds.spec.js","sourceRoot":"","sources":["../../../../src/_collections/utils/math/box-bounds.spec.ts"],"names":[],"mappings":";;AAAA,uDAAwD;AACxD,iDAAmD;AAEnD,SAAS,CAAC,kBAAkB,EAAE,GAAG,EAAE;IACjC,IAAI,SAA8B,CAAC;IACnC,MAAM,YAAY,GAAG,IAAI,gCAAiB,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAC3D,MAAM,QAAQ,GAAG,IAAI,gCAAiB,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAEzD,UAAU,CAAC,GAAG,EAAE;QACd,SAAS,GAAG,IAAI,qCAAmB,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,WAAW,GAAG,IAAI,gCAAiB,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAE1D,SAAS,CAAC,GAAG,GAAG,WAAW,CAAC;QA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
import { DyFM_BoxBounds } from '../../../_models/interfaces/box-bounds.interface';
|
|
1
2
|
import { DyFM_Vector2 } from '../../../_models/interfaces/vector2.interface';
|
|
2
3
|
import { DyFM_Vector2_Util } from './vector2.util';
|
|
3
4
|
/**
|
|
@@ -6,27 +7,72 @@ import { DyFM_Vector2_Util } from './vector2.util';
|
|
|
6
7
|
* while instance functions change the current BoxBounds and returns itself.
|
|
7
8
|
* (if this is not true, report it as a bug)
|
|
8
9
|
*/
|
|
9
|
-
export declare class
|
|
10
|
+
export declare class DyFM_BoxBounds_Util {
|
|
10
11
|
private readonly _pos;
|
|
12
|
+
/**
|
|
13
|
+
* setting the position will also recalculate the center and centerMargin
|
|
14
|
+
*/
|
|
11
15
|
set pos(value: DyFM_Vector2);
|
|
16
|
+
/**
|
|
17
|
+
* getting the position will return the position as a DyFM_Vector2_Util
|
|
18
|
+
*/
|
|
12
19
|
get pos(): DyFM_Vector2_Util;
|
|
13
20
|
private readonly _size;
|
|
21
|
+
/**
|
|
22
|
+
* setting the size will also recalculate the center and centerMargin
|
|
23
|
+
*/
|
|
14
24
|
set size(value: DyFM_Vector2);
|
|
25
|
+
/**
|
|
26
|
+
* getting the size will return the size as a DyFM_Vector2_Util
|
|
27
|
+
*/
|
|
15
28
|
get size(): DyFM_Vector2_Util;
|
|
16
29
|
private _center;
|
|
30
|
+
/**
|
|
31
|
+
* getting the center will return the center as a DyFM_Vector2_Util
|
|
32
|
+
* (this is calculated from the position and size every time they are set)
|
|
33
|
+
*/
|
|
17
34
|
get center(): DyFM_Vector2_Util;
|
|
18
35
|
private _centerMargin;
|
|
36
|
+
/**
|
|
37
|
+
* getting the centerMargin will return the centerMargin as a DyFM_Vector2_Util
|
|
38
|
+
* (this is calculated from the size every time it is set)
|
|
39
|
+
*/
|
|
19
40
|
get centerMargin(): DyFM_Vector2_Util;
|
|
20
41
|
constructor(
|
|
21
42
|
/** top left corner */
|
|
22
43
|
position?: DyFM_Vector2,
|
|
23
44
|
/** height and width */
|
|
24
45
|
size?: DyFM_Vector2);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
46
|
+
/**
|
|
47
|
+
* returns true if the box bounds has been constructed
|
|
48
|
+
*/
|
|
49
|
+
constructed(): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* sets the position and size of the box bounds
|
|
52
|
+
* (this will also recalculate the center and centerMargin)
|
|
53
|
+
*/
|
|
54
|
+
newValues(position: DyFM_Vector2, size: DyFM_Vector2): void;
|
|
55
|
+
/**
|
|
56
|
+
* returns true if the position is within the box bounds
|
|
57
|
+
*/
|
|
58
|
+
static bounds(box: DyFM_BoxBounds_Util, position: DyFM_Vector2): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* returns true if the position is within the box bounds
|
|
61
|
+
*/
|
|
62
|
+
bounds(position: DyFM_Vector2): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* calculates the center and centerMargin of the box bounds
|
|
65
|
+
*/
|
|
29
66
|
private calcCenter;
|
|
30
|
-
|
|
67
|
+
/**
|
|
68
|
+
* returns the box bounds as a DyFM_BoxBounds
|
|
69
|
+
*/
|
|
70
|
+
get(): DyFM_BoxBounds;
|
|
71
|
+
getBoxBounds: () => DyFM_BoxBounds;
|
|
72
|
+
toBoxBounds: () => DyFM_BoxBounds;
|
|
73
|
+
/**
|
|
74
|
+
* returns a new DyFM_BoxBounds_Util with the same position and size
|
|
75
|
+
*/
|
|
76
|
+
clone(): DyFM_BoxBounds_Util;
|
|
31
77
|
}
|
|
32
78
|
//# sourceMappingURL=box-bounds.util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"box-bounds.util.d.ts","sourceRoot":"","sources":["../../../../src/_collections/utils/math/box-bounds.util.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;GAKG;AACH,qBAAa,
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QrB,YAAY,QARL,cAAc,CAQG;IACxB,WAAW,QATJ,cAAc,CASE;IAEvB;;OAEG;IACH,KAAK,IAAI,mBAAmB;CAG7B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DyFM_BoxBounds_Util = void 0;
|
|
4
4
|
const vector2_util_1 = require("./vector2.util");
|
|
5
5
|
/**
|
|
6
6
|
* The main difference between static class functions and instance functions
|
|
@@ -8,28 +8,48 @@ const vector2_util_1 = require("./vector2.util");
|
|
|
8
8
|
* while instance functions change the current BoxBounds and returns itself.
|
|
9
9
|
* (if this is not true, report it as a bug)
|
|
10
10
|
*/
|
|
11
|
-
class
|
|
11
|
+
class DyFM_BoxBounds_Util {
|
|
12
12
|
_pos;
|
|
13
|
+
/**
|
|
14
|
+
* setting the position will also recalculate the center and centerMargin
|
|
15
|
+
*/
|
|
13
16
|
set pos(value) {
|
|
14
17
|
this._pos.newValues(value);
|
|
15
18
|
this.calcCenter();
|
|
16
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* getting the position will return the position as a DyFM_Vector2_Util
|
|
22
|
+
*/
|
|
17
23
|
get pos() {
|
|
18
24
|
return this._pos;
|
|
19
25
|
}
|
|
20
26
|
_size;
|
|
27
|
+
/**
|
|
28
|
+
* setting the size will also recalculate the center and centerMargin
|
|
29
|
+
*/
|
|
21
30
|
set size(value) {
|
|
22
31
|
this._size.newValues(value);
|
|
23
32
|
this.calcCenter();
|
|
24
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* getting the size will return the size as a DyFM_Vector2_Util
|
|
36
|
+
*/
|
|
25
37
|
get size() {
|
|
26
38
|
return this._size;
|
|
27
39
|
}
|
|
28
40
|
_center;
|
|
41
|
+
/**
|
|
42
|
+
* getting the center will return the center as a DyFM_Vector2_Util
|
|
43
|
+
* (this is calculated from the position and size every time they are set)
|
|
44
|
+
*/
|
|
29
45
|
get center() {
|
|
30
46
|
return this._center;
|
|
31
47
|
}
|
|
32
48
|
_centerMargin;
|
|
49
|
+
/**
|
|
50
|
+
* getting the centerMargin will return the centerMargin as a DyFM_Vector2_Util
|
|
51
|
+
* (this is calculated from the size every time it is set)
|
|
52
|
+
*/
|
|
33
53
|
get centerMargin() {
|
|
34
54
|
return this._centerMargin;
|
|
35
55
|
}
|
|
@@ -42,9 +62,16 @@ class DyFM_BoxBounds {
|
|
|
42
62
|
this._size = new vector2_util_1.DyFM_Vector2_Util(size);
|
|
43
63
|
this.calcCenter();
|
|
44
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* returns true if the box bounds has been constructed
|
|
67
|
+
*/
|
|
45
68
|
constructed() {
|
|
46
69
|
return true;
|
|
47
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* sets the position and size of the box bounds
|
|
73
|
+
* (this will also recalculate the center and centerMargin)
|
|
74
|
+
*/
|
|
48
75
|
newValues(position, size) {
|
|
49
76
|
if (position === undefined) {
|
|
50
77
|
throw new Error('new position is undefined!');
|
|
@@ -56,21 +83,46 @@ class DyFM_BoxBounds {
|
|
|
56
83
|
this._size.newValues(size);
|
|
57
84
|
this.calcCenter();
|
|
58
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* returns true if the position is within the box bounds
|
|
88
|
+
*/
|
|
59
89
|
static bounds(box, position) {
|
|
60
90
|
return box.pos.x <= position.x && position.x <= box.pos.x + box.size.x &&
|
|
61
91
|
box.pos.y <= position.y && position.y <= box.pos.y + box.size.y;
|
|
62
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* returns true if the position is within the box bounds
|
|
95
|
+
*/
|
|
63
96
|
bounds(position) {
|
|
64
|
-
return
|
|
97
|
+
return DyFM_BoxBounds_Util.bounds(this, position);
|
|
65
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* calculates the center and centerMargin of the box bounds
|
|
101
|
+
*/
|
|
66
102
|
calcCenter() {
|
|
67
103
|
const halfSize = vector2_util_1.DyFM_Vector2_Util.divide(this.size, 2);
|
|
68
104
|
this._center = vector2_util_1.DyFM_Vector2_Util.plus(this.pos, halfSize);
|
|
69
105
|
this._centerMargin = vector2_util_1.DyFM_Vector2_Util.negative(halfSize);
|
|
70
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* returns the box bounds as a DyFM_BoxBounds
|
|
109
|
+
*/
|
|
110
|
+
get() {
|
|
111
|
+
return {
|
|
112
|
+
pos: this._pos.get(),
|
|
113
|
+
size: this._size.get(),
|
|
114
|
+
center: this._center.get(),
|
|
115
|
+
centerMargin: this._centerMargin.get()
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
getBoxBounds = this.get;
|
|
119
|
+
toBoxBounds = this.get;
|
|
120
|
+
/**
|
|
121
|
+
* returns a new DyFM_BoxBounds_Util with the same position and size
|
|
122
|
+
*/
|
|
71
123
|
clone() {
|
|
72
|
-
return new
|
|
124
|
+
return new DyFM_BoxBounds_Util(this._pos.clone(), this._size.clone());
|
|
73
125
|
}
|
|
74
126
|
}
|
|
75
|
-
exports.
|
|
127
|
+
exports.DyFM_BoxBounds_Util = DyFM_BoxBounds_Util;
|
|
76
128
|
//# sourceMappingURL=box-bounds.util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"box-bounds.util.js","sourceRoot":"","sources":["../../../../src/_collections/utils/math/box-bounds.util.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"box-bounds.util.js","sourceRoot":"","sources":["../../../../src/_collections/utils/math/box-bounds.util.ts"],"names":[],"mappings":";;;AAIA,iDAAmD;AAEnD;;;;;GAKG;AACH,MAAa,mBAAmB;IACb,IAAI,CAAoB;IACzC;;OAEG;IACH,IAAI,GAAG,CAAC,KAAmB;QACzB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAE3B,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IACD;;OAEG;IACH,IAAI,GAAG;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AAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;IACxE,CAAC;CACF;AArID,kDAqIC"}
|
|
@@ -7,7 +7,7 @@ describe('| DyFM_BoxBounds', () => {
|
|
|
7
7
|
const position = { x: 10, y: 20 };
|
|
8
8
|
const size = { x: 30, y: 40 };
|
|
9
9
|
beforeEach(() => {
|
|
10
|
-
boxBounds = new box_bounds_util_1.
|
|
10
|
+
boxBounds = new box_bounds_util_1.DyFM_BoxBounds_Util(position, size);
|
|
11
11
|
});
|
|
12
12
|
it('| should initialize with given position and size', () => {
|
|
13
13
|
expect(boxBounds.pos.x).toBe(position.x);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"box-bounds.util.spec.js","sourceRoot":"","sources":["../../../../src/_collections/utils/math/box-bounds.util.spec.ts"],"names":[],"mappings":";;AACA,
|
|
1
|
+
{"version":3,"file":"box-bounds.util.spec.js","sourceRoot":"","sources":["../../../../src/_collections/utils/math/box-bounds.util.spec.ts"],"names":[],"mappings":";;AACA,uDAAwD;AACxD,iDAAmD;AAGnD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,IAAI,SAA8B,CAAC;IACnC,MAAM,QAAQ,GAAiB,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IAChD,MAAM,IAAI,GAAiB,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IAE5C,UAAU,CAAC,GAAG,EAAE;QACd,SAAS,GAAG,IAAI,qCAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAA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AC,CAAC,CAAC;QAC1C,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC1C,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC5C,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC5C,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,13 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* this class is a collection of static methods for mathematical operations
|
|
3
|
+
*/
|
|
1
4
|
export declare class DyFM_Math {
|
|
5
|
+
/**
|
|
6
|
+
* returns true if the value is between the min and max
|
|
7
|
+
*/
|
|
2
8
|
static between(value: number, minExclusive: number, maxExclusive: number): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* returns true if the value is between the target and the range
|
|
11
|
+
*/
|
|
3
12
|
static around(value: number, target: number, range: number): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* returns a random integer between the min and max
|
|
15
|
+
*/
|
|
4
16
|
static getRandomInt(min: number, max: number): number;
|
|
5
17
|
static readonly toFixed: typeof DyFM_Math.round;
|
|
18
|
+
/**
|
|
19
|
+
* returns a number rounded to the specified number of decimals
|
|
20
|
+
*/
|
|
6
21
|
static round(value: number, decimals?: number): number;
|
|
22
|
+
/**
|
|
23
|
+
* returns a number with spaces between the thousands
|
|
24
|
+
*/
|
|
7
25
|
static numberWithSpaces(x: number): string;
|
|
26
|
+
/**
|
|
27
|
+
* returns a number with shorter units
|
|
28
|
+
*/
|
|
8
29
|
static numberWithShorters(x: number): string;
|
|
30
|
+
/**
|
|
31
|
+
* returns a number with shorter units and spaces between the thousands
|
|
32
|
+
*/
|
|
9
33
|
static numberWithShortersAndSpaces(x: number): string;
|
|
34
|
+
/**
|
|
35
|
+
* returns a number with spaces between the thousands
|
|
36
|
+
*/
|
|
10
37
|
static floatingNumberWithSpaces(x: number): string;
|
|
38
|
+
/**
|
|
39
|
+
* returns a number with spaces between the thousands
|
|
40
|
+
*/
|
|
11
41
|
static decimals(x: number, useSpacer?: string): string;
|
|
12
42
|
}
|
|
13
43
|
//# sourceMappingURL=math.util.d.ts.map
|