@futdevpro/fsm-dynamo 1.7.14 → 1.8.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.
Files changed (174) hide show
  1. package/lib/_constants/error-defaults.const.d.ts +1 -1
  2. package/lib/_constants/error-defaults.const.d.ts.map +1 -1
  3. package/lib/_constants/error-defaults.const.js +2 -2
  4. package/lib/_constants/error-defaults.const.js.map +1 -1
  5. package/lib/_constants/module-settings/custom-data-module-settings.const.d.ts +2 -2
  6. package/lib/_constants/module-settings/custom-data-module-settings.const.d.ts.map +1 -1
  7. package/lib/_constants/module-settings/custom-data-module-settings.const.js +2 -2
  8. package/lib/_constants/module-settings/custom-data-module-settings.const.js.map +1 -1
  9. package/lib/_constants/module-settings/test-module-settings.const.d.ts +2 -2
  10. package/lib/_constants/module-settings/test-module-settings.const.d.ts.map +1 -1
  11. package/lib/_constants/module-settings/test-module-settings.const.js +2 -2
  12. package/lib/_constants/module-settings/test-module-settings.const.js.map +1 -1
  13. package/lib/_constants/module-settings/usage-module-settings.const.d.ts +2 -2
  14. package/lib/_constants/module-settings/usage-module-settings.const.d.ts.map +1 -1
  15. package/lib/_constants/module-settings/usage-module-settings.const.js +2 -2
  16. package/lib/_constants/module-settings/usage-module-settings.const.js.map +1 -1
  17. package/lib/_enums/data-model-type.enum.d.ts +10 -3
  18. package/lib/_enums/data-model-type.enum.d.ts.map +1 -1
  19. package/lib/_enums/data-model-type.enum.js +10 -3
  20. package/lib/_enums/data-model-type.enum.js.map +1 -1
  21. package/lib/_enums/day-of-week.enum.d.ts +3 -2
  22. package/lib/_enums/day-of-week.enum.d.ts.map +1 -1
  23. package/lib/_enums/day-of-week.enum.js +4 -3
  24. package/lib/_enums/day-of-week.enum.js.map +1 -1
  25. package/lib/_models/control-models/data-model-params.control-model.d.ts +19 -0
  26. package/lib/_models/control-models/data-model-params.control-model.d.ts.map +1 -0
  27. package/lib/_models/control-models/data-model-params.control-model.js +30 -0
  28. package/lib/_models/control-models/data-model-params.control-model.js.map +1 -0
  29. package/lib/_models/control-models/data-property-params.control-model.d.ts +14 -9
  30. package/lib/_models/control-models/data-property-params.control-model.d.ts.map +1 -1
  31. package/lib/_models/control-models/data-property-params.control-model.js +16 -7
  32. package/lib/_models/control-models/data-property-params.control-model.js.map +1 -1
  33. package/lib/_models/control-models/error.control-model.js +13 -13
  34. package/lib/_models/control-models/error.control-model.js.map +1 -1
  35. package/lib/_models/control-models/error.control-model.spec.js +9 -9
  36. package/lib/_models/control-models/error.control-model.spec.js.map +1 -1
  37. package/lib/_models/control-models/index.d.ts +1 -1
  38. package/lib/_models/control-models/index.d.ts.map +1 -1
  39. package/lib/_models/control-models/index.js +1 -1
  40. package/lib/_models/control-models/index.js.map +1 -1
  41. package/lib/_models/control-models/range-value.control-model.d.ts +14 -14
  42. package/lib/_models/control-models/range-value.control-model.d.ts.map +1 -1
  43. package/lib/_models/control-models/range-value.control-model.js +3 -3
  44. package/lib/_models/control-models/range-value.control-model.js.map +1 -1
  45. package/lib/_models/data-models/custom-data.data-model.d.ts +5 -5
  46. package/lib/_models/data-models/custom-data.data-model.d.ts.map +1 -1
  47. package/lib/_models/data-models/custom-data.data-model.js +3 -3
  48. package/lib/_models/data-models/custom-data.data-model.js.map +1 -1
  49. package/lib/_models/data-models/metadata.data-model.d.ts +1 -0
  50. package/lib/_models/data-models/metadata.data-model.d.ts.map +1 -1
  51. package/lib/_models/data-models/metadata.data-model.js +18 -0
  52. package/lib/_models/data-models/metadata.data-model.js.map +1 -1
  53. package/lib/_models/data-models/usage-session.data-model.d.ts +4 -4
  54. package/lib/_models/data-models/usage-session.data-model.d.ts.map +1 -1
  55. package/lib/_models/data-models/usage-session.data-model.js +3 -3
  56. package/lib/_models/data-models/usage-session.data-model.js.map +1 -1
  57. package/lib/_models/interfaces/location/country-division.interface.d.ts +1 -1
  58. package/lib/_models/interfaces/location/country-division.interface.d.ts.map +1 -1
  59. package/lib/_models/interfaces/location/country-iso.interface.d.ts +3 -3
  60. package/lib/_models/interfaces/location/country-iso.interface.d.ts.map +1 -1
  61. package/lib/_models/interfaces/location/country-phone-code.interface.d.ts +1 -1
  62. package/lib/_models/interfaces/location/country-phone-code.interface.d.ts.map +1 -1
  63. package/lib/_models/interfaces/location/division-collection.interface.d.ts +1 -1
  64. package/lib/_models/interfaces/location/division-collection.interface.d.ts.map +1 -1
  65. package/lib/_models/interfaces/location/division-region-data.interface.d.ts +2 -2
  66. package/lib/_models/interfaces/location/division-region-data.interface.d.ts.map +1 -1
  67. package/lib/_models/interfaces/location/geo-ip-location.interface.d.ts +1 -1
  68. package/lib/_models/interfaces/location/geo-ip-location.interface.d.ts.map +1 -1
  69. package/lib/_models/interfaces/location/location-coordinates.interface.d.ts +1 -1
  70. package/lib/_models/interfaces/location/location-coordinates.interface.d.ts.map +1 -1
  71. package/lib/_models/interfaces/random-weight.interface.d.ts +1 -1
  72. package/lib/_models/interfaces/random-weight.interface.d.ts.map +1 -1
  73. package/lib/_models/interfaces/route-settings.interface.d.ts +3 -3
  74. package/lib/_models/interfaces/route-settings.interface.d.ts.map +1 -1
  75. package/lib/_modules/data-modules.index.d.ts +1 -1
  76. package/lib/_modules/data-modules.index.d.ts.map +1 -1
  77. package/lib/_modules/data-modules.index.js +1 -1
  78. package/lib/_modules/data-modules.index.js.map +1 -1
  79. package/lib/_utils/array.util.d.ts +1 -1
  80. package/lib/_utils/array.util.d.ts.map +1 -1
  81. package/lib/_utils/array.util.js +2 -2
  82. package/lib/_utils/array.util.js.map +1 -1
  83. package/lib/_utils/array.util.spec.js +3 -3
  84. package/lib/_utils/array.util.spec.js.map +1 -1
  85. package/lib/_utils/box-bounds.util.d.ts +13 -12
  86. package/lib/_utils/box-bounds.util.d.ts.map +1 -1
  87. package/lib/_utils/box-bounds.util.js +10 -7
  88. package/lib/_utils/box-bounds.util.js.map +1 -1
  89. package/lib/_utils/location.util.d.ts +2 -2
  90. package/lib/_utils/location.util.d.ts.map +1 -1
  91. package/lib/_utils/location.util.js.map +1 -1
  92. package/lib/_utils/metadata.util.d.ts +1 -4
  93. package/lib/_utils/metadata.util.d.ts.map +1 -1
  94. package/lib/_utils/metadata.util.js +27 -20
  95. package/lib/_utils/metadata.util.js.map +1 -1
  96. package/lib/_utils/random.util.d.ts +3 -3
  97. package/lib/_utils/random.util.d.ts.map +1 -1
  98. package/lib/_utils/random.util.js.map +1 -1
  99. package/lib/_utils/regex/password-regex.util.d.ts +1 -1
  100. package/lib/_utils/regex/password-regex.util.d.ts.map +1 -1
  101. package/lib/_utils/regex/password-regex.util.js +3 -3
  102. package/lib/_utils/regex/password-regex.util.js.map +1 -1
  103. package/lib/_utils/regex/username-regex.util.d.ts +1 -1
  104. package/lib/_utils/regex/username-regex.util.d.ts.map +1 -1
  105. package/lib/_utils/regex/username-regex.util.js +2 -2
  106. package/lib/_utils/regex/username-regex.util.js.map +1 -1
  107. package/lib/_utils/regex.util.d.ts +1 -1
  108. package/lib/_utils/regex.util.d.ts.map +1 -1
  109. package/lib/_utils/regex.util.js +2 -2
  110. package/lib/_utils/regex.util.js.map +1 -1
  111. package/lib/_utils/regions.util.d.ts +8 -8
  112. package/lib/_utils/regions.util.d.ts.map +1 -1
  113. package/lib/_utils/regions.util.js +3 -3
  114. package/lib/_utils/regions.util.js.map +1 -1
  115. package/lib/_utils/shared.static-service.js +5 -5
  116. package/lib/_utils/shared.static-service.js.map +1 -1
  117. package/lib/_utils/time.util.d.ts +7 -0
  118. package/lib/_utils/time.util.d.ts.map +1 -1
  119. package/lib/_utils/time.util.js +7 -0
  120. package/lib/_utils/time.util.js.map +1 -1
  121. package/lib/_utils/utilities.util.d.ts +24 -12
  122. package/lib/_utils/utilities.util.d.ts.map +1 -1
  123. package/lib/_utils/utilities.util.js +34 -22
  124. package/lib/_utils/utilities.util.js.map +1 -1
  125. package/lib/_utils/vector2.util.d.ts +45 -43
  126. package/lib/_utils/vector2.util.d.ts.map +1 -1
  127. package/lib/_utils/vector2.util.js +47 -37
  128. package/lib/_utils/vector2.util.js.map +1 -1
  129. package/lib/tsconfig.tsbuildinfo +1 -1
  130. package/package.json +2 -1
  131. package/src/_constants/error-defaults.const.ts +1 -1
  132. package/src/_constants/module-settings/custom-data-module-settings.const.ts +2 -2
  133. package/src/_constants/module-settings/test-module-settings.const.ts +2 -2
  134. package/src/_constants/module-settings/usage-module-settings.const.ts +2 -2
  135. package/src/_enums/data-model-type.enum.ts +10 -3
  136. package/src/_enums/day-of-week.enum.ts +3 -2
  137. package/src/_models/control-models/data-model-params.control-model.ts +39 -0
  138. package/src/_models/control-models/data-property-params.control-model.ts +23 -9
  139. package/src/_models/control-models/error.control-model.spec.ts +10 -10
  140. package/src/_models/control-models/error.control-model.ts +14 -14
  141. package/src/_models/control-models/index.ts +1 -1
  142. package/src/_models/control-models/range-value.control-model.ts +17 -16
  143. package/src/_models/data-models/custom-data.data-model.ts +6 -6
  144. package/src/_models/data-models/metadata.data-model.ts +24 -0
  145. package/src/_models/data-models/usage-session.data-model.ts +5 -5
  146. package/src/_models/interfaces/location/country-division.interface.ts +1 -1
  147. package/src/_models/interfaces/location/country-iso.interface.ts +3 -3
  148. package/src/_models/interfaces/location/country-phone-code.interface.ts +1 -1
  149. package/src/_models/interfaces/location/division-collection.interface.ts +1 -1
  150. package/src/_models/interfaces/location/division-region-data.interface.ts +2 -2
  151. package/src/_models/interfaces/location/geo-ip-location.interface.ts +1 -1
  152. package/src/_models/interfaces/location/location-coordinates.interface.ts +1 -1
  153. package/src/_models/interfaces/random-weight.interface.ts +1 -1
  154. package/src/_models/interfaces/route-settings.interface.ts +3 -3
  155. package/src/_modules/data-modules.index.ts +1 -1
  156. package/src/_utils/array.util.spec.ts +4 -4
  157. package/src/_utils/array.util.ts +2 -2
  158. package/src/_utils/box-bounds.util.ts +24 -20
  159. package/src/_utils/location.util.ts +3 -3
  160. package/src/_utils/metadata.util.ts +2 -1
  161. package/src/_utils/random.util.ts +3 -3
  162. package/src/_utils/regex/password-regex.util.ts +1 -1
  163. package/src/_utils/regex/username-regex.util.ts +1 -1
  164. package/src/_utils/regex.util.ts +3 -1
  165. package/src/_utils/regions.util.ts +22 -22
  166. package/src/_utils/shared.static-service.ts +6 -6
  167. package/src/_utils/time.util.ts +9 -1
  168. package/src/_utils/utilities.util.ts +25 -13
  169. package/src/_utils/vector2.util.ts +85 -73
  170. package/lib/_models/control-models/data-params.control-model.d.ts +0 -13
  171. package/lib/_models/control-models/data-params.control-model.d.ts.map +0 -1
  172. package/lib/_models/control-models/data-params.control-model.js +0 -23
  173. package/lib/_models/control-models/data-params.control-model.js.map +0 -1
  174. package/src/_models/control-models/data-params.control-model.ts +0 -27
@@ -1,36 +1,36 @@
1
1
 
2
2
 
3
- import { Vector2 } from './vector2.util';
3
+ import { Dynamo_Vector2 } from './vector2.util';
4
4
 
5
- export class BoxBounds {
6
- private _pos: Vector2;
7
- set pos(value: Vector2) {
5
+ export class Dynamo_BoxBounds {
6
+ private _pos: Dynamo_Vector2;
7
+ set pos(value: Dynamo_Vector2) {
8
8
  this._pos = value;
9
9
 
10
10
  this.calcCenter();
11
11
  }
12
- get pos(): Vector2 {
12
+ get pos(): Dynamo_Vector2 {
13
13
  return this._pos;
14
14
  }
15
15
 
16
- private _size: Vector2;
17
- set size(value: Vector2) {
16
+ private _size: Dynamo_Vector2;
17
+ set size(value: Dynamo_Vector2) {
18
18
  this._size = value;
19
19
 
20
20
  this.calcCenter();
21
21
  }
22
- get size(): Vector2 {
22
+ get size(): Dynamo_Vector2 {
23
23
  return this._size;
24
24
  }
25
25
 
26
- private _center: Vector2;
27
- get center(): Vector2 {
26
+ private _center: Dynamo_Vector2;
27
+ get center(): Dynamo_Vector2 {
28
28
  return this._center;
29
29
  }
30
30
 
31
31
  constructor(
32
- position: Vector2 = new Vector2(),
33
- size: Vector2 = new Vector2()
32
+ position: Dynamo_Vector2 = new Dynamo_Vector2(),
33
+ size: Dynamo_Vector2 = new Dynamo_Vector2()
34
34
  ) {
35
35
  this._pos = position;
36
36
  this._size = size;
@@ -38,7 +38,11 @@ export class BoxBounds {
38
38
  this.calcCenter();
39
39
  }
40
40
 
41
- newValues(position: Vector2, size: Vector2): void {
41
+ constructed?(): boolean {
42
+ return true;
43
+ }
44
+
45
+ newValues?(position: Dynamo_Vector2, size: Dynamo_Vector2): void {
42
46
  if (position === undefined) {
43
47
  throw new Error('new position is undefined!');
44
48
  }
@@ -53,20 +57,20 @@ export class BoxBounds {
53
57
  this.calcCenter();
54
58
  }
55
59
 
56
- static bounds(box: BoxBounds, position: Vector2): boolean {
60
+ static bounds(box: Dynamo_BoxBounds, position: Dynamo_Vector2): boolean {
57
61
  return box.pos.x <= position.x && position.x <= box.pos.x + box.size.x &&
58
62
  box.pos.y <= position.y && position.y <= box.pos.y + box.size.y;
59
63
  }
60
- bounds(position: Vector2): boolean {
61
- return BoxBounds.bounds(this, position);
64
+ bounds?(position: Dynamo_Vector2): boolean {
65
+ return Dynamo_BoxBounds.bounds(this, position);
62
66
  }
63
67
 
64
- private calcCenter(): void {
65
- this._center = Vector2.plus(this.pos, Vector2.divide(this.size, 2));
68
+ private calcCenter?(): void {
69
+ this._center = Dynamo_Vector2.plus(this.pos, Dynamo_Vector2.divide(this.size, 2));
66
70
  }
67
71
 
68
- clone(): BoxBounds {
69
- return new BoxBounds(this.pos.clone(), this.size.clone());
72
+ clone?(): Dynamo_BoxBounds {
73
+ return new Dynamo_BoxBounds(this.pos.clone(), this.size.clone());
70
74
  }
71
75
  }
72
76
 
@@ -1,14 +1,14 @@
1
1
 
2
2
  import { Dynamo_Error } from '../_models/control-models/error.control-model';
3
3
  import { Dynamo_Trigonometry } from './trigonometry.util';
4
- import { LocationCoordinates } from '../_models/interfaces/location/location-coordinates.interface';
4
+ import { Dynamo_LocationCoordinates } from '../_models/interfaces/location/location-coordinates.interface';
5
5
 
6
6
  export type D_Location = Dynamo_Location;
7
7
  export class Dynamo_Location {
8
8
 
9
9
  static getDistanceInKilometres(
10
- from: LocationCoordinates,
11
- to: LocationCoordinates
10
+ from: Dynamo_LocationCoordinates,
11
+ to: Dynamo_LocationCoordinates
12
12
  ): number {
13
13
 
14
14
  const R = 6371; // kilometres
@@ -1,6 +1,6 @@
1
1
  import { Dynamo_Metadata } from '../_models';
2
2
 
3
-
3
+ /*
4
4
  export class Dynamo_Metadata_Tool {
5
5
 
6
6
  static updateMetadata<T extends Dynamo_Metadata>(data: T, issuer: string, id?: string): T {
@@ -28,3 +28,4 @@ export class Dynamo_Metadata_Tool {
28
28
  }
29
29
  }
30
30
 
31
+ */
@@ -1,9 +1,9 @@
1
1
 
2
- import { RandomWeight } from '../_models/interfaces/random-weight.interface';
2
+ import { Dynamo_RandomWeight } from '../_models/interfaces/random-weight.interface';
3
3
 
4
4
  export type D_Random = Dynamo_Random;
5
5
  export class Dynamo_Random {
6
- static getRandomWeightedInt(min: number, max: number, weights: RandomWeight<number>[]): number {
6
+ static getRandomWeightedInt(min: number, max: number, weights: Dynamo_RandomWeight<number>[]): number {
7
7
  weights = weights.sort((a, b): number => b.chance - a.chance);
8
8
  let weightChanceSum = 0;
9
9
 
@@ -44,7 +44,7 @@ export class Dynamo_Random {
44
44
  }
45
45
  }
46
46
 
47
- static getRandomWeighted<T>(weights: RandomWeight<T>[]): T {
47
+ static getRandomWeighted<T>(weights: Dynamo_RandomWeight<T>[]): T {
48
48
  if (!weights?.length) {
49
49
  return null;
50
50
  }
@@ -10,7 +10,7 @@ export const Dynamo_passwordRegex: RegExp = new RegExp(
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 getPasswordErrors(password: string): string[] {
13
+ export function Dynamo_getPasswordErrors(password: string): string[] {
14
14
  const errors: string[] = [];
15
15
 
16
16
  passwordErrorsOneByOne.forEach((error) => {
@@ -1,5 +1,5 @@
1
1
 
2
- export const FDP_usernameRegex: RegExp = new RegExp('^[a-zA-Z0-9-_#$%&^|*]{6,}$');
2
+ export const Dynamo_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, ' +
@@ -1,4 +1,6 @@
1
1
 
2
2
 
3
- export const emailRegex: RegExp = new RegExp('^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+$');
3
+ export const Dynamo_emailRegex: RegExp = new RegExp(
4
+ '^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+$'
5
+ );
4
6
 
@@ -6,44 +6,44 @@ import * as Divisions from '../_constants/location/country-divisions-ISO-3166-al
6
6
 
7
7
  import { Dynamo_Region } from '../_enums/region.enum';
8
8
  import { Dynamo_Error } from '../_models';
9
- import { CountryPhoneCode } from '../_models/interfaces/location/country-phone-code.interface';
10
- import { CountryISO } from '../_models/interfaces/location/country-iso.interface';
11
- import { CountryDivision } from '../_models/interfaces/location/country-division.interface';
9
+ import { Dynamo_CountryPhoneCode } from '../_models/interfaces/location/country-phone-code.interface';
10
+ import { Dynamo_CountryISO } from '../_models/interfaces/location/country-iso.interface';
11
+ import { Dynamo_CountryDivision } from '../_models/interfaces/location/country-division.interface';
12
12
 
13
- import { JSONListify } from './utilities.util';
13
+ import { Dynamo_JSONListify } from './utilities.util';
14
14
 
15
15
  export type D_Regions = Dynamo_Regions;
16
16
  export class Dynamo_Regions {
17
17
  /* static divisions: DivisionCollection = Dynamo_Regions.getSubdivisionCollection(); */
18
- static divisions: CountryDivision[] = Dynamo_Regions.getAllDivisions();
19
- static phoneCodes: CountryPhoneCode[] = Dynamo_Regions.getAllPhoneCodes();
20
- static ISOs: CountryISO[] = Dynamo_Regions.getAllCountryISO();
18
+ static divisions: Dynamo_CountryDivision[] = Dynamo_Regions.getAllDivisions();
19
+ static phoneCodes: Dynamo_CountryPhoneCode[] = Dynamo_Regions.getAllPhoneCodes();
20
+ static ISOs: Dynamo_CountryISO[] = Dynamo_Regions.getAllCountryISO();
21
21
 
22
- private static getAllDivisions(): CountryDivision[] {
23
- return JSONListify(Divisions);
22
+ private static getAllDivisions(): Dynamo_CountryDivision[] {
23
+ return Dynamo_JSONListify(Divisions);
24
24
  }
25
- private static getAllPhoneCodes(): CountryPhoneCode[] {
26
- return JSONListify(PhoneCodes);
25
+ private static getAllPhoneCodes(): Dynamo_CountryPhoneCode[] {
26
+ return Dynamo_JSONListify(PhoneCodes);
27
27
  }
28
28
 
29
29
  /* private static getSubdivisionCollection(): DivisionCollection {
30
30
  return Divisions as DivisionCollection;
31
31
  } */
32
- private static getAllCountryISO(): CountryISO[] {
33
- const result: CountryISO[] = JSONListify(ISOs);
32
+ private static getAllCountryISO(): Dynamo_CountryISO[] {
33
+ const result: Dynamo_CountryISO[] = Dynamo_JSONListify(ISOs);
34
34
 
35
- result.forEach((iso: CountryISO): void => {
35
+ result.forEach((iso: Dynamo_CountryISO): void => {
36
36
  iso.phoneCode = this.phoneCodes.find(
37
- (pc: CountryPhoneCode): boolean => pc.iso === iso.iso2
37
+ (pc: Dynamo_CountryPhoneCode): boolean => pc.iso === iso.iso2
38
38
  )?.code;
39
- iso.divisions = this.divisions.filter((d: CountryDivision): boolean => d.iso === iso.iso2);
39
+ iso.divisions = this.divisions.filter((d: Dynamo_CountryDivision): boolean => d.iso === iso.iso2);
40
40
  });
41
41
 
42
42
  return result;
43
43
  }
44
44
 
45
- static isoToCountryIso(iso2: string): CountryISO {
46
- const country: CountryISO = this.ISOs.find((iso: CountryISO): boolean => iso.iso2 == iso2);
45
+ static isoToCountryIso(iso2: string): Dynamo_CountryISO {
46
+ const country: Dynamo_CountryISO = this.ISOs.find((iso: Dynamo_CountryISO): boolean => iso.iso2 == iso2);
47
47
 
48
48
  if (!country) {
49
49
  throw new Dynamo_Error({
@@ -56,7 +56,7 @@ export class Dynamo_Regions {
56
56
 
57
57
  static isoToRegion(iso2: string): Dynamo_Region {
58
58
  const region: Dynamo_Region = this.ISOs.find(
59
- (iso: CountryISO): boolean => iso.iso2 == iso2
59
+ (iso: Dynamo_CountryISO): boolean => iso.iso2 == iso2
60
60
  )?.region;
61
61
 
62
62
  if (!region) {
@@ -68,9 +68,9 @@ export class Dynamo_Regions {
68
68
  }
69
69
  }
70
70
 
71
- static isoToPhoneCode(iso2: string): CountryPhoneCode {
72
- const phoneCode: CountryPhoneCode = this.phoneCodes.find(
73
- (code: CountryPhoneCode): boolean => code.iso == iso2
71
+ static isoToPhoneCode(iso2: string): Dynamo_CountryPhoneCode {
72
+ const phoneCode: Dynamo_CountryPhoneCode = this.phoneCodes.find(
73
+ (code: Dynamo_CountryPhoneCode): boolean => code.iso == iso2
74
74
  );
75
75
 
76
76
  if (!phoneCode) {
@@ -1,5 +1,5 @@
1
1
 
2
- import { clone } from './utilities.util';
2
+ import { Dynamo_clone } from './utilities.util';
3
3
 
4
4
  export type D_Shared = Dynamo_Shared;
5
5
  export class Dynamo_Shared {
@@ -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 = clone(parentObj); // {...parentObj};
58
+ let newData = Dynamo_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 = clone(parentObj); // {...parentObj};
77
+ const newData = Dynamo_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 = clone(parentObj); // {...parentObj};
99
+ const newData = Dynamo_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 = clone(parentObj); // {...parentObj};
121
+ const newData = Dynamo_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 = clone(parentObj); // parentObj; // {...parentObj};
153
+ const newData = Dynamo_clone(parentObj); // parentObj; // {...parentObj};
154
154
 
155
155
  if (nestIndexes.length > 1) {
156
156
  const indexes = [...nestIndexes];
@@ -1,5 +1,5 @@
1
1
 
2
- import { day, hour, month, week, year } from '../_constants/times.const';
2
+ import { day, hour, minute, month, second, week, year } from '../_constants/times.const';
3
3
  import { Dynamo_Month } from '../_enums';
4
4
  import { Dynamo_DayOfWeek } from '../_enums/day-of-week.enum';
5
5
  import { Dynamo_RelativeDate } from '../_enums/relative-date.enum';
@@ -8,6 +8,14 @@ export type D_Time = Dynamo_Time;
8
8
  export type D_T = Dynamo_Time;
9
9
  export class Dynamo_Time {
10
10
 
11
+ static readonly second = second;
12
+ static readonly minute = minute;
13
+ static readonly hour = hour;
14
+ static readonly day = day;
15
+ static readonly week = week;
16
+ static readonly month = month;
17
+ static readonly year = year;
18
+
11
19
  static getAge(birthDate: Date | number | string): number {
12
20
  return this.getYear(+new Date() - +new Date(birthDate));
13
21
  }
@@ -4,7 +4,7 @@ const defaultErrorMsg = ' failed. ' +
4
4
  'containes object hooks for its own objects, therefore its creating an object loop. ' +
5
5
  'See further information in the detailed error:\n\n';
6
6
 
7
- export function clone<T>(object: T): T {
7
+ export function Dynamo_clone<T>(object: T): T {
8
8
  try {
9
9
  return object ? JSON.parse(JSON.stringify(object)) as T : object;
10
10
  } catch (error) {
@@ -16,9 +16,11 @@ export function clone<T>(object: T): T {
16
16
  throw error;
17
17
  }
18
18
  }
19
- export const copy = clone;
19
+ export const Dynamo_copy = Dynamo_clone;
20
+ export const D_clone = Dynamo_clone;
21
+ export const D_copy = Dynamo_clone;
20
22
 
21
- export function surfaceClone<T>(object: T): T {
23
+ export function Dynamo_surfaceClone<T>(object: T): T {
22
24
  try {
23
25
  const result = {};
24
26
 
@@ -36,9 +38,11 @@ export function surfaceClone<T>(object: T): T {
36
38
  throw error;
37
39
  }
38
40
  }
39
- export const surfaceCopy = surfaceClone;
41
+ export const Dynamo_surfaceCopy = Dynamo_surfaceClone;
42
+ export const D_surfaceClone = Dynamo_surfaceClone;
43
+ export const D_surfaceCopy = Dynamo_surfaceClone;
40
44
 
41
- export function sameObjects<T>(objA: T, objB: T): boolean {
45
+ export function Dynamo_sameObjects<T>(objA: T, objB: T): boolean {
42
46
  try {
43
47
  return JSON.stringify(objA) === JSON.stringify(objB);
44
48
  } catch (error) {
@@ -50,25 +54,30 @@ export function sameObjects<T>(objA: T, objB: T): boolean {
50
54
  throw error;
51
55
  }
52
56
  }
57
+ export const D_sameObjects = Dynamo_sameObjects;
53
58
 
54
59
  /**
55
60
  * sets values if its existing on To, even if its null (but if undefined)
56
61
  * @param setOn
57
62
  * @param setTo
58
63
  */
59
- export function setExisitngValuesOnly(setOn: any, setTo: any): void {
64
+ export function Dynamo_setExisitngValuesOnly(setOn: any, setTo: any): void {
60
65
  for (const key in setTo) {
61
66
  if (setTo[key] != undefined) {
62
67
  setOn[key] = setTo[key];
63
68
  }
64
69
  }
65
70
  }
71
+ export const D_setExisitngValuesOnly = Dynamo_setExisitngValuesOnly;
66
72
 
67
- export function delay(ms: number): Promise<void> {
73
+ export function Dynamo_delay(ms: number): Promise<void> {
68
74
  return new Promise((resolve): any => setTimeout(resolve, ms));
69
75
  }
70
- export const sleep = delay;
71
- export const wait = delay;
76
+ export const Dynamo_sleep = Dynamo_delay;
77
+ export const Dynamo_wait = Dynamo_delay;
78
+ export const D_delay = Dynamo_delay;
79
+ export const D_sleep = Dynamo_delay;
80
+ export const D_wait = Dynamo_delay;
72
81
 
73
82
  export type Dynamo_SortDirection = 0 | 1 | -1
74
83
 
@@ -83,11 +92,12 @@ export type Dynamo_SortDirection = 0 | 1 | -1
83
92
  * @example
84
93
  * codes.sort((a,b) => sortForTrue(a,b,(c: Code) => c.haveImg));
85
94
  */
86
- export function sortForTrue<T>(a: T, b: T, check: (a: T) => boolean): Dynamo_SortDirection {
95
+ export function Dynamo_sortForTrue<T>(a: T, b: T, check: (a: T) => boolean): Dynamo_SortDirection {
87
96
  const isA = check(a);
88
97
 
89
98
  return isA === check(b) ? 0 : isA ? -1 : 1;
90
99
  }
100
+ export const D_sortForTrue = Dynamo_sortForTrue;
91
101
 
92
102
  /**
93
103
  *
@@ -97,12 +107,13 @@ export function sortForTrue<T>(a: T, b: T, check: (a: T) => boolean): Dynamo_Sor
97
107
  * @example
98
108
  * codes.sort(getSortForTrueFn((c: Code) => c.haveImg));
99
109
  */
100
- export function getSortForTrueFn<T>(
110
+ export function Dynamo_getSortForTrueFn<T>(
101
111
  checkFor: (a: T) => boolean): (a: T, b: T) => Dynamo_SortDirection {
102
- return (a: T, b: T): Dynamo_SortDirection => sortForTrue<T>(a, b, checkFor);
112
+ return (a: T, b: T): Dynamo_SortDirection => Dynamo_sortForTrue<T>(a, b, checkFor);
103
113
  }
114
+ export const D_getSortForTrueFn = Dynamo_getSortForTrueFn;
104
115
 
105
- export function JSONListify<T>(JSONList): T[] {
116
+ export function Dynamo_JSONListify<T>(JSONList): T[] {
106
117
  const result: T[] = [];
107
118
 
108
119
  for (let i = 0; JSONList[i]; i++) {
@@ -111,4 +122,5 @@ export function JSONListify<T>(JSONList): T[] {
111
122
 
112
123
  return result;
113
124
  }
125
+ export const D_JSONListify = Dynamo_JSONListify;
114
126