@futdevpro/fsm-dynamo 1.8.4 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +9 -6
- package/lib/_constants/error-defaults.const.d.ts +2 -2
- package/lib/_constants/error-defaults.const.d.ts.map +1 -1
- package/lib/_constants/error-defaults.const.js +2 -2
- package/lib/_constants/error-defaults.const.js.map +1 -1
- package/lib/_constants/module-settings/custom-data-module-settings.const.d.ts +6 -2
- package/lib/_constants/module-settings/custom-data-module-settings.const.d.ts.map +1 -1
- package/lib/_constants/module-settings/custom-data-module-settings.const.js +9 -4
- package/lib/_constants/module-settings/custom-data-module-settings.const.js.map +1 -1
- package/lib/_constants/module-settings/test-module-settings.const.d.ts +8 -2
- package/lib/_constants/module-settings/test-module-settings.const.d.ts.map +1 -1
- package/lib/_constants/module-settings/test-module-settings.const.js +13 -8
- package/lib/_constants/module-settings/test-module-settings.const.js.map +1 -1
- package/lib/_constants/module-settings/usage-module-settings.const.d.ts +8 -2
- package/lib/_constants/module-settings/usage-module-settings.const.d.ts.map +1 -1
- package/lib/_constants/module-settings/usage-module-settings.const.js +13 -6
- package/lib/_constants/module-settings/usage-module-settings.const.js.map +1 -1
- package/lib/_enums/basic-property-type.enum.d.ts +1 -1
- package/lib/_enums/basic-property-type.enum.d.ts.map +1 -1
- package/lib/_enums/basic-property-type.enum.js +9 -9
- package/lib/_enums/basic-property-type.enum.js.map +1 -1
- package/lib/_enums/data-model-type.enum.d.ts +1 -1
- package/lib/_enums/data-model-type.enum.d.ts.map +1 -1
- package/lib/_enums/data-model-type.enum.js +7 -7
- package/lib/_enums/data-model-type.enum.js.map +1 -1
- package/lib/_enums/day-of-week.enum.d.ts +4 -4
- package/lib/_enums/day-of-week.enum.d.ts.map +1 -1
- package/lib/_enums/day-of-week.enum.js +21 -21
- package/lib/_enums/day-of-week.enum.js.map +1 -1
- package/lib/_enums/error-level.enum.d.ts +1 -1
- package/lib/_enums/error-level.enum.d.ts.map +1 -1
- package/lib/_enums/error-level.enum.js +13 -13
- package/lib/_enums/error-level.enum.js.map +1 -1
- package/lib/_enums/log-style.enum.d.ts +1 -1
- package/lib/_enums/log-style.enum.d.ts.map +1 -1
- package/lib/_enums/log-style.enum.js +27 -27
- package/lib/_enums/log-style.enum.js.map +1 -1
- package/lib/_enums/month.enum.d.ts +1 -1
- package/lib/_enums/month.enum.d.ts.map +1 -1
- package/lib/_enums/month.enum.js +16 -16
- package/lib/_enums/month.enum.js.map +1 -1
- package/lib/_enums/region.enum.d.ts +1 -1
- package/lib/_enums/region.enum.d.ts.map +1 -1
- package/lib/_enums/region.enum.js +9 -9
- package/lib/_enums/region.enum.js.map +1 -1
- package/lib/_enums/relative-date.enum.d.ts +1 -1
- package/lib/_enums/relative-date.enum.d.ts.map +1 -1
- package/lib/_enums/relative-date.enum.js +10 -10
- package/lib/_enums/relative-date.enum.js.map +1 -1
- package/lib/_enums/sub-region.enum.d.ts +1 -1
- package/lib/_enums/sub-region.enum.d.ts.map +1 -1
- package/lib/_enums/sub-region.enum.js +21 -21
- package/lib/_enums/sub-region.enum.js.map +1 -1
- package/lib/_enums/subdivision-region-type.enum.d.ts +1 -1
- package/lib/_enums/subdivision-region-type.enum.d.ts.map +1 -1
- package/lib/_enums/subdivision-region-type.enum.js +42 -42
- package/lib/_enums/subdivision-region-type.enum.js.map +1 -1
- package/lib/_models/control-models/daily-usage-data.control-model.d.ts +5 -5
- package/lib/_models/control-models/daily-usage-data.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/daily-usage-data.control-model.js +3 -3
- package/lib/_models/control-models/daily-usage-data.control-model.js.map +1 -1
- package/lib/_models/control-models/data-model-params.control-model.d.ts +13 -14
- package/lib/_models/control-models/data-model-params.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/data-model-params.control-model.js +9 -15
- package/lib/_models/control-models/data-model-params.control-model.js.map +1 -1
- package/lib/_models/control-models/data-property-params.control-model.d.ts +9 -9
- package/lib/_models/control-models/data-property-params.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/data-property-params.control-model.js +10 -10
- package/lib/_models/control-models/data-property-params.control-model.js.map +1 -1
- package/lib/_models/control-models/error.control-model.d.ts +15 -15
- package/lib/_models/control-models/error.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/error.control-model.js +18 -18
- package/lib/_models/control-models/error.control-model.js.map +1 -1
- package/lib/_models/control-models/error.control-model.spec.js +34 -34
- package/lib/_models/control-models/error.control-model.spec.js.map +1 -1
- package/lib/_models/control-models/poll.control-model.d.ts +2 -2
- package/lib/_models/control-models/poll.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/poll.control-model.js +8 -8
- package/lib/_models/control-models/poll.control-model.js.map +1 -1
- package/lib/_models/control-models/range-value.control-model.d.ts +20 -20
- package/lib/_models/control-models/range-value.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/range-value.control-model.js +15 -15
- package/lib/_models/control-models/range-value.control-model.js.map +1 -1
- package/lib/_models/control-models/usage-action.control-model.d.ts +3 -3
- package/lib/_models/control-models/usage-action.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/usage-action.control-model.js +3 -3
- package/lib/_models/control-models/usage-action.control-model.js.map +1 -1
- package/lib/_models/control-models/usage-data.control-model.d.ts +6 -6
- package/lib/_models/control-models/usage-data.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/usage-data.control-model.js +3 -3
- package/lib/_models/control-models/usage-data.control-model.js.map +1 -1
- package/lib/_models/data-models/custom-data.data-model.d.ts +7 -7
- package/lib/_models/data-models/custom-data.data-model.d.ts.map +1 -1
- package/lib/_models/data-models/custom-data.data-model.js +4 -4
- package/lib/_models/data-models/custom-data.data-model.js.map +1 -1
- package/lib/_models/data-models/metadata.data-model.d.ts +5 -5
- package/lib/_models/data-models/metadata.data-model.d.ts.map +1 -1
- package/lib/_models/data-models/metadata.data-model.js +3 -3
- package/lib/_models/data-models/metadata.data-model.js.map +1 -1
- package/lib/_models/data-models/usage-session.data-model.d.ts +10 -10
- package/lib/_models/data-models/usage-session.data-model.d.ts.map +1 -1
- package/lib/_models/data-models/usage-session.data-model.js +4 -4
- package/lib/_models/data-models/usage-session.data-model.js.map +1 -1
- package/lib/_models/interfaces/error-defaults.interface.d.ts +1 -1
- package/lib/_models/interfaces/error-defaults.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/location/country-division.interface.d.ts +1 -1
- package/lib/_models/interfaces/location/country-division.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/location/country-iso.interface.d.ts +7 -7
- package/lib/_models/interfaces/location/country-iso.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/location/country-phone-code.interface.d.ts +1 -1
- package/lib/_models/interfaces/location/country-phone-code.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/location/division-collection.interface.d.ts +1 -1
- package/lib/_models/interfaces/location/division-collection.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/location/division-region-data.interface.d.ts +4 -4
- package/lib/_models/interfaces/location/division-region-data.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/location/geo-ip-location.interface.d.ts +1 -1
- package/lib/_models/interfaces/location/geo-ip-location.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/location/location-coordinates.interface.d.ts +1 -1
- package/lib/_models/interfaces/location/location-coordinates.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/paged.interace.d.ts +1 -1
- package/lib/_models/interfaces/paged.interace.d.ts.map +1 -1
- package/lib/_models/interfaces/random-weight.interface.d.ts +1 -1
- package/lib/_models/interfaces/random-weight.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/route-settings.interface.d.ts +4 -4
- package/lib/_models/interfaces/route-settings.interface.d.ts.map +1 -1
- package/lib/_utils/array.util.d.ts +4 -4
- package/lib/_utils/array.util.d.ts.map +1 -1
- package/lib/_utils/array.util.js +3 -3
- package/lib/_utils/array.util.js.map +1 -1
- package/lib/_utils/array.util.spec.js +5 -5
- package/lib/_utils/array.util.spec.js.map +1 -1
- package/lib/_utils/box-bounds.util.d.ts +12 -12
- package/lib/_utils/box-bounds.util.d.ts.map +1 -1
- package/lib/_utils/box-bounds.util.js +7 -7
- package/lib/_utils/box-bounds.util.js.map +1 -1
- package/lib/_utils/index.d.ts +0 -1
- package/lib/_utils/index.d.ts.map +1 -1
- package/lib/_utils/index.js +0 -1
- package/lib/_utils/index.js.map +1 -1
- package/lib/_utils/location.util.d.ts +4 -4
- package/lib/_utils/location.util.d.ts.map +1 -1
- package/lib/_utils/location.util.js +9 -9
- package/lib/_utils/location.util.js.map +1 -1
- package/lib/_utils/log.util.d.ts +17 -17
- package/lib/_utils/log.util.d.ts.map +1 -1
- package/lib/_utils/log.util.js +25 -25
- package/lib/_utils/log.util.js.map +1 -1
- package/lib/_utils/math.util.d.ts +1 -1
- package/lib/_utils/math.util.d.ts.map +1 -1
- package/lib/_utils/math.util.js +3 -3
- package/lib/_utils/math.util.js.map +1 -1
- package/lib/_utils/random.util.d.ts +5 -5
- package/lib/_utils/random.util.d.ts.map +1 -1
- package/lib/_utils/random.util.js +3 -3
- package/lib/_utils/random.util.js.map +1 -1
- package/lib/_utils/regex/password-regex.util.d.ts +2 -2
- package/lib/_utils/regex/password-regex.util.d.ts.map +1 -1
- package/lib/_utils/regex/password-regex.util.js +7 -7
- package/lib/_utils/regex/password-regex.util.js.map +1 -1
- package/lib/_utils/regex/username-regex.util.d.ts +1 -1
- package/lib/_utils/regex/username-regex.util.d.ts.map +1 -1
- package/lib/_utils/regex/username-regex.util.js +3 -3
- package/lib/_utils/regex/username-regex.util.js.map +1 -1
- package/lib/_utils/regex.util.d.ts +1 -1
- package/lib/_utils/regex.util.d.ts.map +1 -1
- package/lib/_utils/regex.util.js +2 -2
- package/lib/_utils/regex.util.js.map +1 -1
- package/lib/_utils/regions.util.d.ts +12 -12
- package/lib/_utils/regions.util.d.ts.map +1 -1
- package/lib/_utils/regions.util.js +13 -13
- package/lib/_utils/regions.util.js.map +1 -1
- package/lib/_utils/round-list.util.d.ts +2 -2
- package/lib/_utils/round-list.util.d.ts.map +1 -1
- package/lib/_utils/round-list.util.js +3 -3
- package/lib/_utils/round-list.util.js.map +1 -1
- package/lib/_utils/shared.static-service.d.ts +2 -2
- package/lib/_utils/shared.static-service.d.ts.map +1 -1
- package/lib/_utils/shared.static-service.js +8 -8
- package/lib/_utils/shared.static-service.js.map +1 -1
- package/lib/_utils/time.util.d.ts +16 -16
- package/lib/_utils/time.util.d.ts.map +1 -1
- package/lib/_utils/time.util.js +29 -29
- package/lib/_utils/time.util.js.map +1 -1
- package/lib/_utils/trigonometry.util.d.ts +4 -4
- package/lib/_utils/trigonometry.util.d.ts.map +1 -1
- package/lib/_utils/trigonometry.util.js +3 -3
- package/lib/_utils/trigonometry.util.js.map +1 -1
- package/lib/_utils/type-cloning-facility.util.d.ts +4 -4
- package/lib/_utils/type-cloning-facility.util.d.ts.map +1 -1
- package/lib/_utils/type-cloning-facility.util.js +3 -3
- package/lib/_utils/type-cloning-facility.util.js.map +1 -1
- package/lib/_utils/utilities.util.d.ts +25 -25
- package/lib/_utils/utilities.util.d.ts.map +1 -1
- package/lib/_utils/utilities.util.js +34 -34
- package/lib/_utils/utilities.util.js.map +1 -1
- package/lib/_utils/vector2.util.d.ts +36 -36
- package/lib/_utils/vector2.util.d.ts.map +1 -1
- package/lib/_utils/vector2.util.js +37 -37
- package/lib/_utils/vector2.util.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +157 -160
- package/src/_constants/error-defaults.const.ts +2 -2
- package/src/_constants/module-settings/custom-data-module-settings.const.ts +9 -4
- package/src/_constants/module-settings/test-module-settings.const.ts +13 -8
- package/src/_constants/module-settings/usage-module-settings.const.ts +13 -6
- package/src/_enums/basic-property-type.enum.ts +1 -1
- package/src/_enums/data-model-type.enum.ts +1 -1
- package/src/_enums/day-of-week.enum.ts +11 -11
- package/src/_enums/error-level.enum.ts +1 -1
- package/src/_enums/log-style.enum.ts +1 -1
- package/src/_enums/month.enum.ts +1 -1
- package/src/_enums/region.enum.ts +1 -1
- package/src/_enums/relative-date.enum.ts +1 -1
- package/src/_enums/sub-region.enum.ts +1 -1
- package/src/_enums/subdivision-region-type.enum.ts +1 -1
- package/src/_models/control-models/daily-usage-data.control-model.ts +5 -5
- package/src/_models/control-models/data-model-params.control-model.ts +15 -25
- package/src/_models/control-models/data-property-params.control-model.ts +15 -15
- package/src/_models/control-models/error.control-model.spec.ts +69 -69
- package/src/_models/control-models/error.control-model.ts +80 -80
- package/src/_models/control-models/poll.control-model.ts +8 -8
- package/src/_models/control-models/range-value.control-model.ts +58 -58
- package/src/_models/control-models/usage-action.control-model.ts +3 -3
- package/src/_models/control-models/usage-data.control-model.ts +6 -6
- package/src/_models/data-models/custom-data.data-model.ts +13 -12
- package/src/_models/data-models/metadata.data-model.ts +5 -5
- package/src/_models/data-models/usage-session.data-model.ts +28 -27
- package/src/_models/interfaces/error-defaults.interface.ts +1 -1
- package/src/_models/interfaces/location/country-division.interface.ts +1 -1
- package/src/_models/interfaces/location/country-iso.interface.ts +7 -7
- package/src/_models/interfaces/location/country-phone-code.interface.ts +1 -1
- package/src/_models/interfaces/location/division-collection.interface.ts +1 -1
- package/src/_models/interfaces/location/division-region-data.interface.ts +4 -4
- package/src/_models/interfaces/location/geo-ip-location.interface.ts +1 -1
- package/src/_models/interfaces/location/location-coordinates.interface.ts +1 -1
- package/src/_models/interfaces/paged.interace.ts +1 -1
- package/src/_models/interfaces/random-weight.interface.ts +1 -1
- package/src/_models/interfaces/route-settings.interface.ts +4 -4
- package/src/_utils/array.util.spec.ts +7 -7
- package/src/_utils/array.util.ts +4 -4
- package/src/_utils/box-bounds.util.ts +19 -19
- package/src/_utils/index.ts +0 -1
- package/src/_utils/location.util.ts +13 -13
- package/src/_utils/log.util.ts +36 -36
- package/src/_utils/math.util.ts +1 -1
- package/src/_utils/random.util.ts +9 -5
- package/src/_utils/regex/password-regex.util.ts +5 -5
- package/src/_utils/regex/username-regex.util.ts +2 -2
- package/src/_utils/regex.util.ts +1 -1
- package/src/_utils/regions.util.ts +33 -33
- package/src/_utils/round-list.util.ts +2 -2
- package/src/_utils/shared.static-service.ts +8 -8
- package/src/_utils/time.util.ts +40 -40
- package/src/_utils/trigonometry.util.ts +4 -4
- package/src/_utils/type-cloning-facility.util.ts +4 -4
- package/src/_utils/utilities.util.ts +31 -27
- package/src/_utils/vector2.util.ts +67 -67
- package/tsconfig.json +2 -1
- package/lib/_utils/metadata.util.d.ts +0 -2
- package/lib/_utils/metadata.util.d.ts.map +0 -1
- package/lib/_utils/metadata.util.js +0 -32
- package/lib/_utils/metadata.util.js.map +0 -1
- package/src/_utils/metadata.util.ts +0 -31
package/src/_utils/log.util.ts
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { DynamoFM_LogStyle } from '../_enums/log-style.enum';
|
|
3
3
|
|
|
4
|
-
/* export class D_Log implements
|
|
5
|
-
export type
|
|
6
|
-
export type
|
|
7
|
-
export type
|
|
4
|
+
/* export class D_Log implements DynamoFM_Log {}; */
|
|
5
|
+
export type DynamoFM_L = DynamoFM_Log;
|
|
6
|
+
export type DFM_Log = DynamoFM_Log;
|
|
7
|
+
export type DFM_L = DynamoFM_Log;
|
|
8
8
|
|
|
9
|
-
export class
|
|
9
|
+
export class DynamoFM_Log {
|
|
10
10
|
|
|
11
|
-
static setStyle(styles:
|
|
11
|
+
static setStyle(styles: DynamoFM_LogStyle[]): void {
|
|
12
12
|
let styleSets = '';
|
|
13
13
|
|
|
14
|
-
styles.forEach((style:
|
|
14
|
+
styles.forEach((style: DynamoFM_LogStyle): void => {
|
|
15
15
|
styleSets += style;
|
|
16
16
|
});
|
|
17
17
|
console.log(styleSets);
|
|
18
18
|
}
|
|
19
19
|
static resetStyle(): void {
|
|
20
|
-
console.log(
|
|
20
|
+
console.log(DynamoFM_LogStyle.reset);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
static addStyle(input: string, styles:
|
|
23
|
+
static addStyle(input: string, styles: DynamoFM_LogStyle[], dontReset?: boolean): string {
|
|
24
24
|
let result = '';
|
|
25
25
|
|
|
26
|
-
styles.forEach((style:
|
|
26
|
+
styles.forEach((style: DynamoFM_LogStyle): void => {
|
|
27
27
|
result += style;
|
|
28
28
|
});
|
|
29
29
|
result += input;
|
|
30
30
|
|
|
31
31
|
if (!dontReset) {
|
|
32
|
-
result +=
|
|
32
|
+
result += DynamoFM_LogStyle.reset;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
return result;
|
|
@@ -38,17 +38,17 @@ export class Dynamo_Log {
|
|
|
38
38
|
static success(message: string, ...optionalParams: any[]): void {
|
|
39
39
|
if (0 < optionalParams.length) {
|
|
40
40
|
console.log(
|
|
41
|
-
`${
|
|
42
|
-
...optionalParams,
|
|
41
|
+
`${DynamoFM_LogStyle.green}${DynamoFM_LogStyle.bright}${message}`,
|
|
42
|
+
...optionalParams, DynamoFM_LogStyle.reset
|
|
43
43
|
);
|
|
44
44
|
} else {
|
|
45
45
|
console.log(
|
|
46
|
-
`${
|
|
46
|
+
`${DynamoFM_LogStyle.green}${DynamoFM_LogStyle.bright}${message}${DynamoFM_LogStyle.reset}`
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
|
-
* @deprecated use
|
|
51
|
+
* @deprecated use DynamoFM_Log.success instead
|
|
52
52
|
*/
|
|
53
53
|
static logSuccess(message: string, ...optionalParams: any[]): void {
|
|
54
54
|
this.success(message, ...optionalParams);
|
|
@@ -57,17 +57,17 @@ export class Dynamo_Log {
|
|
|
57
57
|
static error(message: string, ...optionalParams: any[]): void {
|
|
58
58
|
if (0 < optionalParams.length) {
|
|
59
59
|
console.error(
|
|
60
|
-
`${
|
|
61
|
-
...optionalParams,
|
|
60
|
+
`${DynamoFM_LogStyle.red}${DynamoFM_LogStyle.bright}${message}`,
|
|
61
|
+
...optionalParams, DynamoFM_LogStyle.reset
|
|
62
62
|
);
|
|
63
63
|
} else {
|
|
64
64
|
console.error(
|
|
65
|
-
`${
|
|
65
|
+
`${DynamoFM_LogStyle.red}${DynamoFM_LogStyle.bright}${message}${DynamoFM_LogStyle.reset}`
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
|
-
* @deprecated use
|
|
70
|
+
* @deprecated use DynamoFM_Log.error instead
|
|
71
71
|
*/
|
|
72
72
|
static logError(message: string, ...optionalParams: any[]): void {
|
|
73
73
|
this.error(message, ...optionalParams);
|
|
@@ -76,23 +76,23 @@ export class Dynamo_Log {
|
|
|
76
76
|
static warn(message: string, ...optionalParams: any[]): void {
|
|
77
77
|
if (0 < optionalParams.length) {
|
|
78
78
|
console.warn(
|
|
79
|
-
`${
|
|
80
|
-
...optionalParams,
|
|
79
|
+
`${DynamoFM_LogStyle.yellow}${DynamoFM_LogStyle.bright}${message}`,
|
|
80
|
+
...optionalParams, DynamoFM_LogStyle.reset
|
|
81
81
|
);
|
|
82
82
|
} else {
|
|
83
83
|
console.warn(
|
|
84
|
-
`${
|
|
84
|
+
`${DynamoFM_LogStyle.yellow}${DynamoFM_LogStyle.bright}${message}${DynamoFM_LogStyle.reset}`
|
|
85
85
|
);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
|
-
* @deprecated use
|
|
89
|
+
* @deprecated use DynamoFM_Log.warn instead
|
|
90
90
|
*/
|
|
91
91
|
static warning(message: string, ...optionalParams: any[]): void {
|
|
92
92
|
this.warn(message, ...optionalParams);
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
|
-
* @deprecated use
|
|
95
|
+
* @deprecated use DynamoFM_Log.warn instead
|
|
96
96
|
*/
|
|
97
97
|
static logWarning(message: string, ...optionalParams: any[]): void {
|
|
98
98
|
this.warn(message, ...optionalParams);
|
|
@@ -109,12 +109,12 @@ export class Dynamo_Log {
|
|
|
109
109
|
static highlighted(message: string, ...optionalParams: any[]): void {
|
|
110
110
|
if (0 < optionalParams.length) {
|
|
111
111
|
console.log(
|
|
112
|
-
`${
|
|
113
|
-
...optionalParams,
|
|
112
|
+
`${DynamoFM_LogStyle.white}${DynamoFM_LogStyle.bright}${message}`,
|
|
113
|
+
...optionalParams, DynamoFM_LogStyle.reset
|
|
114
114
|
);
|
|
115
115
|
} else {
|
|
116
116
|
console.log(
|
|
117
|
-
`${
|
|
117
|
+
`${DynamoFM_LogStyle.white}${DynamoFM_LogStyle.bright}${message}${DynamoFM_LogStyle.reset}`
|
|
118
118
|
);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -123,7 +123,7 @@ export class Dynamo_Log {
|
|
|
123
123
|
this.log(message, ...optionalParams);
|
|
124
124
|
this.log('\n' + this.h_solid + '\n\n');
|
|
125
125
|
}
|
|
126
|
-
static test =
|
|
126
|
+
static test = DynamoFM_Log.testLog;
|
|
127
127
|
|
|
128
128
|
static highlightedLog(message: string, ...optionalParams: any[]): void {
|
|
129
129
|
this.log('\n\n' + this.h_before);
|
|
@@ -134,7 +134,7 @@ export class Dynamo_Log {
|
|
|
134
134
|
this.log(' ' + this.h_after);
|
|
135
135
|
this.log(this.h_after + '\n\n');
|
|
136
136
|
}
|
|
137
|
-
static H_log =
|
|
137
|
+
static H_log = DynamoFM_Log.highlightedLog;
|
|
138
138
|
|
|
139
139
|
static testInfo(message: string, ...optionalParams: any[]): void {
|
|
140
140
|
this.info('\n\n' + this.h_solid + '\n');
|
|
@@ -151,7 +151,7 @@ export class Dynamo_Log {
|
|
|
151
151
|
this.info(' ' + this.h_after);
|
|
152
152
|
this.info(this.h_after + '\n\n');
|
|
153
153
|
}
|
|
154
|
-
static H_info =
|
|
154
|
+
static H_info = DynamoFM_Log.highlightedInfo;
|
|
155
155
|
|
|
156
156
|
static testError(message: string, ...optionalParams: any[]): void {
|
|
157
157
|
this.error('\n\n' + this.h_solid + '\n');
|
|
@@ -168,7 +168,7 @@ export class Dynamo_Log {
|
|
|
168
168
|
this.error(' ' + this.h_after);
|
|
169
169
|
this.error(this.h_after + '\n\n');
|
|
170
170
|
}
|
|
171
|
-
static H_error =
|
|
171
|
+
static H_error = DynamoFM_Log.highlightedError;
|
|
172
172
|
|
|
173
173
|
static testWarn(message: string, ...optionalParams: any[]): void {
|
|
174
174
|
this.warn('\n\n' + this.h_solid + '\n');
|
|
@@ -185,7 +185,7 @@ export class Dynamo_Log {
|
|
|
185
185
|
this.warn(' ' + this.h_after);
|
|
186
186
|
this.warn(this.h_after + '\n\n');
|
|
187
187
|
}
|
|
188
|
-
static H_warn =
|
|
188
|
+
static H_warn = DynamoFM_Log.highlightedWarn;
|
|
189
189
|
|
|
190
190
|
static testSuccess(message: string, ...optionalParams: any[]): void {
|
|
191
191
|
this.success('\n\n' + this.h_solid + '\n');
|
|
@@ -202,7 +202,7 @@ export class Dynamo_Log {
|
|
|
202
202
|
this.success(' ' + this.h_after);
|
|
203
203
|
this.success(this.h_after + '\n\n');
|
|
204
204
|
}
|
|
205
|
-
static H_success =
|
|
205
|
+
static H_success = DynamoFM_Log.highlightedSuccess;
|
|
206
206
|
|
|
207
207
|
// eslint-disable-next-line max-len
|
|
208
208
|
private static h_solid: string = '|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||';
|
|
@@ -212,8 +212,8 @@ export class Dynamo_Log {
|
|
|
212
212
|
private static h_after: string = '/////////////////////////////////////////////////////////////////////////////';
|
|
213
213
|
|
|
214
214
|
static removeLogStyles(message: string): string {
|
|
215
|
-
for (const styleKey of Object(
|
|
216
|
-
message = message.replace(new RegExp(
|
|
215
|
+
for (const styleKey of Object(DynamoFM_LogStyle)) {
|
|
216
|
+
message = message.replace(new RegExp(DynamoFM_LogStyle[styleKey], 'g'), '');
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
return message;
|
package/src/_utils/math.util.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { DynamoFM_RandomWeight } from '../_models/interfaces/random-weight.interface';
|
|
3
3
|
|
|
4
|
-
export type
|
|
5
|
-
export class
|
|
6
|
-
static getRandomWeightedInt(
|
|
4
|
+
export type DFM_Random = DynamoFM_Random;
|
|
5
|
+
export class DynamoFM_Random {
|
|
6
|
+
static getRandomWeightedInt(
|
|
7
|
+
min: number,
|
|
8
|
+
max: number,
|
|
9
|
+
weights: DynamoFM_RandomWeight<number>[]
|
|
10
|
+
): number {
|
|
7
11
|
weights = weights.sort((a, b): number => b.chance - a.chance);
|
|
8
12
|
let weightChanceSum = 0;
|
|
9
13
|
|
|
@@ -44,7 +48,7 @@ export class Dynamo_Random {
|
|
|
44
48
|
}
|
|
45
49
|
}
|
|
46
50
|
|
|
47
|
-
static getRandomWeighted<T>(weights:
|
|
51
|
+
static getRandomWeighted<T>(weights: DynamoFM_RandomWeight<T>[]): T {
|
|
48
52
|
if (!weights?.length) {
|
|
49
53
|
return null;
|
|
50
54
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
|
|
2
|
-
export const
|
|
2
|
+
export const DynamoFM_passwordRegex: RegExp = new RegExp(
|
|
3
3
|
'^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*]){6,}'
|
|
4
4
|
);
|
|
5
5
|
|
|
6
|
-
/* export const
|
|
6
|
+
/* export const DynamoFM_ALLPasswordRegexUserMessages: string =
|
|
7
7
|
'Password must include at least one lowercase letter. ' +
|
|
8
8
|
'Password must include at least one uppercase letter.' +
|
|
9
9
|
'Password must include at least one digit.' +
|
|
10
10
|
'Password must include at least one of the !@#$%^&* characters.' +
|
|
11
11
|
'Password must be at least 6 characters long.'; */
|
|
12
12
|
|
|
13
|
-
export function
|
|
13
|
+
export function DynamoFM_getPasswordErrors(password: string): string[] {
|
|
14
14
|
const errors: string[] = [];
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
DynamoFM_passwordErrorsOneByOne.forEach((error): void => {
|
|
17
17
|
if (!error.regex.test(password)) {
|
|
18
18
|
errors.push(error.message);
|
|
19
19
|
}
|
|
@@ -22,7 +22,7 @@ export function Dynamo_getPasswordErrors(password: string): string[] {
|
|
|
22
22
|
return errors;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
const
|
|
25
|
+
const DynamoFM_passwordErrorsOneByOne = [
|
|
26
26
|
{
|
|
27
27
|
regex: new RegExp('^(?=.*[a-z])'),
|
|
28
28
|
code: 'pwErrorLowercase',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
export const
|
|
2
|
+
export const DynamoFM_usernameRegex: RegExp = new RegExp('^[a-zA-Z0-9-_#$%&^|*]{6,}$');
|
|
3
3
|
|
|
4
4
|
/* export const FDP_usernameRegexUserMessage: string =
|
|
5
5
|
'Username must be at least 6 characters long and can only contain letters, ' +
|
|
@@ -17,7 +17,7 @@ export const Dynamo_usernameRegex: RegExp = new RegExp('^[a-zA-Z0-9-_#$%&^|*]{6,
|
|
|
17
17
|
return errors;
|
|
18
18
|
} */
|
|
19
19
|
|
|
20
|
-
const
|
|
20
|
+
const DynamoFM_usernameErrorsOneByOne = [
|
|
21
21
|
{
|
|
22
22
|
regex: new RegExp('^(?=.{6,})'),
|
|
23
23
|
code: 'usernameErrorLength',
|
package/src/_utils/regex.util.ts
CHANGED
|
@@ -4,55 +4,55 @@ import * as ISOs from '../_constants/location/country-codes-ISO-3166.json';
|
|
|
4
4
|
import * as PhoneCodes from '../_constants/location/country-phone-codes.json';
|
|
5
5
|
import * as Divisions from '../_constants/location/country-divisions-ISO-3166-all-list.json';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { DynamoFM_Region } from '../_enums/region.enum';
|
|
8
|
+
import { DynamoFM_Error } from '../_models';
|
|
9
9
|
import {
|
|
10
|
-
|
|
10
|
+
DynamoFM_CountryPhoneCode
|
|
11
11
|
} from '../_models/interfaces/location/country-phone-code.interface';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { DynamoFM_CountryISO } from '../_models/interfaces/location/country-iso.interface';
|
|
13
|
+
import { DynamoFM_CountryDivision } from '../_models/interfaces/location/country-division.interface';
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { DynamoFM_JSONListify } from './utilities.util';
|
|
16
16
|
|
|
17
|
-
export type
|
|
18
|
-
export class
|
|
19
|
-
/* static divisions: DivisionCollection =
|
|
20
|
-
static divisions:
|
|
21
|
-
static phoneCodes:
|
|
22
|
-
static ISOs:
|
|
17
|
+
export type DFM_Regions = DynamoFM_Regions;
|
|
18
|
+
export class DynamoFM_Regions {
|
|
19
|
+
/* static divisions: DivisionCollection = DynamoFM_Regions.getSubdivisionCollection(); */
|
|
20
|
+
static divisions: DynamoFM_CountryDivision[] = DynamoFM_Regions.getAllDivisions();
|
|
21
|
+
static phoneCodes: DynamoFM_CountryPhoneCode[] = DynamoFM_Regions.getAllPhoneCodes();
|
|
22
|
+
static ISOs: DynamoFM_CountryISO[] = DynamoFM_Regions.getAllCountryISO();
|
|
23
23
|
|
|
24
|
-
private static getAllDivisions():
|
|
25
|
-
return
|
|
24
|
+
private static getAllDivisions(): DynamoFM_CountryDivision[] {
|
|
25
|
+
return DynamoFM_JSONListify(Divisions);
|
|
26
26
|
}
|
|
27
|
-
private static getAllPhoneCodes():
|
|
28
|
-
return
|
|
27
|
+
private static getAllPhoneCodes(): DynamoFM_CountryPhoneCode[] {
|
|
28
|
+
return DynamoFM_JSONListify(PhoneCodes);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
/* private static getSubdivisionCollection(): DivisionCollection {
|
|
32
32
|
return Divisions as DivisionCollection;
|
|
33
33
|
} */
|
|
34
|
-
private static getAllCountryISO():
|
|
35
|
-
const result:
|
|
34
|
+
private static getAllCountryISO(): DynamoFM_CountryISO[] {
|
|
35
|
+
const result: DynamoFM_CountryISO[] = DynamoFM_JSONListify(ISOs);
|
|
36
36
|
|
|
37
|
-
result.forEach((iso:
|
|
37
|
+
result.forEach((iso: DynamoFM_CountryISO): void => {
|
|
38
38
|
iso.phoneCode = this.phoneCodes.find(
|
|
39
|
-
(pc:
|
|
39
|
+
(pc: DynamoFM_CountryPhoneCode): boolean => pc.iso === iso.iso2
|
|
40
40
|
)?.code;
|
|
41
41
|
iso.divisions = this.divisions.filter(
|
|
42
|
-
(d:
|
|
42
|
+
(d: DynamoFM_CountryDivision): boolean => d.iso === iso.iso2
|
|
43
43
|
);
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
return result;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
static isoToCountryIso(iso2: string):
|
|
50
|
-
const country:
|
|
51
|
-
(iso:
|
|
49
|
+
static isoToCountryIso(iso2: string): DynamoFM_CountryISO {
|
|
50
|
+
const country: DynamoFM_CountryISO = this.ISOs.find(
|
|
51
|
+
(iso: DynamoFM_CountryISO): boolean => iso.iso2 == iso2
|
|
52
52
|
);
|
|
53
53
|
|
|
54
54
|
if (!country) {
|
|
55
|
-
throw new
|
|
55
|
+
throw new DynamoFM_Error({
|
|
56
56
|
message: `Cannot find ISO-3166 code for this: ${iso2}`
|
|
57
57
|
});
|
|
58
58
|
} else {
|
|
@@ -60,13 +60,13 @@ export class Dynamo_Regions {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
static isoToRegion(iso2: string):
|
|
64
|
-
const region:
|
|
65
|
-
(iso:
|
|
63
|
+
static isoToRegion(iso2: string): DynamoFM_Region {
|
|
64
|
+
const region: DynamoFM_Region = this.ISOs.find(
|
|
65
|
+
(iso: DynamoFM_CountryISO): boolean => iso.iso2 == iso2
|
|
66
66
|
)?.region;
|
|
67
67
|
|
|
68
68
|
if (!region) {
|
|
69
|
-
throw new
|
|
69
|
+
throw new DynamoFM_Error({
|
|
70
70
|
message: `Cannot find ISO-3166 code for this: ${iso2}`
|
|
71
71
|
});
|
|
72
72
|
} else {
|
|
@@ -74,13 +74,13 @@ export class Dynamo_Regions {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
static isoToPhoneCode(iso2: string):
|
|
78
|
-
const phoneCode:
|
|
79
|
-
(code:
|
|
77
|
+
static isoToPhoneCode(iso2: string): DynamoFM_CountryPhoneCode {
|
|
78
|
+
const phoneCode: DynamoFM_CountryPhoneCode = this.phoneCodes.find(
|
|
79
|
+
(code: DynamoFM_CountryPhoneCode): boolean => code.iso == iso2
|
|
80
80
|
);
|
|
81
81
|
|
|
82
82
|
if (!phoneCode) {
|
|
83
|
-
throw new
|
|
83
|
+
throw new DynamoFM_Error({
|
|
84
84
|
message: `Cannot find ISO-3166 code for this: ${iso2}`
|
|
85
85
|
});
|
|
86
86
|
} else {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
export type
|
|
4
|
-
export class
|
|
3
|
+
export type DFM_RoundList = DynamoFM_RoundList;
|
|
4
|
+
export class DynamoFM_RoundList {
|
|
5
5
|
static getOutboundedIndex(listLength: number, outboundIndex: number): number {
|
|
6
6
|
if (!(0 < listLength)) {
|
|
7
7
|
throw new Error('roundListPlusIndex failed. list is empty!');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { DynamoFM_clone } from './utilities.util';
|
|
3
3
|
|
|
4
|
-
export type
|
|
5
|
-
export class
|
|
4
|
+
export type DFM_Shared = DynamoFM_Shared;
|
|
5
|
+
export class DynamoFM_Shared {
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* returns remapped object list by path list
|
|
@@ -55,7 +55,7 @@ export class Dynamo_Shared {
|
|
|
55
55
|
* @returns data from object by path
|
|
56
56
|
*/
|
|
57
57
|
static getNestedData(parentObj: object, nestedDataKeys: string[]): any {
|
|
58
|
-
let newData =
|
|
58
|
+
let newData = DynamoFM_clone(parentObj); // {...parentObj};
|
|
59
59
|
|
|
60
60
|
nestedDataKeys.forEach((dk: string): void => {
|
|
61
61
|
if (newData) {
|
|
@@ -74,7 +74,7 @@ export class Dynamo_Shared {
|
|
|
74
74
|
* @returns modified data
|
|
75
75
|
*/
|
|
76
76
|
static nestData(parentObj: object, nestKeys: string[], dataToSet: any): object {
|
|
77
|
-
const newData =
|
|
77
|
+
const newData = DynamoFM_clone(parentObj); // {...parentObj};
|
|
78
78
|
|
|
79
79
|
if (nestKeys.length > 1) {
|
|
80
80
|
const keys = [...nestKeys];
|
|
@@ -96,7 +96,7 @@ export class Dynamo_Shared {
|
|
|
96
96
|
* @returns modified data
|
|
97
97
|
*/
|
|
98
98
|
static addToNestedData(parentObj: object, nestKeys: string[], dataToAdd: any): object {
|
|
99
|
-
const newData =
|
|
99
|
+
const newData = DynamoFM_clone(parentObj); // {...parentObj};
|
|
100
100
|
|
|
101
101
|
if (nestKeys.length > 1) {
|
|
102
102
|
const keys = [...nestKeys];
|
|
@@ -118,7 +118,7 @@ export class Dynamo_Shared {
|
|
|
118
118
|
* @returns modified data
|
|
119
119
|
*/
|
|
120
120
|
static pushToNestedData(parentObj: object, nestKeys: string[], dataToPush: any): object {
|
|
121
|
-
const newData =
|
|
121
|
+
const newData = DynamoFM_clone(parentObj); // {...parentObj};
|
|
122
122
|
|
|
123
123
|
if (nestKeys.length > 1) {
|
|
124
124
|
const keys = [...nestKeys];
|
|
@@ -150,7 +150,7 @@ export class Dynamo_Shared {
|
|
|
150
150
|
nestIndexes: number[],
|
|
151
151
|
dataToSet: any
|
|
152
152
|
): T {
|
|
153
|
-
const newData =
|
|
153
|
+
const newData = DynamoFM_clone(parentObj); // parentObj; // {...parentObj};
|
|
154
154
|
|
|
155
155
|
if (nestIndexes.length > 1) {
|
|
156
156
|
const indexes = [...nestIndexes];
|
package/src/_utils/time.util.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
import { day, hour, minute, month, second, week, year } from '../_constants/times.const';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { DynamoFM_Month } from '../_enums';
|
|
4
|
+
import { DynamoFM_DayOfWeek } from '../_enums/day-of-week.enum';
|
|
5
|
+
import { DynamoFM_RelativeDate } from '../_enums/relative-date.enum';
|
|
6
6
|
|
|
7
|
-
export type
|
|
8
|
-
export type
|
|
9
|
-
export class
|
|
7
|
+
export type DFM_Time = DynamoFM_Time;
|
|
8
|
+
export type DFM_T = DynamoFM_Time;
|
|
9
|
+
export class DynamoFM_Time {
|
|
10
10
|
|
|
11
11
|
static readonly second = second;
|
|
12
12
|
static readonly minute = minute;
|
|
@@ -61,24 +61,24 @@ export class Dynamo_Time {
|
|
|
61
61
|
* @param relativeDate
|
|
62
62
|
* @returns
|
|
63
63
|
*/
|
|
64
|
-
static getDateByRelativeDate(relativeDate:
|
|
64
|
+
static getDateByRelativeDate(relativeDate: DynamoFM_RelativeDate): Date {
|
|
65
65
|
switch (relativeDate) {
|
|
66
|
-
case
|
|
66
|
+
case DynamoFM_RelativeDate.lastDay:
|
|
67
67
|
return this.oneDayAgo();
|
|
68
68
|
|
|
69
|
-
case
|
|
69
|
+
case DynamoFM_RelativeDate.lastWeek:
|
|
70
70
|
return this.oneWeekAgo();
|
|
71
71
|
|
|
72
|
-
case
|
|
72
|
+
case DynamoFM_RelativeDate.lastMonth:
|
|
73
73
|
return this.oneMonthAgo();
|
|
74
74
|
|
|
75
|
-
case
|
|
75
|
+
case DynamoFM_RelativeDate.lastYear:
|
|
76
76
|
return this.oneYearAgo();
|
|
77
77
|
|
|
78
|
-
case
|
|
78
|
+
case DynamoFM_RelativeDate.last10Years:
|
|
79
79
|
return this.tenYearsAgo();
|
|
80
80
|
|
|
81
|
-
case
|
|
81
|
+
case DynamoFM_RelativeDate.allTime:
|
|
82
82
|
return new Date(0);
|
|
83
83
|
|
|
84
84
|
default:
|
|
@@ -135,45 +135,45 @@ export class Dynamo_Time {
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
/**
|
|
138
|
-
* returns the
|
|
138
|
+
* returns the DynamoFM_DayOfWeek type of the current day
|
|
139
139
|
* @returns
|
|
140
140
|
*/
|
|
141
|
-
static getTodayOfWeek():
|
|
142
|
-
return
|
|
141
|
+
static getTodayOfWeek(): DynamoFM_DayOfWeek {
|
|
142
|
+
return DynamoFM_DayOfWeek[
|
|
143
143
|
new Date().toLocaleString('en-us', { weekday: 'long' }).toLocaleLowerCase()
|
|
144
144
|
];
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
|
-
* returns the days of the week from today to the end of the week in
|
|
148
|
+
* returns the days of the week from today to the end of the week in DynamoFM_DayOfWeek format
|
|
149
149
|
* @returns
|
|
150
150
|
*/
|
|
151
|
-
static getDaysOfWeekFromToday():
|
|
152
|
-
const today:
|
|
153
|
-
const daysOfWeek:
|
|
151
|
+
static getDaysOfWeekFromToday(): DynamoFM_DayOfWeek[] {
|
|
152
|
+
const today: DynamoFM_DayOfWeek = this.getTodayOfWeek();
|
|
153
|
+
const daysOfWeek: DynamoFM_DayOfWeek[] = Object.values(DynamoFM_DayOfWeek);
|
|
154
154
|
const todayIndex: number = daysOfWeek.indexOf(today);
|
|
155
155
|
|
|
156
156
|
return daysOfWeek.slice(todayIndex).concat(daysOfWeek.slice(0, todayIndex));
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
/**
|
|
160
|
-
* returns the days of the week to today to the end of the week in
|
|
160
|
+
* returns the days of the week to today to the end of the week in DynamoFM_DayOfWeek format
|
|
161
161
|
* @returns
|
|
162
162
|
*/
|
|
163
|
-
static getDaysOfWeekToToday():
|
|
164
|
-
const today:
|
|
165
|
-
const daysOfWeek:
|
|
163
|
+
static getDaysOfWeekToToday(): DynamoFM_DayOfWeek[] {
|
|
164
|
+
const today: DynamoFM_DayOfWeek = this.getTodayOfWeek();
|
|
165
|
+
const daysOfWeek: DynamoFM_DayOfWeek[] = Object.values(DynamoFM_DayOfWeek);
|
|
166
166
|
const todayIndex: number = daysOfWeek.indexOf(today);
|
|
167
167
|
|
|
168
168
|
return daysOfWeek.slice(0, todayIndex).reverse().concat(daysOfWeek.slice(todayIndex).reverse());
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
/**
|
|
172
|
-
* returns the
|
|
172
|
+
* returns the DynamoFM_Month type of the current month
|
|
173
173
|
* @returns
|
|
174
174
|
*/
|
|
175
|
-
static getCurrentMonth():
|
|
176
|
-
return
|
|
175
|
+
static getCurrentMonth(): DynamoFM_Month {
|
|
176
|
+
return DynamoFM_Month[
|
|
177
177
|
new Date().toLocaleString('en-us', { month: 'long' }).toLocaleLowerCase()
|
|
178
178
|
];
|
|
179
179
|
}
|
|
@@ -183,24 +183,24 @@ export class Dynamo_Time {
|
|
|
183
183
|
* @param inYear this value is important for february if you want to know if it is a leap year
|
|
184
184
|
* @returns
|
|
185
185
|
*/
|
|
186
|
-
static getMonthLength(month:
|
|
186
|
+
static getMonthLength(month: DynamoFM_Month, inYear?: number): number {
|
|
187
187
|
switch (month) {
|
|
188
|
-
case
|
|
189
|
-
case
|
|
190
|
-
case
|
|
191
|
-
case
|
|
192
|
-
case
|
|
193
|
-
case
|
|
188
|
+
case DynamoFM_Month.january:
|
|
189
|
+
case DynamoFM_Month.march:
|
|
190
|
+
case DynamoFM_Month.may:
|
|
191
|
+
case DynamoFM_Month.june:
|
|
192
|
+
case DynamoFM_Month.august:
|
|
193
|
+
case DynamoFM_Month.october:
|
|
194
194
|
return 31;
|
|
195
195
|
|
|
196
|
-
case
|
|
197
|
-
case
|
|
198
|
-
case
|
|
199
|
-
case
|
|
200
|
-
case
|
|
196
|
+
case DynamoFM_Month.april:
|
|
197
|
+
case DynamoFM_Month.july:
|
|
198
|
+
case DynamoFM_Month.september:
|
|
199
|
+
case DynamoFM_Month.november:
|
|
200
|
+
case DynamoFM_Month.december:
|
|
201
201
|
return 30;
|
|
202
202
|
|
|
203
|
-
case
|
|
203
|
+
case DynamoFM_Month.february:
|
|
204
204
|
return this.isLeapYear(inYear ?? new Date().getFullYear()) ? 29 : 28;
|
|
205
205
|
}
|
|
206
206
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
5
|
-
export class
|
|
2
|
+
export type DFM_Trigonometry = DynamoFM_Trigonometry;
|
|
3
|
+
export type DFM_Trig = DynamoFM_Trigonometry;
|
|
4
|
+
export type DFM_Δ = DynamoFM_Trigonometry;
|
|
5
|
+
export class DynamoFM_Trigonometry {
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Befogó
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
2
|
+
export type DynamoFM_TCF = DynamoFM_TypeCloningFacility;
|
|
3
|
+
export type DFM_TypeCloningFacility = DynamoFM_TypeCloningFacility;
|
|
4
|
+
export type DFM_TCF = DynamoFM_TCF;
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
@@ -15,7 +15,7 @@ export type D_TCF = Dynamo_TCF;
|
|
|
15
15
|
* WARNING: this function will clone all connected objects!
|
|
16
16
|
*
|
|
17
17
|
* */
|
|
18
|
-
export class
|
|
18
|
+
export class DynamoFM_TypeCloningFacility {
|
|
19
19
|
|
|
20
20
|
static clone<T>(
|
|
21
21
|
object: T,
|