@futdevpro/fsm-dynamo 1.9.51 → 1.10.2
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 +3 -3
- package/build/_collections/utils/array.util.d.ts +1 -7
- package/build/_collections/utils/array.util.d.ts.map +1 -1
- package/build/_collections/utils/array.util.js +0 -31
- package/build/_collections/utils/array.util.js.map +1 -1
- package/build/_collections/utils/array.util.spec.js +0 -35
- package/build/_collections/utils/array.util.spec.js.map +1 -1
- package/build/_collections/utils/log.util.d.ts +1 -0
- package/build/_collections/utils/log.util.d.ts.map +1 -1
- package/build/_collections/utils/log.util.js +3 -0
- package/build/_collections/utils/log.util.js.map +1 -1
- package/build/_collections/utils/log.util.spec.d.ts +2 -0
- package/build/_collections/utils/log.util.spec.d.ts.map +1 -0
- package/build/_collections/utils/log.util.spec.js +85 -0
- package/build/_collections/utils/log.util.spec.js.map +1 -0
- package/build/_collections/utils/math/box-bounds.util.spec.d.ts +2 -0
- package/build/_collections/utils/math/box-bounds.util.spec.d.ts.map +1 -0
- package/build/_collections/utils/math/box-bounds.util.spec.js +53 -0
- package/build/_collections/utils/math/box-bounds.util.spec.js.map +1 -0
- package/build/_collections/utils/math/math.util.spec.d.ts +2 -0
- package/build/_collections/utils/math/math.util.spec.d.ts.map +1 -0
- package/build/_collections/utils/math/math.util.spec.js +89 -0
- package/build/_collections/utils/math/math.util.spec.js.map +1 -0
- package/build/_collections/utils/math/random.util.spec.d.ts +2 -0
- package/build/_collections/utils/math/random.util.spec.d.ts.map +1 -0
- package/build/_collections/utils/math/random.util.spec.js +75 -0
- package/build/_collections/utils/math/random.util.spec.js.map +1 -0
- package/build/_collections/utils/math/trigonometry.util.spec.d.ts +2 -0
- package/build/_collections/utils/math/trigonometry.util.spec.d.ts.map +1 -0
- package/build/_collections/utils/math/trigonometry.util.spec.js +49 -0
- package/build/_collections/utils/math/trigonometry.util.spec.js.map +1 -0
- package/build/_collections/utils/math/vector2.util.spec.d.ts +2 -0
- package/build/_collections/utils/math/vector2.util.spec.d.ts.map +1 -0
- package/build/_collections/utils/math/vector2.util.spec.js +82 -0
- package/build/_collections/utils/math/vector2.util.spec.js.map +1 -0
- package/build/_collections/utils/regex/password-regex.util.spec.d.ts +2 -0
- package/build/_collections/utils/regex/password-regex.util.spec.d.ts.map +1 -0
- package/build/_collections/utils/regex/password-regex.util.spec.js +44 -0
- package/build/_collections/utils/regex/password-regex.util.spec.js.map +1 -0
- package/build/_collections/utils/regex/regex.util.spec.d.ts +2 -0
- package/build/_collections/utils/regex/regex.util.spec.d.ts.map +1 -0
- package/build/_collections/utils/regex/regex.util.spec.js +40 -0
- package/build/_collections/utils/regex/regex.util.spec.js.map +1 -0
- package/build/_collections/utils/regex/username-regex.util.spec.d.ts +2 -0
- package/build/_collections/utils/regex/username-regex.util.spec.d.ts.map +1 -0
- package/build/_collections/utils/regex/username-regex.util.spec.js +59 -0
- package/build/_collections/utils/regex/username-regex.util.spec.js.map +1 -0
- package/build/_collections/utils/round-list.util.d.ts.map +1 -1
- package/build/_collections/utils/round-list.util.js +1 -1
- package/build/_collections/utils/round-list.util.js.map +1 -1
- package/build/_collections/utils/round-list.util.spec.d.ts +2 -0
- package/build/_collections/utils/round-list.util.spec.d.ts.map +1 -0
- package/build/_collections/utils/round-list.util.spec.js +65 -0
- package/build/_collections/utils/round-list.util.spec.js.map +1 -0
- package/build/_collections/utils/shared.util.spec.d.ts +2 -0
- package/build/_collections/utils/shared.util.spec.d.ts.map +1 -0
- package/build/_collections/utils/shared.util.spec.js +113 -0
- package/build/_collections/utils/shared.util.spec.js.map +1 -0
- package/build/_collections/utils/string.util.d.ts +5 -0
- package/build/_collections/utils/string.util.d.ts.map +1 -0
- package/build/_collections/utils/string.util.js +11 -0
- package/build/_collections/utils/string.util.js.map +1 -0
- package/build/_collections/utils/string.util.spec.d.ts +2 -0
- package/build/_collections/utils/string.util.spec.d.ts.map +1 -0
- package/build/_collections/utils/string.util.spec.js +36 -0
- package/build/_collections/utils/string.util.spec.js.map +1 -0
- package/build/_collections/utils/type-cloning-facility.util.spec.d.ts +2 -0
- package/build/_collections/utils/type-cloning-facility.util.spec.d.ts.map +1 -0
- package/build/_collections/utils/type-cloning-facility.util.spec.js +41 -0
- package/build/_collections/utils/type-cloning-facility.util.spec.js.map +1 -0
- package/build/_collections/utils/utilities.util.d.ts +0 -8
- package/build/_collections/utils/utilities.util.d.ts.map +1 -1
- package/build/_collections/utils/utilities.util.js +0 -8
- package/build/_collections/utils/utilities.util.js.map +1 -1
- package/build/_collections/utils/utilities.util.spec.d.ts +2 -0
- package/build/_collections/utils/utilities.util.spec.d.ts.map +1 -0
- package/build/_collections/utils/utilities.util.spec.js +145 -0
- package/build/_collections/utils/utilities.util.spec.js.map +1 -0
- package/build/_collections/utils/uuid.util.d.ts +0 -1
- package/build/_collections/utils/uuid.util.d.ts.map +1 -1
- package/build/_collections/utils/uuid.util.js +1 -1
- package/build/_collections/utils/uuid.util.js.map +1 -1
- package/build/_collections/utils/uuid.util.spec.d.ts +2 -0
- package/build/_collections/utils/uuid.util.spec.d.ts.map +1 -0
- package/build/_collections/utils/uuid.util.spec.js +29 -0
- package/build/_collections/utils/uuid.util.spec.js.map +1 -0
- package/build/_models/control-models/data-model-params.control-model.spec.d.ts +2 -0
- package/build/_models/control-models/data-model-params.control-model.spec.d.ts.map +1 -0
- package/build/_models/control-models/data-model-params.control-model.spec.js +53 -0
- package/build/_models/control-models/data-model-params.control-model.spec.js.map +1 -0
- package/build/_models/control-models/data-property-params.control-model.spec.d.ts +2 -0
- package/build/_models/control-models/data-property-params.control-model.spec.d.ts.map +1 -0
- package/build/_models/control-models/data-property-params.control-model.spec.js +83 -0
- package/build/_models/control-models/data-property-params.control-model.spec.js.map +1 -0
- package/build/_models/control-models/poll.control-model.d.ts +7 -7
- package/build/_models/control-models/poll.control-model.d.ts.map +1 -1
- package/build/_models/control-models/poll.control-model.js.map +1 -1
- package/build/_models/control-models/poll.control-model.spec.d.ts +2 -0
- package/build/_models/control-models/poll.control-model.spec.d.ts.map +1 -0
- package/build/_models/control-models/poll.control-model.spec.js +57 -0
- package/build/_models/control-models/poll.control-model.spec.js.map +1 -0
- package/build/_models/control-models/range-value.control-model.spec.d.ts +2 -0
- package/build/_models/control-models/range-value.control-model.spec.d.ts.map +1 -0
- package/build/_models/control-models/range-value.control-model.spec.js +163 -0
- package/build/_models/control-models/range-value.control-model.spec.js.map +1 -0
- package/build/_models/data-models/metadata.data-model.spec.d.ts +2 -0
- package/build/_models/data-models/metadata.data-model.spec.d.ts.map +1 -0
- package/build/_models/data-models/metadata.data-model.spec.js +102 -0
- package/build/_models/data-models/metadata.data-model.spec.js.map +1 -0
- package/build/_models/interfaces/search-query.interface.d.ts +2 -2
- package/build/_models/interfaces/search-query.interface.d.ts.map +1 -1
- package/build/_models/interfaces/search-result.interface.d.ts +5 -0
- package/build/_models/interfaces/search-result.interface.d.ts.map +1 -0
- package/build/_models/interfaces/search-result.interface.js +3 -0
- package/build/_models/interfaces/search-result.interface.js.map +1 -0
- package/build/_modules/custom-data/_models/cud.data-model.spec.d.ts +2 -0
- package/build/_modules/custom-data/_models/cud.data-model.spec.d.ts.map +1 -0
- package/build/_modules/custom-data/_models/cud.data-model.spec.js +34 -0
- package/build/_modules/custom-data/_models/cud.data-model.spec.js.map +1 -0
- package/build/_modules/location/_collections/loc-regions.util.spec.d.ts +2 -0
- package/build/_modules/location/_collections/loc-regions.util.spec.d.ts.map +1 -0
- package/build/_modules/location/_collections/loc-regions.util.spec.js +51 -0
- package/build/_modules/location/_collections/loc-regions.util.spec.js.map +1 -0
- package/build/_modules/location/_collections/loc.util.spec.d.ts +2 -0
- package/build/_modules/location/_collections/loc.util.spec.d.ts.map +1 -0
- package/build/_modules/location/_collections/loc.util.spec.js +39 -0
- package/build/_modules/location/_collections/loc.util.spec.js.map +1 -0
- package/build/_modules/pipe/_collections/utils/pip-country-pipe.util.spec.d.ts +2 -0
- package/build/_modules/pipe/_collections/utils/pip-country-pipe.util.spec.d.ts.map +1 -0
- package/build/_modules/pipe/_collections/utils/pip-country-pipe.util.spec.js +33 -0
- package/build/_modules/pipe/_collections/utils/pip-country-pipe.util.spec.js.map +1 -0
- package/build/_modules/pipe/_collections/utils/pip-custom-pipe.util.spec.d.ts +2 -0
- package/build/_modules/pipe/_collections/utils/pip-custom-pipe.util.spec.d.ts.map +1 -0
- package/build/_modules/pipe/_collections/utils/pip-custom-pipe.util.spec.js +36 -0
- package/build/_modules/pipe/_collections/utils/pip-custom-pipe.util.spec.js.map +1 -0
- package/build/_modules/pipe/_collections/utils/pip-division-pipe.util.spec.d.ts +2 -0
- package/build/_modules/pipe/_collections/utils/pip-division-pipe.util.spec.d.ts.map +1 -0
- package/build/_modules/pipe/_collections/utils/pip-division-pipe.util.spec.js +35 -0
- package/build/_modules/pipe/_collections/utils/pip-division-pipe.util.spec.js.map +1 -0
- package/build/_modules/pipe/_collections/utils/pip-list-pipe.util.spec.d.ts +2 -0
- package/build/_modules/pipe/_collections/utils/pip-list-pipe.util.spec.d.ts.map +1 -0
- package/build/_modules/pipe/_collections/utils/pip-list-pipe.util.spec.js +31 -0
- package/build/_modules/pipe/_collections/utils/pip-list-pipe.util.spec.js.map +1 -0
- package/build/_modules/pipe/_collections/utils/pip-multi-pipe-pipe.util.spec.d.ts +2 -0
- package/build/_modules/pipe/_collections/utils/pip-multi-pipe-pipe.util.spec.d.ts.map +1 -0
- package/build/_modules/pipe/_collections/utils/pip-multi-pipe-pipe.util.spec.js +54 -0
- package/build/_modules/pipe/_collections/utils/pip-multi-pipe-pipe.util.spec.js.map +1 -0
- package/build/_modules/pipe/_collections/utils/pip-obj-key-pipe.util.spec.d.ts +2 -0
- package/build/_modules/pipe/_collections/utils/pip-obj-key-pipe.util.spec.d.ts.map +1 -0
- package/build/_modules/pipe/_collections/utils/pip-obj-key-pipe.util.spec.js +26 -0
- package/build/_modules/pipe/_collections/utils/pip-obj-key-pipe.util.spec.js.map +1 -0
- package/build/_modules/pipe/_collections/utils/pip-range-pipe.util.spec.d.ts +2 -0
- package/build/_modules/pipe/_collections/utils/pip-range-pipe.util.spec.d.ts.map +1 -0
- package/build/_modules/pipe/_collections/utils/pip-range-pipe.util.spec.js +50 -0
- package/build/_modules/pipe/_collections/utils/pip-range-pipe.util.spec.js.map +1 -0
- package/build/_modules/pipe/_collections/utils/pip-region-pipe.util.spec.d.ts +2 -0
- package/build/_modules/pipe/_collections/utils/pip-region-pipe.util.spec.d.ts.map +1 -0
- package/build/_modules/pipe/_collections/utils/pip-region-pipe.util.spec.js +23 -0
- package/build/_modules/pipe/_collections/utils/pip-region-pipe.util.spec.js.map +1 -0
- package/build/_modules/pipe/_collections/utils/pip-replace-pipe.util.spec.d.ts +2 -0
- package/build/_modules/pipe/_collections/utils/pip-replace-pipe.util.spec.d.ts.map +1 -0
- package/build/_modules/pipe/_collections/utils/pip-replace-pipe.util.spec.js +38 -0
- package/build/_modules/pipe/_collections/utils/pip-replace-pipe.util.spec.js.map +1 -0
- package/build/_modules/pipe/_collections/utils/pip-slider-pipe.util.spec.d.ts +2 -0
- package/build/_modules/pipe/_collections/utils/pip-slider-pipe.util.spec.d.ts.map +1 -0
- package/build/_modules/pipe/_collections/utils/pip-slider-pipe.util.spec.js +20 -0
- package/build/_modules/pipe/_collections/utils/pip-slider-pipe.util.spec.js.map +1 -0
- package/build/_modules/pipe/_collections/utils/pip-smart-replace-pipe.util.spec.d.ts +2 -0
- package/build/_modules/pipe/_collections/utils/pip-smart-replace-pipe.util.spec.d.ts.map +1 -0
- package/build/_modules/pipe/_collections/utils/pip-smart-replace-pipe.util.spec.js +49 -0
- package/build/_modules/pipe/_collections/utils/pip-smart-replace-pipe.util.spec.js.map +1 -0
- package/build/_modules/socket/_models/sck-client-params.control-model.spec.d.ts +2 -0
- package/build/_modules/socket/_models/sck-client-params.control-model.spec.d.ts.map +1 -0
- package/build/_modules/socket/_models/sck-client-params.control-model.spec.js +54 -0
- package/build/_modules/socket/_models/sck-client-params.control-model.spec.js.map +1 -0
- package/build/_modules/socket/_models/sck-socket-event.control-model.d.ts +1 -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 +2 -2
- package/build/_modules/socket/_models/sck-socket-event.control-model.js.map +1 -1
- package/build/_modules/socket/_models/sck-socket-event.control-model.spec.d.ts +2 -0
- package/build/_modules/socket/_models/sck-socket-event.control-model.spec.d.ts.map +1 -0
- package/build/_modules/socket/_models/sck-socket-event.control-model.spec.js +49 -0
- package/build/_modules/socket/_models/sck-socket-event.control-model.spec.js.map +1 -0
- package/build/_modules/socket/_services/sck-client.service-base.d.ts +3 -3
- package/build/_modules/socket/_services/sck-client.service-base.d.ts.map +1 -1
- package/build/_modules/socket/_services/sck-client.service-base.js +3 -3
- package/build/_modules/socket/_services/sck-client.service-base.js.map +1 -1
- package/build/_modules/socket/_services/sck-client.service-base.spec.d.ts +2 -0
- package/build/_modules/socket/_services/sck-client.service-base.spec.d.ts.map +1 -0
- package/build/_modules/socket/_services/sck-client.service-base.spec.js +82 -0
- package/build/_modules/socket/_services/sck-client.service-base.spec.js.map +1 -0
- package/build/_modules/usage/_models/usg-action.control-model.spec.d.ts +2 -0
- package/build/_modules/usage/_models/usg-action.control-model.spec.d.ts.map +1 -0
- package/build/_modules/usage/_models/usg-action.control-model.spec.js +24 -0
- package/build/_modules/usage/_models/usg-action.control-model.spec.js.map +1 -0
- package/build/_modules/usage/_models/usg-daily-usage-data.control-model.spec.d.ts +2 -0
- package/build/_modules/usage/_models/usg-daily-usage-data.control-model.spec.d.ts.map +1 -0
- package/build/_modules/usage/_models/usg-daily-usage-data.control-model.spec.js +33 -0
- package/build/_modules/usage/_models/usg-daily-usage-data.control-model.spec.js.map +1 -0
- package/build/_modules/usage/_models/usg-data.control-model.spec.d.ts +2 -0
- package/build/_modules/usage/_models/usg-data.control-model.spec.d.ts.map +1 -0
- package/build/_modules/usage/_models/usg-data.control-model.spec.js +37 -0
- package/build/_modules/usage/_models/usg-data.control-model.spec.js.map +1 -0
- package/build/_modules/usage/_models/usg-session.data-model.spec.d.ts +2 -0
- package/build/_modules/usage/_models/usg-session.data-model.spec.d.ts.map +1 -0
- package/build/_modules/usage/_models/usg-session.data-model.spec.js +66 -0
- package/build/_modules/usage/_models/usg-session.data-model.spec.js.map +1 -0
- 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.02.tgz +0 -0
- package/package.json +11 -23
- package/src/_collections/utils/array.util.spec.ts +0 -45
- package/src/_collections/utils/array.util.ts +2 -45
- package/src/_collections/utils/log.util.spec.ts +99 -0
- package/src/_collections/utils/log.util.ts +4 -0
- package/src/_collections/utils/math/box-bounds.util.spec.ts +63 -0
- package/src/_collections/utils/math/math.util.spec.ts +104 -0
- package/src/_collections/utils/math/random.util.spec.ts +82 -0
- package/src/_collections/utils/math/trigonometry.util.spec.ts +57 -0
- package/src/_collections/utils/math/vector2.util.spec.ts +94 -0
- package/src/_collections/utils/regex/password-regex.util.spec.ts +51 -0
- package/src/_collections/utils/regex/regex.util.spec.ts +42 -0
- package/src/_collections/utils/regex/username-regex.util.spec.ts +61 -0
- package/src/_collections/utils/round-list.util.spec.ts +79 -0
- package/src/_collections/utils/round-list.util.ts +46 -1
- package/src/_collections/utils/shared.util.spec.ts +143 -0
- package/src/_collections/utils/string.util.spec.ts +41 -0
- package/src/_collections/utils/string.util.ts +10 -0
- package/src/_collections/utils/type-cloning-facility.util.spec.ts +51 -0
- package/src/_collections/utils/utilities.util.spec.ts +166 -0
- package/src/_collections/utils/utilities.util.ts +1 -12
- package/src/_collections/utils/uuid.util.spec.ts +30 -0
- package/src/_collections/utils/uuid.util.ts +14 -1
- package/src/_models/control-models/data-model-params.control-model.spec.ts +67 -0
- package/src/_models/control-models/data-property-params.control-model.spec.ts +109 -0
- package/src/_models/control-models/poll.control-model.spec.ts +63 -0
- package/src/_models/control-models/poll.control-model.ts +8 -7
- package/src/_models/control-models/range-value.control-model.spec.ts +187 -0
- package/src/_models/data-models/metadata.data-model.spec.ts +123 -0
- package/src/_models/interfaces/search-query.interface.ts +2 -2
- package/src/_models/interfaces/search-result.interface.ts +6 -0
- package/src/_modules/custom-data/_models/cud.data-model.spec.ts +38 -0
- package/src/_modules/location/_collections/loc-regions.util.spec.ts +61 -0
- package/src/_modules/location/_collections/loc.util.spec.ts +52 -0
- package/src/_modules/pipe/_collections/utils/pip-country-pipe.util.spec.ts +47 -0
- package/src/_modules/pipe/_collections/utils/pip-custom-pipe.util.spec.ts +39 -0
- package/src/_modules/pipe/_collections/utils/pip-division-pipe.util.spec.ts +41 -0
- package/src/_modules/pipe/_collections/utils/pip-list-pipe.util.spec.ts +34 -0
- package/src/_modules/pipe/_collections/utils/pip-multi-pipe-pipe.util.spec.ts +60 -0
- package/src/_modules/pipe/_collections/utils/pip-obj-key-pipe.util.spec.ts +28 -0
- package/src/_modules/pipe/_collections/utils/pip-range-pipe.util.spec.ts +59 -0
- package/src/_modules/pipe/_collections/utils/pip-region-pipe.util.spec.ts +31 -0
- package/src/_modules/pipe/_collections/utils/pip-replace-pipe.util.spec.ts +44 -0
- package/src/_modules/pipe/_collections/utils/pip-slider-pipe.util.spec.ts +21 -0
- package/src/_modules/pipe/_collections/utils/pip-smart-replace-pipe.util.spec.ts +61 -0
- package/src/_modules/socket/_models/sck-client-params.control-model.spec.ts +67 -0
- package/src/_modules/socket/_models/sck-socket-event.control-model.spec.ts +66 -0
- package/src/_modules/socket/_models/sck-socket-event.control-model.ts +2 -2
- package/src/_modules/socket/_services/sck-client.service-base.spec.ts +99 -0
- package/src/_modules/socket/_services/sck-client.service-base.ts +7 -7
- package/src/_modules/usage/_models/usg-action.control-model.spec.ts +27 -0
- package/src/_modules/usage/_models/usg-daily-usage-data.control-model.spec.ts +36 -0
- package/src/_modules/usage/_models/usg-data.control-model.spec.ts +41 -0
- package/src/_modules/usage/_models/usg-session.data-model.spec.ts +73 -0
- package/src/index.ts +1 -0
- package/futdevpro-fsm-dynamo-01.09.51.tgz +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const random_util_1 = require("./random.util");
|
|
4
|
+
describe('DyFM_Random', () => {
|
|
5
|
+
describe('getRandomWeightedInt', () => {
|
|
6
|
+
it('should return a weighted random integer within the range', () => {
|
|
7
|
+
const weights = [
|
|
8
|
+
{ chance: 0.1, result: 1 },
|
|
9
|
+
{ chance: 0.3, result: 2 },
|
|
10
|
+
{ chance: 0.6, result: 3 }
|
|
11
|
+
];
|
|
12
|
+
const result = random_util_1.DyFM_Random.getRandomWeightedInt(1, 3, weights);
|
|
13
|
+
expect(result).toBeGreaterThanOrEqual(1);
|
|
14
|
+
expect(result).toBeLessThanOrEqual(3);
|
|
15
|
+
});
|
|
16
|
+
it('should normalize weights if their sum is greater than 1', () => {
|
|
17
|
+
const weights = [
|
|
18
|
+
{ chance: 0.5, result: 1 },
|
|
19
|
+
{ chance: 0.5, result: 2 },
|
|
20
|
+
{ chance: 0.5, result: 3 }
|
|
21
|
+
];
|
|
22
|
+
const result = random_util_1.DyFM_Random.getRandomWeightedInt(1, 3, weights);
|
|
23
|
+
expect(result).toBeGreaterThanOrEqual(1);
|
|
24
|
+
expect(result).toBeLessThanOrEqual(3);
|
|
25
|
+
});
|
|
26
|
+
it('should return a random integer within the range if no weights match', () => {
|
|
27
|
+
const weights = [
|
|
28
|
+
{ chance: 0, result: 1 },
|
|
29
|
+
{ chance: 0, result: 2 },
|
|
30
|
+
{ chance: 0, result: 3 }
|
|
31
|
+
];
|
|
32
|
+
const result = random_util_1.DyFM_Random.getRandomWeightedInt(1, 3, weights);
|
|
33
|
+
expect(result).toBeGreaterThanOrEqual(1);
|
|
34
|
+
expect(result).toBeLessThanOrEqual(3);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
describe('getRandomInt', () => {
|
|
38
|
+
it('should return a random integer within the specified range', () => {
|
|
39
|
+
const min = 5;
|
|
40
|
+
const max = 10;
|
|
41
|
+
const result = random_util_1.DyFM_Random.getRandomInt(min, max);
|
|
42
|
+
expect(result).toBeGreaterThanOrEqual(min);
|
|
43
|
+
expect(result).toBeLessThanOrEqual(max);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
describe('getRandomListElement', () => {
|
|
47
|
+
it('should return a random element from the list', () => {
|
|
48
|
+
const list = [1, 2, 3, 4, 5];
|
|
49
|
+
const result = random_util_1.DyFM_Random.getRandomListElement(list);
|
|
50
|
+
expect(list).toContain(result);
|
|
51
|
+
});
|
|
52
|
+
it('should return null if the list is empty', () => {
|
|
53
|
+
const list = [];
|
|
54
|
+
const result = random_util_1.DyFM_Random.getRandomListElement(list);
|
|
55
|
+
expect(result).toBeNull();
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
describe('getRandomWeighted', () => {
|
|
59
|
+
it('should return a weighted random element', () => {
|
|
60
|
+
const weights = [
|
|
61
|
+
{ chance: 0.2, result: 'a' },
|
|
62
|
+
{ chance: 0.5, result: 'b' },
|
|
63
|
+
{ chance: 0.3, result: 'c' }
|
|
64
|
+
];
|
|
65
|
+
const result = random_util_1.DyFM_Random.getRandomWeighted(weights);
|
|
66
|
+
expect(['a', 'b', 'c']).toContain(result);
|
|
67
|
+
});
|
|
68
|
+
it('should return null if weights array is empty', () => {
|
|
69
|
+
const weights = [];
|
|
70
|
+
const result = random_util_1.DyFM_Random.getRandomWeighted(weights);
|
|
71
|
+
expect(result).toBeNull();
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=random.util.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random.util.spec.js","sourceRoot":"","sources":["../../../../src/_collections/utils/math/random.util.spec.ts"],"names":[],"mappings":";;AACA,+CAA4C;AAG5C,Q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,CAAC,yCAAyC,EAAE,GAAG,EAAE;YACjD,MAAM,IAAI,GAAa,EAAE,CAAC;YAC1B,MAAM,MAAM,GAAG,yBAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;YACtD,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC;QAC5B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;QACjC,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;YACjD,MAAM,OAAO,GAAgC;gBAC3C,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;gBAC5B,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;gBAC5B,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;aAC7B,CAAC;YACF,MAAM,MAAM,GAAG,yBAAW,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;YACtD,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;YACtD,MAAM,OAAO,GAAgC,EAAE,CAAC;YAChD,MAAM,MAAM,GAAG,yBAAW,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;YACtD,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC;QAC5B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigonometry.util.spec.d.ts","sourceRoot":"","sources":["../../../../src/_collections/utils/math/trigonometry.util.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const trigonometry_util_1 = require("./trigonometry.util");
|
|
4
|
+
describe('DyFM_Trigonometry', () => {
|
|
5
|
+
describe('getClamp', () => {
|
|
6
|
+
it('should calculate the clamp using the hypotenuse and angle', () => {
|
|
7
|
+
const result = trigonometry_util_1.DyFM_Trigonometry.getClamp(10, 30);
|
|
8
|
+
expect(result).toBeCloseTo(5, 0);
|
|
9
|
+
});
|
|
10
|
+
it('should use a default angle of 45 degrees if no angle is provided', () => {
|
|
11
|
+
const result = trigonometry_util_1.DyFM_Trigonometry.getClamp(10);
|
|
12
|
+
expect(result).toBeCloseTo(7.071, 3);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
describe('getClampByClampAndHypotenuse', () => {
|
|
16
|
+
it('should calculate the clamp using another clamp and the hypotenuse', () => {
|
|
17
|
+
const result = trigonometry_util_1.DyFM_Trigonometry.getClampByClampAndHypotenuse(6, 10);
|
|
18
|
+
expect(result).toBeCloseTo(8, 0);
|
|
19
|
+
});
|
|
20
|
+
xit('should throw an error if the hypotenuse is smaller than the clamp', () => {
|
|
21
|
+
expect(() => {
|
|
22
|
+
trigonometry_util_1.DyFM_Trigonometry.getClampByClampAndHypotenuse(12, 10);
|
|
23
|
+
}).toThrowError('getClampByClampAndHypotenuse error hypotenuse is smaller than clamp (a:12 > c:10)');
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
describe('getHypotenuse', () => {
|
|
27
|
+
it('should calculate the hypotenuse using two clamps', () => {
|
|
28
|
+
const result = trigonometry_util_1.DyFM_Trigonometry.getHypotenuse(3, 4);
|
|
29
|
+
expect(result).toBeCloseTo(5, 0);
|
|
30
|
+
});
|
|
31
|
+
it('should use an isosceles triangle if the second clamp is not provided', () => {
|
|
32
|
+
const result = trigonometry_util_1.DyFM_Trigonometry.getHypotenuse(3);
|
|
33
|
+
expect(result).toBeCloseTo(4.243, 3);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
describe('angleToRadians', () => {
|
|
37
|
+
it('should convert degrees to radians', () => {
|
|
38
|
+
const result = trigonometry_util_1.DyFM_Trigonometry.angleToRadians(180);
|
|
39
|
+
expect(result).toBeCloseTo(Math.PI, 5);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
describe('radiansToAngle', () => {
|
|
43
|
+
it('should convert radians to degrees', () => {
|
|
44
|
+
const result = trigonometry_util_1.DyFM_Trigonometry.radiansToAngle(Math.PI);
|
|
45
|
+
expect(result).toBeCloseTo(180, 5);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=trigonometry.util.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigonometry.util.spec.js","sourceRoot":"","sources":["../../../../src/_collections/utils/math/trigonometry.util.spec.ts"],"names":[],"mappings":";;AACA,2DAAwD;AAExD,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAEjC,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;QACxB,EAAE,CAAC,2DAA2D,EAAE,GAAG,EAAE;YACnE,MAAM,MAAM,GAAG,qCAAiB,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;YAClD,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,kEAAkE,EAAE,GAAG,EAAE;YAC1E,MAAM,MAAM,GAAG,qCAAiB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;YAC9C,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;QAC5C,EAAE,CAAC,mEAAmE,EAAE,GAAG,EAAE;YAC3E,MAAM,MAAM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AQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;QAC9B,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;YAC3C,MAAM,MAAM,GAAG,qCAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACzD,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AAEL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vector2.util.spec.d.ts","sourceRoot":"","sources":["../../../../src/_collections/utils/math/vector2.util.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vector2_util_1 = require("./vector2.util");
|
|
4
|
+
describe('DyFM_Vector2_Util', () => {
|
|
5
|
+
it('should create an instance with default values', () => {
|
|
6
|
+
const vector = new vector2_util_1.DyFM_Vector2_Util();
|
|
7
|
+
expect(vector.x).toBe(0);
|
|
8
|
+
expect(vector.y).toBe(0);
|
|
9
|
+
expect(vector.magintude).toBe(0);
|
|
10
|
+
});
|
|
11
|
+
it('should create an instance with given x and y values', () => {
|
|
12
|
+
const vector = new vector2_util_1.DyFM_Vector2_Util(3, 4);
|
|
13
|
+
expect(vector.x).toBe(3);
|
|
14
|
+
expect(vector.y).toBe(4);
|
|
15
|
+
expect(vector.magintude).toBe(5);
|
|
16
|
+
});
|
|
17
|
+
it('should create an instance with a DyFM_Vector2 object', () => {
|
|
18
|
+
const vector = new vector2_util_1.DyFM_Vector2_Util({ x: 1, y: 2 });
|
|
19
|
+
expect(vector.x).toBe(1);
|
|
20
|
+
expect(vector.y).toBe(2);
|
|
21
|
+
expect(vector.magintude).toBeCloseTo(Math.sqrt(5));
|
|
22
|
+
});
|
|
23
|
+
it('should calculate distance between two vectors', () => {
|
|
24
|
+
const a = { x: 0, y: 0 };
|
|
25
|
+
const b = { x: 3, y: 4 };
|
|
26
|
+
const distance = vector2_util_1.DyFM_Vector2_Util.distance(a, b);
|
|
27
|
+
expect(distance).toBe(5);
|
|
28
|
+
});
|
|
29
|
+
it('should add two vectors', () => {
|
|
30
|
+
const a = { x: 1, y: 2 };
|
|
31
|
+
const b = { x: 3, y: 4 };
|
|
32
|
+
const result = vector2_util_1.DyFM_Vector2_Util.plus(a, b);
|
|
33
|
+
expect(result.x).toBe(4);
|
|
34
|
+
expect(result.y).toBe(6);
|
|
35
|
+
});
|
|
36
|
+
it('should subtract two vectors', () => {
|
|
37
|
+
const a = { x: 5, y: 6 };
|
|
38
|
+
const b = { x: 3, y: 4 };
|
|
39
|
+
const result = vector2_util_1.DyFM_Vector2_Util.minus(a, b);
|
|
40
|
+
expect(result.x).toBe(2);
|
|
41
|
+
expect(result.y).toBe(2);
|
|
42
|
+
});
|
|
43
|
+
it('should multiply a vector by a scalar', () => {
|
|
44
|
+
const vector = { x: 2, y: 3 };
|
|
45
|
+
const result = vector2_util_1.DyFM_Vector2_Util.multiply(vector, 2);
|
|
46
|
+
expect(result.x).toBe(4);
|
|
47
|
+
expect(result.y).toBe(6);
|
|
48
|
+
});
|
|
49
|
+
it('should divide a vector by a scalar', () => {
|
|
50
|
+
const vector = { x: 4, y: 6 };
|
|
51
|
+
const result = vector2_util_1.DyFM_Vector2_Util.divide(vector, 2);
|
|
52
|
+
expect(result.x).toBe(2);
|
|
53
|
+
expect(result.y).toBe(3);
|
|
54
|
+
});
|
|
55
|
+
it('should negate a vector', () => {
|
|
56
|
+
const vector = { x: 3, y: 4 };
|
|
57
|
+
const result = vector2_util_1.DyFM_Vector2_Util.negative(vector);
|
|
58
|
+
expect(result.x).toBe(-3);
|
|
59
|
+
expect(result.y).toBe(-4);
|
|
60
|
+
});
|
|
61
|
+
it('should normalize a vector', () => {
|
|
62
|
+
const vector = { x: 3, y: 4 };
|
|
63
|
+
const result = vector2_util_1.DyFM_Vector2_Util.normalize(vector);
|
|
64
|
+
expect(result.magintude).toBeCloseTo(1);
|
|
65
|
+
});
|
|
66
|
+
it('should clone a vector', () => {
|
|
67
|
+
const vector = { x: 3, y: 4 };
|
|
68
|
+
const clone = vector2_util_1.DyFM_Vector2_Util.clone(vector);
|
|
69
|
+
expect(clone).toEqual(vector);
|
|
70
|
+
});
|
|
71
|
+
it('should check if two vectors are equal', () => {
|
|
72
|
+
const a = { x: 3, y: 4 };
|
|
73
|
+
const b = { x: 3, y: 4 };
|
|
74
|
+
expect(vector2_util_1.DyFM_Vector2_Util.isEqual(a, b)).toBeTrue();
|
|
75
|
+
});
|
|
76
|
+
it('should check if two vectors are not equal', () => {
|
|
77
|
+
const a = { x: 3, y: 4 };
|
|
78
|
+
const b = { x: 5, y: 6 };
|
|
79
|
+
expect(vector2_util_1.DyFM_Vector2_Util.isEqual(a, b)).toBeFalse();
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
//# sourceMappingURL=vector2.util.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vector2.util.spec.js","sourceRoot":"","sources":["../../../../src/_collections/utils/math/vector2.util.spec.ts"],"names":[],"mappings":";;AACA,iDAA8D;AAG9D,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,MAAM,MAAM,GAAG,IAAI,gCAAiB,EAAE,CAAC;QACvC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACzB,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACzB,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;QAC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C,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QAC5C,MAAM,KAAK,GAAG,gCAAiB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC9C,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC/C,MAAM,CAAC,GAAiB,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QACvC,MAAM,CAAC,GAAiB,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QACvC,MAAM,CAAC,gCAAiB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACnD,MAAM,CAAC,GAAiB,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QACvC,MAAM,CAAC,GAAiB,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QACvC,MAAM,CAAC,gCAAiB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password-regex.util.spec.d.ts","sourceRoot":"","sources":["../../../../src/_collections/utils/regex/password-regex.util.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const password_regex_util_1 = require("./password-regex.util");
|
|
4
|
+
describe('DyFM_getPasswordErrors', () => {
|
|
5
|
+
it('should return an empty array for a valid password', () => {
|
|
6
|
+
const password = 'Valid1!';
|
|
7
|
+
const result = (0, password_regex_util_1.DyFM_getPasswordErrors)(password);
|
|
8
|
+
expect(result).toEqual([]);
|
|
9
|
+
});
|
|
10
|
+
it('should return an error for missing lowercase letter', () => {
|
|
11
|
+
const password = 'INVALID1!';
|
|
12
|
+
const result = (0, password_regex_util_1.DyFM_getPasswordErrors)(password);
|
|
13
|
+
expect(result).toContain('Password must include at least one lowercase letter.');
|
|
14
|
+
});
|
|
15
|
+
it('should return an error for missing uppercase letter', () => {
|
|
16
|
+
const password = 'invalid1!';
|
|
17
|
+
const result = (0, password_regex_util_1.DyFM_getPasswordErrors)(password);
|
|
18
|
+
expect(result).toContain('Password must include at least one uppercase letter.');
|
|
19
|
+
});
|
|
20
|
+
it('should return an error for missing digit', () => {
|
|
21
|
+
const password = 'Invalid!';
|
|
22
|
+
const result = (0, password_regex_util_1.DyFM_getPasswordErrors)(password);
|
|
23
|
+
expect(result).toContain('Password must include at least one digit.');
|
|
24
|
+
});
|
|
25
|
+
it('should return an error for missing special character', () => {
|
|
26
|
+
const password = 'Invalid1';
|
|
27
|
+
const result = (0, password_regex_util_1.DyFM_getPasswordErrors)(password);
|
|
28
|
+
expect(result).toContain('Password must include at least one of the !@#$%^&* characters.');
|
|
29
|
+
});
|
|
30
|
+
it('should return an error for password length less than 6', () => {
|
|
31
|
+
const password = 'Inv1!';
|
|
32
|
+
const result = (0, password_regex_util_1.DyFM_getPasswordErrors)(password);
|
|
33
|
+
expect(result).toContain('Password must be at least 6 characters long.');
|
|
34
|
+
});
|
|
35
|
+
it('should return multiple errors for a completely invalid password', () => {
|
|
36
|
+
const password = 'inv';
|
|
37
|
+
const result = (0, password_regex_util_1.DyFM_getPasswordErrors)(password);
|
|
38
|
+
expect(result).toContain('Password must include at least one uppercase letter.');
|
|
39
|
+
expect(result).toContain('Password must include at least one digit.');
|
|
40
|
+
expect(result).toContain('Password must include at least one of the !@#$%^&* characters.');
|
|
41
|
+
expect(result).toContain('Password must be at least 6 characters long.');
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=password-regex.util.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password-regex.util.spec.js","sourceRoot":"","sources":["../../../../src/_collections/utils/regex/password-regex.util.spec.ts"],"names":[],"mappings":";;AACA,+DAA+D;AAE/D,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IAEtC,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,MAAM,QAAQ,GAAG,SAAS,CAAC;QAC3B,MAAM,MAAM,GAAG,IAAA,4CAAsB,EAAC,QAAQ,CAAC,CAAC;QAChD,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;QAC7D,MAAM,QAAQ,GAAG,WAAW,CAAC;QAC7B,MAAM,MAAM,GAAG,IAAA,4CAAsB,EAAC,QAAQ,CAAC,CAAC;QAChD,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,sDAAsD,CAAC,CAAC;IACnF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;QAC7D,MAAM,QAAQ,GAAG,WAAW,CAAC;QAC7B,MAAM,MAAM,GAAG,IAAA,4CAAsB,EAAC,QAAQ,CAAC,CAAC;QAChD,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,sDAAsD,CAAC,CAAC;IACnF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,MAAM,QAAQ,GAAG,UAAU,CAAC;QAC5B,MAAM,MAAM,GAAG,IAAA,4CAAsB,EAAC,QAAQ,CAAC,CAAC;QAChD,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,2CAA2C,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;QAC9D,MAAM,QAAQ,GAAG,UAAU,CAAC;QAC5B,MAAM,MAAM,GAAG,IAAA,4CAAsB,EAAC,QAAQ,CAAC,CAAC;QAChD,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,gEAAgE,CAAC,CAAC;IAC7F,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wDAAwD,EAAE,GAAG,EAAE;QAChE,MAAM,QAAQ,GAAG,OAAO,CAAC;QACzB,MAAM,MAAM,GAAG,IAAA,4CAAsB,EAAC,QAAQ,CAAC,CAAC;QAChD,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,8CAA8C,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iEAAiE,EAAE,GAAG,EAAE;QACzE,MAAM,QAAQ,GAAG,KAAK,CAAC;QACvB,MAAM,MAAM,GAAG,IAAA,4CAAsB,EAAC,QAAQ,CAAC,CAAC;QAChD,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,sDAAsD,CAAC,CAAC;QACjF,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,2CAA2C,CAAC,CAAC;QACtE,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,gEAAgE,CAAC,CAAC;QAC3F,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,8CAA8C,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;AAEL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regex.util.spec.d.ts","sourceRoot":"","sources":["../../../../src/_collections/utils/regex/regex.util.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const regex_util_1 = require("./regex.util");
|
|
4
|
+
describe('DyFM_emailRegex', () => {
|
|
5
|
+
it('should match valid email addresses', () => {
|
|
6
|
+
const validEmails = [
|
|
7
|
+
'test@example.com',
|
|
8
|
+
'user.name+tag+sorting@example.com',
|
|
9
|
+
'user_name@example.co.uk',
|
|
10
|
+
'user-name@example.org',
|
|
11
|
+
'user123@example.museum',
|
|
12
|
+
'user@example.travel',
|
|
13
|
+
'user@example.mobi',
|
|
14
|
+
'user@example.info',
|
|
15
|
+
'user@example.jobs'
|
|
16
|
+
];
|
|
17
|
+
validEmails.forEach(email => {
|
|
18
|
+
expect(regex_util_1.DyFM_emailRegex.test(email)).toBeTrue();
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
xit('should not match invalid email addresses', () => {
|
|
22
|
+
const invalidEmails = [
|
|
23
|
+
'plainaddress',
|
|
24
|
+
'@missingusername.com',
|
|
25
|
+
'username@.com',
|
|
26
|
+
'username@com',
|
|
27
|
+
'username@.com.',
|
|
28
|
+
'username@-example.com',
|
|
29
|
+
'username@example..com',
|
|
30
|
+
'username@example.c',
|
|
31
|
+
'username@.example.com',
|
|
32
|
+
'username@.example.com.',
|
|
33
|
+
'username@.example..com'
|
|
34
|
+
];
|
|
35
|
+
invalidEmails.forEach(email => {
|
|
36
|
+
expect(regex_util_1.DyFM_emailRegex.test(email)).toBeFalse();
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=regex.util.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regex.util.spec.js","sourceRoot":"","sources":["../../../../src/_collections/utils/regex/regex.util.spec.ts"],"names":[],"mappings":";;AACA,6CAA+C;AAE/C,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,WAAW,GAAa;YAC5B,kBAAkB;YAClB,mCAAmC;YACnC,yBAAyB;YACzB,uBAAuB;YACvB,wBAAwB;YACxB,qBAAqB;YACrB,mBAAmB;YACnB,mBAAmB;YACnB,mBAAmB;SACpB,CAAC;QAEF,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAC1B,MAAM,CAAC,4BAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QACjD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,GAAG,CAAC,0CAA0C,EAAE,GAAG,EAAE;QACnD,MAAM,aAAa,GAAa;YAC9B,cAAc;YACd,sBAAsB;YACtB,eAAe;YACf,cAAc;YACd,gBAAgB;YAChB,uBAAuB;YACvB,uBAAuB;YACvB,oBAAoB;YACpB,uBAAuB;YACvB,wBAAwB;YACxB,wBAAwB;SACzB,CAAC;QAEF,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAC5B,MAAM,CAAC,4BAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"username-regex.util.spec.d.ts","sourceRoot":"","sources":["../../../../src/_collections/utils/regex/username-regex.util.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const username_regex_util_1 = require("./username-regex.util");
|
|
4
|
+
describe('DyFM_usernameRegex', () => {
|
|
5
|
+
it('should match valid usernames', () => {
|
|
6
|
+
const validUsernames = [
|
|
7
|
+
'abcdef',
|
|
8
|
+
'123456',
|
|
9
|
+
'abc123',
|
|
10
|
+
'abc-123',
|
|
11
|
+
'abc_123',
|
|
12
|
+
'abc#123',
|
|
13
|
+
'abc$123',
|
|
14
|
+
'abc%123',
|
|
15
|
+
'abc&123',
|
|
16
|
+
'abc^123',
|
|
17
|
+
'abc|123',
|
|
18
|
+
'abc*123',
|
|
19
|
+
'abc-_$#%&^|*'
|
|
20
|
+
];
|
|
21
|
+
validUsernames.forEach(username => {
|
|
22
|
+
expect(username_regex_util_1.DyFM_usernameRegex.test(username)).toBeTrue();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
it('should not match invalid usernames', () => {
|
|
26
|
+
const invalidUsernames = [
|
|
27
|
+
'abc', // less than 6 characters
|
|
28
|
+
'abc!', // invalid special character
|
|
29
|
+
'abc@123', // invalid special character
|
|
30
|
+
'abc 123', // space is not allowed
|
|
31
|
+
'abc/123', // invalid special character
|
|
32
|
+
'abc\\123', // invalid special character
|
|
33
|
+
'abc+123', // invalid special character
|
|
34
|
+
'abc=123', // invalid special character
|
|
35
|
+
'abc,123', // invalid special character
|
|
36
|
+
'abc.123', // invalid special character
|
|
37
|
+
'abc:123', // invalid special character
|
|
38
|
+
'abc;123', // invalid special character
|
|
39
|
+
'abc<123', // invalid special character
|
|
40
|
+
'abc>123', // invalid special character
|
|
41
|
+
'abc?123', // invalid special character
|
|
42
|
+
'abc@123', // invalid special character
|
|
43
|
+
'abc[123', // invalid special character
|
|
44
|
+
'abc]123', // invalid special character
|
|
45
|
+
'abc{123', // invalid special character
|
|
46
|
+
'abc}123', // invalid special character
|
|
47
|
+
'abc(123', // invalid special character
|
|
48
|
+
'abc)123', // invalid special character
|
|
49
|
+
'abc~123', // invalid special character
|
|
50
|
+
'abc`123', // invalid special character
|
|
51
|
+
'abc"123', // invalid special character
|
|
52
|
+
'abc\'123', // invalid special character
|
|
53
|
+
];
|
|
54
|
+
invalidUsernames.forEach(username => {
|
|
55
|
+
expect(username_regex_util_1.DyFM_usernameRegex.test(username)).toBeFalse();
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=username-regex.util.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"username-regex.util.spec.js","sour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4BAA4B;YAC5C,SAAS,EAAO,4BAA4B;YAC5C,SAAS,EAAO,4BAA4B;YAC5C,UAAU,EAAM,4BAA4B;SAC7C,CAAC;QAEF,gBAAgB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAClC,MAAM,CAAC,wCAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;QACxD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"round-list.util.d.ts","sourceRoot":"","sources":["../../../src/_collections/utils/round-list.util.ts"],"names":[],"mappings":"AAIA,qBAAa,cAAc;IACzB,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM;IAiB5E,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM;IAOnE,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,aAAa,EAAE,MAAM,GAAG,CAAC;IAI3D,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC;IAItD,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"round-list.util.d.ts","sourceRoot":"","sources":["../../../src/_collections/utils/round-list.util.ts"],"names":[],"mappings":"AAIA,qBAAa,cAAc;IACzB,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM;IAiB5E,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM;IAOnE,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,aAAa,EAAE,MAAM,GAAG,CAAC;IAI3D,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC;IAItD,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC;CAoDhC"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DyFM_RoundList = void 0;
|
|
4
4
|
class DyFM_RoundList {
|
|
5
5
|
static getOutboundedIndex(listLength, outboundIndex) {
|
|
6
|
-
if (!
|
|
6
|
+
if (!listLength) {
|
|
7
7
|
throw new Error('roundListPlusIndex failed. list is empty!');
|
|
8
8
|
}
|
|
9
9
|
if (outboundIndex < 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"round-list.util.js","sourceRoot":"","sources":["../../../src/_collections/utils/round-list.util.ts"],"names":[],"mappings":";;;AAIA,MAAa,cAAc;IACzB,MAAM,CAAC,kBAAkB,CAAC,UAAkB,EAAE,aAAqB;QACjE,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"round-list.util.js","sourceRoot":"","sources":["../../../src/_collections/utils/round-list.util.ts"],"names":[],"mappings":";;;AAIA,MAAa,cAAc;IACzB,MAAM,CAAC,kBAAkB,CAAC,UAAkB,EAAE,aAAqB;QACjE,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC/D,CAAC;QAED,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;YACtB,aAAa,GAAG,aAAa,GAAG,UAAU,CAAC;YAC3C,aAAa,GAAG,UAAU,GAAG,aAAa,CAAC;QAC7C,CAAC;QAED,IAAI,UAAU,IAAI,aAAa,EAAE,CAAC;YAChC,aAAa,GAAG,aAAa,GAAG,UAAU,CAAC;QAC7C,CAAC;QAED,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,gBAAgB,CAAC,MAAc,EAAE,UAAkB;QACxD,MAAM,SAAS,GAAG,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACtD,MAAM,GAAG,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAEvD,OAAO,GAAG,CAAC;IACb,CAAC;IAED,MAAM,CAAC,YAAY,CAAI,IAAS,EAAE,aAAqB;QACrD,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC;IACnE,CAAC;IAED,MAAM,CAAC,eAAe,CAAI,IAAS,EAAE,UAAa;QAChD,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC5E,CAAC;IAED,MAAM,CAAC,OAAO,CAAI,IAAS;QACzB,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YACpB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC/B,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;CA8CF;AArFD,wCAqFC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"round-list.util.spec.d.ts","sourceRoot":"","sources":["../../../src/_collections/utils/round-list.util.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const round_list_util_1 = require("./round-list.util");
|
|
4
|
+
describe('DyFM_RoundList', () => {
|
|
5
|
+
describe('getOutboundedIndex', () => {
|
|
6
|
+
it('should throw an error if listLength is 0', () => {
|
|
7
|
+
expect(() => round_list_util_1.DyFM_RoundList.getOutboundedIndex(0, 5)).toThrowError('roundListPlusIndex failed. list is empty!');
|
|
8
|
+
});
|
|
9
|
+
it('should return correct index for positive outboundIndex within bounds', () => {
|
|
10
|
+
expect(round_list_util_1.DyFM_RoundList.getOutboundedIndex(5, 3)).toBe(3);
|
|
11
|
+
});
|
|
12
|
+
it('should return correct index for positive outboundIndex out of bounds', () => {
|
|
13
|
+
expect(round_list_util_1.DyFM_RoundList.getOutboundedIndex(5, 7)).toBe(2);
|
|
14
|
+
});
|
|
15
|
+
it('should return correct index for negative outboundIndex', () => {
|
|
16
|
+
expect(round_list_util_1.DyFM_RoundList.getOutboundedIndex(5, -2)).toBe(3);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
describe('getIndexOpposite', () => {
|
|
20
|
+
it('should return the opposite index in a circular manner', () => {
|
|
21
|
+
expect(round_list_util_1.DyFM_RoundList.getIndexOpposite(8, 7)).toBe(3);
|
|
22
|
+
});
|
|
23
|
+
it('should handle even length arrays correctly', () => {
|
|
24
|
+
expect(round_list_util_1.DyFM_RoundList.getIndexOpposite(4, 1)).toBe(3);
|
|
25
|
+
});
|
|
26
|
+
it('should handle odd length arrays correctly', () => {
|
|
27
|
+
expect(round_list_util_1.DyFM_RoundList.getIndexOpposite(5, 2)).toBe(0);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
describe('getListIndex', () => {
|
|
31
|
+
it('should return the correct element for a given outboundIndex', () => {
|
|
32
|
+
const list = ['a', 'b', 'c', 'd'];
|
|
33
|
+
expect(round_list_util_1.DyFM_RoundList.getListIndex(list, 5)).toBe('b');
|
|
34
|
+
});
|
|
35
|
+
it('should handle negative outboundIndex', () => {
|
|
36
|
+
const list = ['a', 'b', 'c', 'd'];
|
|
37
|
+
expect(round_list_util_1.DyFM_RoundList.getListIndex(list, -1)).toBe('d');
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
describe('getListOpposite', () => {
|
|
41
|
+
it('should return the opposite element in a circular manner', () => {
|
|
42
|
+
const list = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'];
|
|
43
|
+
expect(round_list_util_1.DyFM_RoundList.getListOpposite(list, 'h')).toBe('d');
|
|
44
|
+
});
|
|
45
|
+
it('should handle even length lists correctly', () => {
|
|
46
|
+
const list = ['a', 'b', 'c', 'd'];
|
|
47
|
+
expect(round_list_util_1.DyFM_RoundList.getListOpposite(list, 'b')).toBe('d');
|
|
48
|
+
});
|
|
49
|
+
it('should handle odd length lists correctly', () => {
|
|
50
|
+
const list = ['a', 'b', 'c', 'd', 'e'];
|
|
51
|
+
expect(round_list_util_1.DyFM_RoundList.getListOpposite(list, 'c')).toBe('a');
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
describe('getLast', () => {
|
|
55
|
+
it('should return the last element of the list', () => {
|
|
56
|
+
const list = ['a', 'b', 'c'];
|
|
57
|
+
expect(round_list_util_1.DyFM_RoundList.getLast(list)).toBe('c');
|
|
58
|
+
});
|
|
59
|
+
it('should return null for an empty list', () => {
|
|
60
|
+
const list = [];
|
|
61
|
+
expect(round_list_util_1.DyFM_RoundList.getLast(list)).toBeNull();
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=round-list.util.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"round-list.util.spec.js","sourceRoot":"","sources":["../../../src/_collections/utils/round-list.util.spec.ts"],"names":[],"mappings":";;AACA,uDAAmD;AAEnD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAE9B,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;QAClC,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;YAClD,MAAM,CAAC,GAAG,EAAE,CAAC,gCAAc,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,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