@futdevpro/fsm-dynamo 1.10.36 → 1.10.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/_collections/utils/array.util.spec.js +34 -34
- package/build/_collections/utils/array.util.spec.js.map +1 -1
- package/build/_collections/utils/log.util.spec.js +12 -12
- package/build/_collections/utils/log.util.spec.js.map +1 -1
- package/build/_collections/utils/math/box-bounds.spec.js +11 -11
- package/build/_collections/utils/math/box-bounds.spec.js.map +1 -1
- package/build/_collections/utils/math/box-bounds.util.spec.js +8 -8
- package/build/_collections/utils/math/box-bounds.util.spec.js.map +1 -1
- package/build/_collections/utils/math/math.util.spec.js +24 -24
- package/build/_collections/utils/math/math.util.spec.js.map +1 -1
- package/build/_collections/utils/math/random.util.spec.js +13 -13
- package/build/_collections/utils/math/random.util.spec.js.map +1 -1
- package/build/_collections/utils/math/trigonometry.util.spec.js +13 -13
- package/build/_collections/utils/math/trigonometry.util.spec.js.map +1 -1
- package/build/_collections/utils/math/vector2.util.spec.js +14 -14
- package/build/_collections/utils/math/vector2.util.spec.js.map +1 -1
- package/build/_collections/utils/regex/password-regex.util.spec.js +8 -8
- package/build/_collections/utils/regex/password-regex.util.spec.js.map +1 -1
- package/build/_collections/utils/regex/regex.util.spec.js +2 -2
- package/build/_collections/utils/regex/regex.util.spec.js.map +1 -1
- package/build/_collections/utils/regex/username-regex.util.spec.js +3 -3
- package/build/_collections/utils/regex/username-regex.util.spec.js.map +1 -1
- package/build/_collections/utils/round-list.util.spec.js +20 -20
- package/build/_collections/utils/round-list.util.spec.js.map +1 -1
- package/build/_collections/utils/shared.util.spec.js +15 -15
- package/build/_collections/utils/shared.util.spec.js.map +1 -1
- package/build/_collections/utils/string.util.spec.js +9 -9
- package/build/_collections/utils/string.util.spec.js.map +1 -1
- package/build/_collections/utils/time.util.spec.js +1 -1
- package/build/_collections/utils/time.util.spec.js.map +1 -1
- package/build/_collections/utils/type-cloning-facility.util.spec.js +5 -5
- package/build/_collections/utils/type-cloning-facility.util.spec.js.map +1 -1
- package/build/_collections/utils/utilities.util.spec.js +35 -35
- package/build/_collections/utils/utilities.util.spec.js.map +1 -1
- package/build/_collections/utils/uuid.util.spec.js +6 -6
- package/build/_collections/utils/uuid.util.spec.js.map +1 -1
- package/build/_models/control-models/data-model-params.control-model.spec.js +6 -6
- package/build/_models/control-models/data-model-params.control-model.spec.js.map +1 -1
- package/build/_models/control-models/data-property-params.control-model.spec.js +2 -2
- package/build/_models/control-models/data-property-params.control-model.spec.js.map +1 -1
- package/build/_models/control-models/error.control-model.spec.js +157 -157
- package/build/_models/control-models/error.control-model.spec.js.map +1 -1
- package/build/_models/control-models/poll.control-model.spec.js +2 -2
- package/build/_models/control-models/poll.control-model.spec.js.map +1 -1
- package/build/_models/control-models/range-value.control-model.spec.js +27 -27
- package/build/_models/control-models/range-value.control-model.spec.js.map +1 -1
- package/build/_modules/crypto/_collections/crypto.util.spec.js +31 -31
- package/build/_modules/crypto/_collections/crypto.util.spec.js.map +1 -1
- package/build/_modules/custom-data/_models/cud.data-model.spec.js +7 -7
- package/build/_modules/custom-data/_models/cud.data-model.spec.js.map +1 -1
- package/build/_modules/location/_collections/loc-regions.util.spec.js +10 -10
- package/build/_modules/location/_collections/loc-regions.util.spec.js.map +1 -1
- package/build/_modules/location/_collections/loc.util.spec.js +6 -6
- package/build/_modules/location/_collections/loc.util.spec.js.map +1 -1
- package/build/_modules/pipe/_collections/utils/pip-country-pipe.util.spec.js +6 -6
- package/build/_modules/pipe/_collections/utils/pip-country-pipe.util.spec.js.map +1 -1
- package/build/_modules/pipe/_collections/utils/pip-custom-pipe.util.spec.js +6 -6
- package/build/_modules/pipe/_collections/utils/pip-custom-pipe.util.spec.js.map +1 -1
- package/build/_modules/pipe/_collections/utils/pip-division-pipe.util.spec.js +6 -6
- package/build/_modules/pipe/_collections/utils/pip-division-pipe.util.spec.js.map +1 -1
- package/build/_modules/pipe/_collections/utils/pip-list-pipe.util.spec.js +6 -6
- package/build/_modules/pipe/_collections/utils/pip-list-pipe.util.spec.js.map +1 -1
- package/build/_modules/pipe/_collections/utils/pip-multi-pipe-pipe.util.spec.js +8 -8
- package/build/_modules/pipe/_collections/utils/pip-multi-pipe-pipe.util.spec.js.map +1 -1
- package/build/_modules/pipe/_collections/utils/pip-obj-key-pipe.util.spec.js +5 -5
- package/build/_modules/pipe/_collections/utils/pip-obj-key-pipe.util.spec.js.map +1 -1
- package/build/_modules/pipe/_collections/utils/pip-range-pipe.util.spec.js +8 -8
- package/build/_modules/pipe/_collections/utils/pip-range-pipe.util.spec.js.map +1 -1
- package/build/_modules/pipe/_collections/utils/pip-region-pipe.util.spec.js +4 -4
- package/build/_modules/pipe/_collections/utils/pip-region-pipe.util.spec.js.map +1 -1
- package/build/_modules/pipe/_collections/utils/pip-replace-pipe.util.spec.js +9 -9
- package/build/_modules/pipe/_collections/utils/pip-replace-pipe.util.spec.js.map +1 -1
- package/build/_modules/pipe/_collections/utils/pip-slider-pipe.util.spec.js +4 -4
- package/build/_modules/pipe/_collections/utils/pip-slider-pipe.util.spec.js.map +1 -1
- package/build/_modules/pipe/_collections/utils/pip-smart-replace-pipe.util.spec.js +7 -7
- package/build/_modules/pipe/_collections/utils/pip-smart-replace-pipe.util.spec.js.map +1 -1
- package/build/_modules/socket/_models/sck-client-params.control-model.spec.js +5 -5
- package/build/_modules/socket/_models/sck-client-params.control-model.spec.js.map +1 -1
- package/build/_modules/socket/_models/sck-socket-event.control-model.spec.js +5 -5
- package/build/_modules/socket/_models/sck-socket-event.control-model.spec.js.map +1 -1
- package/build/_modules/socket/_services/sck-client.service-base.spec.js +7 -7
- package/build/_modules/socket/_services/sck-client.service-base.spec.js.map +1 -1
- package/build/_modules/usage/_models/usg-action.control-model.spec.js +4 -4
- package/build/_modules/usage/_models/usg-action.control-model.spec.js.map +1 -1
- package/build/_modules/usage/_models/usg-daily-usage-data.control-model.spec.js +3 -3
- package/build/_modules/usage/_models/usg-daily-usage-data.control-model.spec.js.map +1 -1
- package/build/_modules/usage/_models/usg-data.control-model.spec.js +4 -4
- package/build/_modules/usage/_models/usg-data.control-model.spec.js.map +1 -1
- package/build/_modules/usage/_models/usg-session.data-model.spec.js +7 -7
- package/build/_modules/usage/_models/usg-session.data-model.spec.js.map +1 -1
- package/futdevpro-fsm-dynamo-01.10.37.tgz +0 -0
- package/package.json +1 -1
- package/src/_collections/utils/array.util.spec.ts +34 -34
- package/src/_collections/utils/log.util.spec.ts +12 -12
- package/src/_collections/utils/math/box-bounds.spec.ts +11 -11
- package/src/_collections/utils/math/box-bounds.util.spec.ts +8 -8
- package/src/_collections/utils/math/math.util.spec.ts +24 -24
- package/src/_collections/utils/math/random.util.spec.ts +13 -13
- package/src/_collections/utils/math/trigonometry.util.spec.ts +13 -13
- package/src/_collections/utils/math/vector2.util.spec.ts +14 -14
- package/src/_collections/utils/regex/password-regex.util.spec.ts +8 -8
- package/src/_collections/utils/regex/regex.util.spec.ts +2 -2
- package/src/_collections/utils/regex/username-regex.util.spec.ts +3 -3
- package/src/_collections/utils/round-list.util.spec.ts +20 -20
- package/src/_collections/utils/shared.util.spec.ts +15 -15
- package/src/_collections/utils/string.util.spec.ts +9 -9
- package/src/_collections/utils/time.util.spec.ts +1 -1
- package/src/_collections/utils/type-cloning-facility.util.spec.ts +5 -5
- package/src/_collections/utils/utilities.util.spec.ts +35 -35
- package/src/_collections/utils/uuid.util.spec.ts +6 -6
- package/src/_models/control-models/data-model-params.control-model.spec.ts +6 -6
- package/src/_models/control-models/data-property-params.control-model.spec.ts +2 -2
- package/src/_models/control-models/error.control-model.spec.ts +157 -157
- package/src/_models/control-models/poll.control-model.spec.ts +2 -2
- package/src/_models/control-models/range-value.control-model.spec.ts +27 -27
- package/src/_modules/crypto/_collections/crypto.util.spec.ts +31 -31
- package/src/_modules/custom-data/_models/cud.data-model.spec.ts +7 -7
- package/src/_modules/location/_collections/loc-regions.util.spec.ts +10 -10
- package/src/_modules/location/_collections/loc.util.spec.ts +6 -6
- package/src/_modules/pipe/_collections/utils/pip-country-pipe.util.spec.ts +6 -6
- package/src/_modules/pipe/_collections/utils/pip-custom-pipe.util.spec.ts +6 -6
- package/src/_modules/pipe/_collections/utils/pip-division-pipe.util.spec.ts +6 -6
- package/src/_modules/pipe/_collections/utils/pip-list-pipe.util.spec.ts +6 -6
- package/src/_modules/pipe/_collections/utils/pip-multi-pipe-pipe.util.spec.ts +8 -8
- package/src/_modules/pipe/_collections/utils/pip-obj-key-pipe.util.spec.ts +5 -5
- package/src/_modules/pipe/_collections/utils/pip-range-pipe.util.spec.ts +8 -8
- package/src/_modules/pipe/_collections/utils/pip-region-pipe.util.spec.ts +4 -4
- package/src/_modules/pipe/_collections/utils/pip-replace-pipe.util.spec.ts +9 -9
- package/src/_modules/pipe/_collections/utils/pip-slider-pipe.util.spec.ts +4 -4
- package/src/_modules/pipe/_collections/utils/pip-smart-replace-pipe.util.spec.ts +7 -7
- package/src/_modules/socket/_models/sck-client-params.control-model.spec.ts +5 -5
- package/src/_modules/socket/_models/sck-socket-event.control-model.spec.ts +5 -5
- package/src/_modules/socket/_services/sck-client.service-base.spec.ts +7 -7
- package/src/_modules/usage/_models/usg-action.control-model.spec.ts +4 -4
- package/src/_modules/usage/_models/usg-daily-usage-data.control-model.spec.ts +3 -3
- package/src/_modules/usage/_models/usg-data.control-model.spec.ts +4 -4
- package/src/_modules/usage/_models/usg-session.data-model.spec.ts +7 -7
- package/futdevpro-fsm-dynamo-01.10.36.tgz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"math.util.spec.js","sourceRoot":"","sources":["../../../../src/_collections/utils/math/math.util.spec.ts"],"names":[],"mappings":";;AACA,2CAAwC;AAExC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"math.util.spec.js","sourceRoot":"","sources":["../../../../src/_collections/utils/math/math.util.spec.ts"],"names":[],"mappings":";;AACA,2CAAwC;AAExC,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAE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AQ,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAC5D,MAAM,CAAC,qBAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AAEL,CAAC,CAAC,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
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', () => {
|
|
4
|
+
describe('| DyFM_Random', () => {
|
|
5
|
+
describe('| getRandomWeightedInt', () => {
|
|
6
|
+
it('| should return a weighted random integer within the range', () => {
|
|
7
7
|
const weights = [
|
|
8
8
|
{ chance: 0.1, result: 1 },
|
|
9
9
|
{ chance: 0.3, result: 2 },
|
|
@@ -13,7 +13,7 @@ describe('DyFM_Random', () => {
|
|
|
13
13
|
expect(result).toBeGreaterThanOrEqual(1);
|
|
14
14
|
expect(result).toBeLessThanOrEqual(3);
|
|
15
15
|
});
|
|
16
|
-
it('should normalize weights if their sum is greater than 1', () => {
|
|
16
|
+
it('| should normalize weights if their sum is greater than 1', () => {
|
|
17
17
|
const weights = [
|
|
18
18
|
{ chance: 0.5, result: 1 },
|
|
19
19
|
{ chance: 0.5, result: 2 },
|
|
@@ -23,7 +23,7 @@ describe('DyFM_Random', () => {
|
|
|
23
23
|
expect(result).toBeGreaterThanOrEqual(1);
|
|
24
24
|
expect(result).toBeLessThanOrEqual(3);
|
|
25
25
|
});
|
|
26
|
-
it('should return a random integer within the range if no weights match', () => {
|
|
26
|
+
it('| should return a random integer within the range if no weights match', () => {
|
|
27
27
|
const weights = [
|
|
28
28
|
{ chance: 0, result: 1 },
|
|
29
29
|
{ chance: 0, result: 2 },
|
|
@@ -34,8 +34,8 @@ describe('DyFM_Random', () => {
|
|
|
34
34
|
expect(result).toBeLessThanOrEqual(3);
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
|
-
describe('getRandomInt', () => {
|
|
38
|
-
it('should return a random integer within the specified range', () => {
|
|
37
|
+
describe('| getRandomInt', () => {
|
|
38
|
+
it('| should return a random integer within the specified range', () => {
|
|
39
39
|
const min = 5;
|
|
40
40
|
const max = 10;
|
|
41
41
|
const result = random_util_1.DyFM_Random.getRandomInt(min, max);
|
|
@@ -43,20 +43,20 @@ describe('DyFM_Random', () => {
|
|
|
43
43
|
expect(result).toBeLessThanOrEqual(max);
|
|
44
44
|
});
|
|
45
45
|
});
|
|
46
|
-
describe('getRandomListElement', () => {
|
|
47
|
-
it('should return a random element from the list', () => {
|
|
46
|
+
describe('| getRandomListElement', () => {
|
|
47
|
+
it('| should return a random element from the list', () => {
|
|
48
48
|
const list = [1, 2, 3, 4, 5];
|
|
49
49
|
const result = random_util_1.DyFM_Random.getRandomListElement(list);
|
|
50
50
|
expect(list).toContain(result);
|
|
51
51
|
});
|
|
52
|
-
it('should return null if the list is empty', () => {
|
|
52
|
+
it('| should return null if the list is empty', () => {
|
|
53
53
|
const list = [];
|
|
54
54
|
const result = random_util_1.DyFM_Random.getRandomListElement(list);
|
|
55
55
|
expect(result).toBeNull();
|
|
56
56
|
});
|
|
57
57
|
});
|
|
58
|
-
describe('getRandomWeighted', () => {
|
|
59
|
-
it('should return a weighted random element', () => {
|
|
58
|
+
describe('| getRandomWeighted', () => {
|
|
59
|
+
it('| should return a weighted random element', () => {
|
|
60
60
|
const weights = [
|
|
61
61
|
{ chance: 0.2, result: 'a' },
|
|
62
62
|
{ chance: 0.5, result: 'b' },
|
|
@@ -65,7 +65,7 @@ describe('DyFM_Random', () => {
|
|
|
65
65
|
const result = random_util_1.DyFM_Random.getRandomWeighted(weights);
|
|
66
66
|
expect(['a', 'b', 'c']).toContain(result);
|
|
67
67
|
});
|
|
68
|
-
it('should return null if weights array is empty', () => {
|
|
68
|
+
it('| should return null if weights array is empty', () => {
|
|
69
69
|
const weights = [];
|
|
70
70
|
const result = random_util_1.DyFM_Random.getRandomWeighted(weights);
|
|
71
71
|
expect(result).toBeNull();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"random.util.spec.js","sourceRoot":"","sources":["../../../../src/_collections/utils/math/random.util.spec.ts"],"names":[],"mappings":";;AACA,+CAA4C;AAG5C,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"random.util.spec.js","sourceRoot":"","sources":["../../../../src/_collections/utils/math/random.util.spec.ts"],"names":[],"mappings":";;AACA,+CAA4C;AAG5C,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;QACtC,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;YACpE,MAAM,OAAO,GAAgC;gBAC3C,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE;gBAC1B,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE;gBAC1B,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE;aAC3B,CAAC;YACF,MAAM,MAAM,GAAG,yBAAW,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;YAC/D,MAAM,CAAC,MAAM,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;YACzC,MAAM,CAAC,MAAM,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,2DAA2D,EAAE,GAAG,EAAE;YACnE,MAAM,OAAO,GAAgC;gBAC3C,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE;gBAC1B,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC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,EAAE;YACxD,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"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
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', () => {
|
|
4
|
+
describe('| DyFM_Trigonometry', () => {
|
|
5
|
+
describe('| getClamp', () => {
|
|
6
|
+
it('| should calculate the clamp using the hypotenuse and angle', () => {
|
|
7
7
|
const result = trigonometry_util_1.DyFM_Trigonometry.getClamp(10, 30);
|
|
8
8
|
expect(result).toBeCloseTo(5, 0);
|
|
9
9
|
});
|
|
10
|
-
it('should use a default angle of 45 degrees if no angle is provided', () => {
|
|
10
|
+
it('| should use a default angle of 45 degrees if no angle is provided', () => {
|
|
11
11
|
const result = trigonometry_util_1.DyFM_Trigonometry.getClamp(10);
|
|
12
12
|
expect(result).toBeCloseTo(7.071, 3);
|
|
13
13
|
});
|
|
14
14
|
});
|
|
15
|
-
describe('getClampByClampAndHypotenuse', () => {
|
|
16
|
-
it('should calculate the clamp using another clamp and the hypotenuse', () => {
|
|
15
|
+
describe('| getClampByClampAndHypotenuse', () => {
|
|
16
|
+
it('| should calculate the clamp using another clamp and the hypotenuse', () => {
|
|
17
17
|
const result = trigonometry_util_1.DyFM_Trigonometry.getClampByClampAndHypotenuse(6, 10);
|
|
18
18
|
expect(result).toBeCloseTo(8, 0);
|
|
19
19
|
});
|
|
@@ -23,24 +23,24 @@ describe('DyFM_Trigonometry', () => {
|
|
|
23
23
|
}).toThrowError('getClampByClampAndHypotenuse error hypotenuse is smaller than clamp (a:12 > c:10)');
|
|
24
24
|
});
|
|
25
25
|
});
|
|
26
|
-
describe('getHypotenuse', () => {
|
|
27
|
-
it('should calculate the hypotenuse using two clamps', () => {
|
|
26
|
+
describe('| getHypotenuse', () => {
|
|
27
|
+
it('| should calculate the hypotenuse using two clamps', () => {
|
|
28
28
|
const result = trigonometry_util_1.DyFM_Trigonometry.getHypotenuse(3, 4);
|
|
29
29
|
expect(result).toBeCloseTo(5, 0);
|
|
30
30
|
});
|
|
31
|
-
it('should use an isosceles triangle if the second clamp is not provided', () => {
|
|
31
|
+
it('| should use an isosceles triangle if the second clamp is not provided', () => {
|
|
32
32
|
const result = trigonometry_util_1.DyFM_Trigonometry.getHypotenuse(3);
|
|
33
33
|
expect(result).toBeCloseTo(4.243, 3);
|
|
34
34
|
});
|
|
35
35
|
});
|
|
36
|
-
describe('angleToRadians', () => {
|
|
37
|
-
it('should convert degrees to radians', () => {
|
|
36
|
+
describe('| angleToRadians', () => {
|
|
37
|
+
it('| should convert degrees to radians', () => {
|
|
38
38
|
const result = trigonometry_util_1.DyFM_Trigonometry.angleToRadians(180);
|
|
39
39
|
expect(result).toBeCloseTo(Math.PI, 5);
|
|
40
40
|
});
|
|
41
41
|
});
|
|
42
|
-
describe('radiansToAngle', () => {
|
|
43
|
-
it('should convert radians to degrees', () => {
|
|
42
|
+
describe('| radiansToAngle', () => {
|
|
43
|
+
it('| should convert radians to degrees', () => {
|
|
44
44
|
const result = trigonometry_util_1.DyFM_Trigonometry.radiansToAngle(Math.PI);
|
|
45
45
|
expect(result).toBeCloseTo(180, 5);
|
|
46
46
|
});
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,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vector2_Util', () => {
|
|
5
|
-
it('should create an instance with default values', () => {
|
|
4
|
+
describe('| DyFM_Vector2_Util', () => {
|
|
5
|
+
it('| should create an instance with default values', () => {
|
|
6
6
|
const vector = new vector2_util_1.DyFM_Vector2_Util();
|
|
7
7
|
expect(vector.x).toBe(0);
|
|
8
8
|
expect(vector.y).toBe(0);
|
|
9
9
|
expect(vector.magintude).toBe(0);
|
|
10
10
|
});
|
|
11
|
-
it('should create an instance with given x and y values', () => {
|
|
11
|
+
it('| should create an instance with given x and y values', () => {
|
|
12
12
|
const vector = new vector2_util_1.DyFM_Vector2_Util(3, 4);
|
|
13
13
|
expect(vector.x).toBe(3);
|
|
14
14
|
expect(vector.y).toBe(4);
|
|
15
15
|
expect(vector.magintude).toBe(5);
|
|
16
16
|
});
|
|
17
|
-
it('should create an instance with a DyFM_Vector2 object', () => {
|
|
17
|
+
it('| should create an instance with a DyFM_Vector2 object', () => {
|
|
18
18
|
const vector = new vector2_util_1.DyFM_Vector2_Util({ x: 1, y: 2 });
|
|
19
19
|
expect(vector.x).toBe(1);
|
|
20
20
|
expect(vector.y).toBe(2);
|
|
21
21
|
expect(vector.magintude).toBeCloseTo(Math.sqrt(5));
|
|
22
22
|
});
|
|
23
|
-
it('should calculate distance between two vectors', () => {
|
|
23
|
+
it('| should calculate distance between two vectors', () => {
|
|
24
24
|
const a = { x: 0, y: 0 };
|
|
25
25
|
const b = { x: 3, y: 4 };
|
|
26
26
|
const distance = vector2_util_1.DyFM_Vector2_Util.distance(a, b);
|
|
27
27
|
expect(distance).toBe(5);
|
|
28
28
|
});
|
|
29
|
-
it('should add two vectors', () => {
|
|
29
|
+
it('| should add two vectors', () => {
|
|
30
30
|
const a = { x: 1, y: 2 };
|
|
31
31
|
const b = { x: 3, y: 4 };
|
|
32
32
|
const result = vector2_util_1.DyFM_Vector2_Util.plus(a, b);
|
|
33
33
|
expect(result.x).toBe(4);
|
|
34
34
|
expect(result.y).toBe(6);
|
|
35
35
|
});
|
|
36
|
-
it('should subtract two vectors', () => {
|
|
36
|
+
it('| should subtract two vectors', () => {
|
|
37
37
|
const a = { x: 5, y: 6 };
|
|
38
38
|
const b = { x: 3, y: 4 };
|
|
39
39
|
const result = vector2_util_1.DyFM_Vector2_Util.minus(a, b);
|
|
40
40
|
expect(result.x).toBe(2);
|
|
41
41
|
expect(result.y).toBe(2);
|
|
42
42
|
});
|
|
43
|
-
it('should multiply a vector by a scalar', () => {
|
|
43
|
+
it('| should multiply a vector by a scalar', () => {
|
|
44
44
|
const vector = { x: 2, y: 3 };
|
|
45
45
|
const result = vector2_util_1.DyFM_Vector2_Util.multiply(vector, 2);
|
|
46
46
|
expect(result.x).toBe(4);
|
|
47
47
|
expect(result.y).toBe(6);
|
|
48
48
|
});
|
|
49
|
-
it('should divide a vector by a scalar', () => {
|
|
49
|
+
it('| should divide a vector by a scalar', () => {
|
|
50
50
|
const vector = { x: 4, y: 6 };
|
|
51
51
|
const result = vector2_util_1.DyFM_Vector2_Util.divide(vector, 2);
|
|
52
52
|
expect(result.x).toBe(2);
|
|
53
53
|
expect(result.y).toBe(3);
|
|
54
54
|
});
|
|
55
|
-
it('should negate a vector', () => {
|
|
55
|
+
it('| should negate a vector', () => {
|
|
56
56
|
const vector = { x: 3, y: 4 };
|
|
57
57
|
const result = vector2_util_1.DyFM_Vector2_Util.negative(vector);
|
|
58
58
|
expect(result.x).toBe(-3);
|
|
59
59
|
expect(result.y).toBe(-4);
|
|
60
60
|
});
|
|
61
|
-
it('should normalize a vector', () => {
|
|
61
|
+
it('| should normalize a vector', () => {
|
|
62
62
|
const vector = { x: 3, y: 4 };
|
|
63
63
|
const result = vector2_util_1.DyFM_Vector2_Util.normalize(vector);
|
|
64
64
|
expect(result.magintude).toBeCloseTo(1);
|
|
65
65
|
});
|
|
66
|
-
it('should clone a vector', () => {
|
|
66
|
+
it('| should clone a vector', () => {
|
|
67
67
|
const vector = { x: 3, y: 4 };
|
|
68
68
|
const clone = vector2_util_1.DyFM_Vector2_Util.clone(vector);
|
|
69
69
|
expect(clone).toEqual(vector);
|
|
70
70
|
});
|
|
71
|
-
it('should check if two vectors are equal', () => {
|
|
71
|
+
it('| should check if two vectors are equal', () => {
|
|
72
72
|
const a = { x: 3, y: 4 };
|
|
73
73
|
const b = { x: 3, y: 4 };
|
|
74
74
|
expect(vector2_util_1.DyFM_Vector2_Util.isEqual(a, b)).toBeTrue();
|
|
75
75
|
});
|
|
76
|
-
it('should check if two vectors are not equal', () => {
|
|
76
|
+
it('| should check if two vectors are not equal', () => {
|
|
77
77
|
const a = { x: 3, y: 4 };
|
|
78
78
|
const b = { x: 5, y: 6 };
|
|
79
79
|
expect(vector2_util_1.DyFM_Vector2_Util.isEqual(a, b)).toBeFalse();
|
|
@@ -1 +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,
|
|
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,qBAAqB,EAAE,GAAG,EAAE;IACnC,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;QACzD,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,uDAAuD,EAAE,GAAG,EAAE;QAC/D,MAAM,MAAM,GAAG,IAAI,gCAAiB,CAAC,CAAC,EAAE,CAAC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,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,yCAAyC,EAAE,GAAG,EAAE;QACjD,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,6CAA6C,EAAE,GAAG,EAAE;QACrD,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"}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
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', () => {
|
|
4
|
+
describe('| DyFM_getPasswordErrors', () => {
|
|
5
|
+
it('| should return an empty array for a valid password', () => {
|
|
6
6
|
const password = 'Valid1!';
|
|
7
7
|
const result = (0, password_regex_util_1.DyFM_getPasswordErrors)(password);
|
|
8
8
|
expect(result).toEqual([]);
|
|
9
9
|
});
|
|
10
|
-
it('should return an error for missing lowercase letter', () => {
|
|
10
|
+
it('| should return an error for missing lowercase letter', () => {
|
|
11
11
|
const password = 'INVALID1!';
|
|
12
12
|
const result = (0, password_regex_util_1.DyFM_getPasswordErrors)(password);
|
|
13
13
|
expect(result).toContain('Password must include at least one lowercase letter.');
|
|
14
14
|
});
|
|
15
|
-
it('should return an error for missing uppercase letter', () => {
|
|
15
|
+
it('| should return an error for missing uppercase letter', () => {
|
|
16
16
|
const password = 'invalid1!';
|
|
17
17
|
const result = (0, password_regex_util_1.DyFM_getPasswordErrors)(password);
|
|
18
18
|
expect(result).toContain('Password must include at least one uppercase letter.');
|
|
19
19
|
});
|
|
20
|
-
it('should return an error for missing digit', () => {
|
|
20
|
+
it('| should return an error for missing digit', () => {
|
|
21
21
|
const password = 'Invalid!';
|
|
22
22
|
const result = (0, password_regex_util_1.DyFM_getPasswordErrors)(password);
|
|
23
23
|
expect(result).toContain('Password must include at least one digit.');
|
|
24
24
|
});
|
|
25
|
-
it('should return an error for missing special character', () => {
|
|
25
|
+
it('| should return an error for missing special character', () => {
|
|
26
26
|
const password = 'Invalid1';
|
|
27
27
|
const result = (0, password_regex_util_1.DyFM_getPasswordErrors)(password);
|
|
28
28
|
expect(result).toContain('Password must include at least one of the !@#$%^&* characters.');
|
|
29
29
|
});
|
|
30
|
-
it('should return an error for password length less than 6', () => {
|
|
30
|
+
it('| should return an error for password length less than 6', () => {
|
|
31
31
|
const password = 'Inv1!';
|
|
32
32
|
const result = (0, password_regex_util_1.DyFM_getPasswordErrors)(password);
|
|
33
33
|
expect(result).toContain('Password must be at least 6 characters long.');
|
|
34
34
|
});
|
|
35
|
-
it('should return multiple errors for a completely invalid password', () => {
|
|
35
|
+
it('| should return multiple errors for a completely invalid password', () => {
|
|
36
36
|
const password = 'inv';
|
|
37
37
|
const result = (0, password_regex_util_1.DyFM_getPasswordErrors)(password);
|
|
38
38
|
expect(result).toContain('Password must include at least one uppercase letter.');
|
|
@@ -1 +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,
|
|
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,0BAA0B,EAAE,GAAG,EAAE;IAExC,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;QAC7D,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,uDAAuD,EAAE,GAAG,EAAE;QAC/D,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,uDAAuD,EAAE,GAAG,EAAE;QAC/D,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,4CAA4C,EAAE,GAAG,EAAE;QACpD,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,wDAAwD,EAAE,GAAG,EAAE;QAChE,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,0DAA0D,EAAE,GAAG,EAAE;QAClE,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,mEAAmE,EAAE,GAAG,EAAE;QAC3E,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"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const regex_util_1 = require("./regex.util");
|
|
4
|
-
describe('DyFM_emailRegex', () => {
|
|
5
|
-
it('should match valid email addresses', () => {
|
|
4
|
+
describe('| DyFM_emailRegex', () => {
|
|
5
|
+
it('| should match valid email addresses', () => {
|
|
6
6
|
const validEmails = [
|
|
7
7
|
'test@example.com',
|
|
8
8
|
'user.name+tag+sorting@example.com',
|
|
@@ -1 +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,
|
|
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,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC9C,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"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const username_regex_util_1 = require("./username-regex.util");
|
|
4
|
-
describe('DyFM_usernameRegex', () => {
|
|
5
|
-
it('should match valid usernames', () => {
|
|
4
|
+
describe('| DyFM_usernameRegex', () => {
|
|
5
|
+
it('| should match valid usernames', () => {
|
|
6
6
|
const validUsernames = [
|
|
7
7
|
'abcdef',
|
|
8
8
|
'123456',
|
|
@@ -22,7 +22,7 @@ describe('DyFM_usernameRegex', () => {
|
|
|
22
22
|
expect(username_regex_util_1.DyFM_usernameRegex.test(username)).toBeTrue();
|
|
23
23
|
});
|
|
24
24
|
});
|
|
25
|
-
it('should not match invalid usernames', () => {
|
|
25
|
+
it('| should not match invalid usernames', () => {
|
|
26
26
|
const invalidUsernames = [
|
|
27
27
|
'abc', // less than 6 characters
|
|
28
28
|
'abc!', // invalid special character
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"username-regex.util.spec.js","sourceRoot":"","sources":["../../../../src/_collections/utils/regex/username-regex.util.spec.ts"],"names":[],"mappings":";;AACA,+DAA2D;AAE3D,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"username-regex.util.spec.js","sourceRoot":"","sources":["../../../../src/_collections/utils/regex/username-regex.util.spec.ts"],"names":[],"mappings":";;AACA,+DAA2D;AAE3D,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,MAAM,cAAc,GAAa;YAC/B,QAAQ;YACR,QAAQ;YACR,QAAQ;YACR,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,cAAc;SACf,CAAC;QAEF,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAChC,MAAM,CAAC,wCAAkB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 = require("./round-list.util");
|
|
4
|
-
describe('DyFM_RoundList', () => {
|
|
5
|
-
describe('getOutboundedIndex', () => {
|
|
6
|
-
it('should throw an error if listLength is 0', () => {
|
|
4
|
+
describe('| DyFM_RoundList', () => {
|
|
5
|
+
describe('| getOutboundedIndex', () => {
|
|
6
|
+
it('| should throw an error if listLength is 0', () => {
|
|
7
7
|
expect(() => round_list_util_1.DyFM_RoundList.getOutboundedIndex(0, 5)).toThrowError('roundListPlusIndex failed. list is empty!');
|
|
8
8
|
});
|
|
9
|
-
it('should return correct index for positive outboundIndex within bounds', () => {
|
|
9
|
+
it('| should return correct index for positive outboundIndex within bounds', () => {
|
|
10
10
|
expect(round_list_util_1.DyFM_RoundList.getOutboundedIndex(5, 3)).toBe(3);
|
|
11
11
|
});
|
|
12
|
-
it('should return correct index for positive outboundIndex out of bounds', () => {
|
|
12
|
+
it('| should return correct index for positive outboundIndex out of bounds', () => {
|
|
13
13
|
expect(round_list_util_1.DyFM_RoundList.getOutboundedIndex(5, 7)).toBe(2);
|
|
14
14
|
});
|
|
15
|
-
it('should return correct index for negative outboundIndex', () => {
|
|
15
|
+
it('| should return correct index for negative outboundIndex', () => {
|
|
16
16
|
expect(round_list_util_1.DyFM_RoundList.getOutboundedIndex(5, -2)).toBe(3);
|
|
17
17
|
});
|
|
18
18
|
});
|
|
19
|
-
describe('getIndexOpposite', () => {
|
|
20
|
-
it('should return the opposite index in a circular manner', () => {
|
|
19
|
+
describe('| getIndexOpposite', () => {
|
|
20
|
+
it('| should return the opposite index in a circular manner', () => {
|
|
21
21
|
expect(round_list_util_1.DyFM_RoundList.getIndexOpposite(8, 7)).toBe(3);
|
|
22
22
|
});
|
|
23
|
-
it('should handle even length arrays correctly', () => {
|
|
23
|
+
it('| should handle even length arrays correctly', () => {
|
|
24
24
|
expect(round_list_util_1.DyFM_RoundList.getIndexOpposite(4, 1)).toBe(3);
|
|
25
25
|
});
|
|
26
|
-
it('should handle odd length arrays correctly', () => {
|
|
26
|
+
it('| should handle odd length arrays correctly', () => {
|
|
27
27
|
expect(round_list_util_1.DyFM_RoundList.getIndexOpposite(5, 2)).toBe(0);
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
|
-
describe('getListIndex', () => {
|
|
31
|
-
it('should return the correct element for a given outboundIndex', () => {
|
|
30
|
+
describe('| getListIndex', () => {
|
|
31
|
+
it('| should return the correct element for a given outboundIndex', () => {
|
|
32
32
|
const list = ['a', 'b', 'c', 'd'];
|
|
33
33
|
expect(round_list_util_1.DyFM_RoundList.getListIndex(list, 5)).toBe('b');
|
|
34
34
|
});
|
|
35
|
-
it('should handle negative outboundIndex', () => {
|
|
35
|
+
it('| should handle negative outboundIndex', () => {
|
|
36
36
|
const list = ['a', 'b', 'c', 'd'];
|
|
37
37
|
expect(round_list_util_1.DyFM_RoundList.getListIndex(list, -1)).toBe('d');
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
|
-
describe('getListOpposite', () => {
|
|
41
|
-
it('should return the opposite element in a circular manner', () => {
|
|
40
|
+
describe('| getListOpposite', () => {
|
|
41
|
+
it('| should return the opposite element in a circular manner', () => {
|
|
42
42
|
const list = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'];
|
|
43
43
|
expect(round_list_util_1.DyFM_RoundList.getListOpposite(list, 'h')).toBe('d');
|
|
44
44
|
});
|
|
45
|
-
it('should handle even length lists correctly', () => {
|
|
45
|
+
it('| should handle even length lists correctly', () => {
|
|
46
46
|
const list = ['a', 'b', 'c', 'd'];
|
|
47
47
|
expect(round_list_util_1.DyFM_RoundList.getListOpposite(list, 'b')).toBe('d');
|
|
48
48
|
});
|
|
49
|
-
it('should handle odd length lists correctly', () => {
|
|
49
|
+
it('| should handle odd length lists correctly', () => {
|
|
50
50
|
const list = ['a', 'b', 'c', 'd', 'e'];
|
|
51
51
|
expect(round_list_util_1.DyFM_RoundList.getListOpposite(list, 'c')).toBe('a');
|
|
52
52
|
});
|
|
53
53
|
});
|
|
54
|
-
describe('getLast', () => {
|
|
55
|
-
it('should return the last element of the list', () => {
|
|
54
|
+
describe('| getLast', () => {
|
|
55
|
+
it('| should return the last element of the list', () => {
|
|
56
56
|
const list = ['a', 'b', 'c'];
|
|
57
57
|
expect(round_list_util_1.DyFM_RoundList.getLast(list)).toBe('c');
|
|
58
58
|
});
|
|
59
|
-
it('should return null for an empty list', () => {
|
|
59
|
+
it('| should return null for an empty list', () => {
|
|
60
60
|
const list = [];
|
|
61
61
|
expect(round_list_util_1.DyFM_RoundList.getLast(list)).toBeNull();
|
|
62
62
|
});
|
|
@@ -1 +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,
|
|
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,kBAAkB,EAAE,GAAG,EAAE;IAEhC,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;QACpC,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;YACpD,MAAM,CAAC,GAAG,EAAE,CAAC,gCAAc,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,2CAA2C,CAAC,CAAC;QAClH,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,wEAAwE,EAAE,GAAG,EAAE;YAChF,MAAM,CAAC,gCAAc,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,wEAAwE,EAAE,GAAG,EAAE;YAChF,MAAM,CAAC,gCAAc,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CA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MAAM,IAAI,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;YAC7B,MAAM,CAAC,gCAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;YAChD,MAAM,IAAI,GAAa,EAAE,CAAC;YAC1B,MAAM,CAAC,gCAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AAEL,CAAC,CAAC,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const shared_util_1 = require("./shared.util");
|
|
4
|
-
describe('DyFM_Shared', () => {
|
|
5
|
-
describe('mapObjList', () => {
|
|
6
|
-
it('should remap object list based on given paths', () => {
|
|
4
|
+
describe('| DyFM_Shared', () => {
|
|
5
|
+
describe('| mapObjList', () => {
|
|
6
|
+
it('| should remap object list based on given paths', () => {
|
|
7
7
|
const objList = [
|
|
8
8
|
{
|
|
9
9
|
first: {
|
|
@@ -18,8 +18,8 @@ describe('DyFM_Shared', () => {
|
|
|
18
18
|
expect(result).toEqual(expected);
|
|
19
19
|
});
|
|
20
20
|
});
|
|
21
|
-
describe('getNestedData', () => {
|
|
22
|
-
it('should return nested value from object', () => {
|
|
21
|
+
describe('| getNestedData', () => {
|
|
22
|
+
it('| should return nested value from object', () => {
|
|
23
23
|
const obj = {
|
|
24
24
|
nestLvl1: {
|
|
25
25
|
nestLvl2: {
|
|
@@ -32,7 +32,7 @@ describe('DyFM_Shared', () => {
|
|
|
32
32
|
expect(result).toBe('value');
|
|
33
33
|
});
|
|
34
34
|
});
|
|
35
|
-
describe('nestData', () => {
|
|
35
|
+
describe('| nestData', () => {
|
|
36
36
|
xit('should nest data at specified path', () => {
|
|
37
37
|
const obj = {};
|
|
38
38
|
const path = ['level1', 'level2'];
|
|
@@ -42,8 +42,8 @@ describe('DyFM_Shared', () => {
|
|
|
42
42
|
expect(result).toEqual(expected);
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
|
-
describe('addToNestedData', () => {
|
|
46
|
-
it('should add to nested data at specified path', () => {
|
|
45
|
+
describe('| addToNestedData', () => {
|
|
46
|
+
it('| should add to nested data at specified path', () => {
|
|
47
47
|
const obj = { level1: { level2: 5 } };
|
|
48
48
|
const path = ['level1', 'level2'];
|
|
49
49
|
const valueToAdd = 3;
|
|
@@ -52,8 +52,8 @@ describe('DyFM_Shared', () => {
|
|
|
52
52
|
expect(result).toEqual(expected);
|
|
53
53
|
});
|
|
54
54
|
});
|
|
55
|
-
describe('pushToNestedData', () => {
|
|
56
|
-
it('should push to nested array at specified path', () => {
|
|
55
|
+
describe('| pushToNestedData', () => {
|
|
56
|
+
it('| should push to nested array at specified path', () => {
|
|
57
57
|
const obj = { level1: { level2: [1, 2] } };
|
|
58
58
|
const path = ['level1', 'level2'];
|
|
59
59
|
const valueToPush = 3;
|
|
@@ -61,7 +61,7 @@ describe('DyFM_Shared', () => {
|
|
|
61
61
|
const result = shared_util_1.DyFM_Shared.pushToNestedData(obj, path, valueToPush);
|
|
62
62
|
expect(result).toEqual(expected);
|
|
63
63
|
});
|
|
64
|
-
it('should create an array and push if none exists', () => {
|
|
64
|
+
it('| should create an array and push if none exists', () => {
|
|
65
65
|
const obj = { level1: {} };
|
|
66
66
|
const path = ['level1', 'level2'];
|
|
67
67
|
const valueToPush = 3;
|
|
@@ -70,8 +70,8 @@ describe('DyFM_Shared', () => {
|
|
|
70
70
|
expect(result).toEqual(expected);
|
|
71
71
|
});
|
|
72
72
|
});
|
|
73
|
-
describe('nestRecursiveListedData', () => {
|
|
74
|
-
it('should nest data in recursive list structure', () => {
|
|
73
|
+
describe('| nestRecursiveListedData', () => {
|
|
74
|
+
it('| should nest data in recursive list structure', () => {
|
|
75
75
|
const obj = { listKey: [{ listKey: [{ listKey: [{}] }] }] };
|
|
76
76
|
const nestedListKey = 'listKey';
|
|
77
77
|
const nestIndexes = [0, 0, 0];
|
|
@@ -81,7 +81,7 @@ describe('DyFM_Shared', () => {
|
|
|
81
81
|
expect(result).toEqual(expected);
|
|
82
82
|
});
|
|
83
83
|
});
|
|
84
|
-
describe('resolveCirculation', () => {
|
|
84
|
+
describe('| resolveCirculation', () => {
|
|
85
85
|
xit('should resolve circular references in data', () => {
|
|
86
86
|
const obj = { inner: {} };
|
|
87
87
|
obj.inner.self = obj;
|
|
@@ -97,7 +97,7 @@ describe('DyFM_Shared', () => {
|
|
|
97
97
|
expect(result).toEqual(expected);
|
|
98
98
|
});
|
|
99
99
|
});
|
|
100
|
-
describe('findCirculations', () => {
|
|
100
|
+
describe('| findCirculations', () => {
|
|
101
101
|
xit('should find circular references in data', () => {
|
|
102
102
|
const obj = {};
|
|
103
103
|
obj.self = obj;
|