@futdevpro/fsm-dynamo 1.10.37 → 1.10.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) hide show
  1. package/.github/workflows/main.yml +11 -51
  2. package/build/_collections/constants/error-defaults.const.d.ts +8 -0
  3. package/build/_collections/constants/error-defaults.const.d.ts.map +1 -1
  4. package/build/_collections/constants/error-defaults.const.js +8 -0
  5. package/build/_collections/constants/error-defaults.const.js.map +1 -1
  6. package/build/_collections/constants/global-settings.const.d.ts +8 -0
  7. package/build/_collections/constants/global-settings.const.d.ts.map +1 -1
  8. package/build/_collections/constants/global-settings.const.js +9 -0
  9. package/build/_collections/constants/global-settings.const.js.map +1 -1
  10. package/build/_collections/constants/numbers.const.d.ts +32 -0
  11. package/build/_collections/constants/numbers.const.d.ts.map +1 -1
  12. package/build/_collections/constants/numbers.const.js +32 -0
  13. package/build/_collections/constants/numbers.const.js.map +1 -1
  14. package/build/_collections/constants/times.const.d.ts +31 -0
  15. package/build/_collections/constants/times.const.d.ts.map +1 -1
  16. package/build/_collections/constants/times.const.js +31 -0
  17. package/build/_collections/constants/times.const.js.map +1 -1
  18. package/build/_collections/utils/array.util.d.ts +136 -7
  19. package/build/_collections/utils/array.util.d.ts.map +1 -1
  20. package/build/_collections/utils/array.util.js +132 -2
  21. package/build/_collections/utils/array.util.js.map +1 -1
  22. package/build/_collections/utils/array.util.spec.js.map +1 -1
  23. package/build/_collections/utils/log.util.d.ts +123 -0
  24. package/build/_collections/utils/log.util.d.ts.map +1 -1
  25. package/build/_collections/utils/log.util.js +123 -0
  26. package/build/_collections/utils/log.util.js.map +1 -1
  27. package/build/_collections/utils/math/box-bounds.spec.js +2 -5
  28. package/build/_collections/utils/math/box-bounds.spec.js.map +1 -1
  29. package/build/_collections/utils/math/box-bounds.util.d.ts +52 -6
  30. package/build/_collections/utils/math/box-bounds.util.d.ts.map +1 -1
  31. package/build/_collections/utils/math/box-bounds.util.js +57 -5
  32. package/build/_collections/utils/math/box-bounds.util.js.map +1 -1
  33. package/build/_collections/utils/math/box-bounds.util.spec.js +1 -1
  34. package/build/_collections/utils/math/box-bounds.util.spec.js.map +1 -1
  35. package/build/_collections/utils/math/math.util.d.ts +30 -0
  36. package/build/_collections/utils/math/math.util.d.ts.map +1 -1
  37. package/build/_collections/utils/math/math.util.js +30 -0
  38. package/build/_collections/utils/math/math.util.js.map +1 -1
  39. package/build/_collections/utils/math/random.util.d.ts +19 -2
  40. package/build/_collections/utils/math/random.util.d.ts.map +1 -1
  41. package/build/_collections/utils/math/random.util.js +22 -0
  42. package/build/_collections/utils/math/random.util.js.map +1 -1
  43. package/build/_collections/utils/math/random.util.spec.js.map +1 -1
  44. package/build/_collections/utils/math/vector2.util.d.ts +142 -20
  45. package/build/_collections/utils/math/vector2.util.d.ts.map +1 -1
  46. package/build/_collections/utils/math/vector2.util.js +126 -0
  47. package/build/_collections/utils/math/vector2.util.js.map +1 -1
  48. package/build/_collections/utils/round-list.util.d.ts +36 -1
  49. package/build/_collections/utils/round-list.util.d.ts.map +1 -1
  50. package/build/_collections/utils/round-list.util.js +35 -0
  51. package/build/_collections/utils/round-list.util.js.map +1 -1
  52. package/build/_collections/utils/shared.util.js.map +1 -1
  53. package/build/_collections/utils/stack.util.js +3 -3
  54. package/build/_collections/utils/stack.util.js.map +1 -1
  55. package/build/_collections/utils/string.util.d.ts +8 -1
  56. package/build/_collections/utils/string.util.d.ts.map +1 -1
  57. package/build/_collections/utils/string.util.js +8 -1
  58. package/build/_collections/utils/string.util.js.map +1 -1
  59. package/build/_collections/utils/time.util.d.ts +29 -0
  60. package/build/_collections/utils/time.util.d.ts.map +1 -1
  61. package/build/_collections/utils/time.util.js +29 -0
  62. package/build/_collections/utils/time.util.js.map +1 -1
  63. package/build/_collections/utils/type-cloning-facility.util.d.ts +29 -3
  64. package/build/_collections/utils/type-cloning-facility.util.d.ts.map +1 -1
  65. package/build/_collections/utils/type-cloning-facility.util.js +53 -3
  66. package/build/_collections/utils/type-cloning-facility.util.js.map +1 -1
  67. package/build/_collections/utils/utilities.util.d.ts +49 -2
  68. package/build/_collections/utils/utilities.util.d.ts.map +1 -1
  69. package/build/_collections/utils/utilities.util.js +53 -1
  70. package/build/_collections/utils/utilities.util.js.map +1 -1
  71. package/build/_collections/utils/utilities.util.spec.js.map +1 -1
  72. package/build/_collections/utils/uuid.util.d.ts +5 -0
  73. package/build/_collections/utils/uuid.util.d.ts.map +1 -1
  74. package/build/_collections/utils/uuid.util.js +5 -0
  75. package/build/_collections/utils/uuid.util.js.map +1 -1
  76. package/build/_enums/basic-property-type.enum.d.ts +8 -0
  77. package/build/_enums/basic-property-type.enum.d.ts.map +1 -1
  78. package/build/_enums/basic-property-type.enum.js +8 -0
  79. package/build/_enums/basic-property-type.enum.js.map +1 -1
  80. package/build/_enums/data-model-type.enum.d.ts +8 -4
  81. package/build/_enums/data-model-type.enum.d.ts.map +1 -1
  82. package/build/_enums/data-model-type.enum.js +8 -4
  83. package/build/_enums/data-model-type.enum.js.map +1 -1
  84. package/build/_enums/environment-flag.enum.d.ts +18 -0
  85. package/build/_enums/environment-flag.enum.d.ts.map +1 -1
  86. package/build/_enums/environment-flag.enum.js +18 -0
  87. package/build/_enums/environment-flag.enum.js.map +1 -1
  88. package/build/_enums/error-level.enum.d.ts +10 -0
  89. package/build/_enums/error-level.enum.d.ts.map +1 -1
  90. package/build/_enums/error-level.enum.js +10 -0
  91. package/build/_enums/error-level.enum.js.map +1 -1
  92. package/build/_enums/http-call-type.enum.d.ts +6 -2
  93. package/build/_enums/http-call-type.enum.d.ts.map +1 -1
  94. package/build/_enums/http-call-type.enum.js +6 -2
  95. package/build/_enums/http-call-type.enum.js.map +1 -1
  96. package/build/_enums/http-response-type.enum.d.ts +8 -0
  97. package/build/_enums/http-response-type.enum.d.ts.map +1 -1
  98. package/build/_enums/http-response-type.enum.js +8 -0
  99. package/build/_enums/http-response-type.enum.js.map +1 -1
  100. package/build/_enums/log-style.enum.d.ts +8 -0
  101. package/build/_enums/log-style.enum.d.ts.map +1 -1
  102. package/build/_enums/log-style.enum.js +8 -0
  103. package/build/_enums/log-style.enum.js.map +1 -1
  104. package/build/_enums/time/day-of-week.enum.d.ts +13 -1
  105. package/build/_enums/time/day-of-week.enum.d.ts.map +1 -1
  106. package/build/_enums/time/day-of-week.enum.js +13 -1
  107. package/build/_enums/time/day-of-week.enum.js.map +1 -1
  108. package/build/_enums/time/month.enum.d.ts +8 -0
  109. package/build/_enums/time/month.enum.d.ts.map +1 -1
  110. package/build/_enums/time/month.enum.js +8 -0
  111. package/build/_enums/time/month.enum.js.map +1 -1
  112. package/build/_enums/time/relative-date.enum.d.ts +10 -0
  113. package/build/_enums/time/relative-date.enum.d.ts.map +1 -1
  114. package/build/_enums/time/relative-date.enum.js +10 -0
  115. package/build/_enums/time/relative-date.enum.js.map +1 -1
  116. package/build/_models/control-models/data-model-params.control-model.d.ts +4 -4
  117. package/build/_models/control-models/data-model-params.control-model.d.ts.map +1 -1
  118. package/build/_models/control-models/data-model-params.control-model.js.map +1 -1
  119. package/build/_models/control-models/data-property-params.control-model.d.ts.map +1 -1
  120. package/build/_models/control-models/data-property-params.control-model.js.map +1 -1
  121. package/build/_models/control-models/error.control-model.spec.js.map +1 -1
  122. package/build/_models/interfaces/box-bounds.interface.d.ts +8 -0
  123. package/build/_models/interfaces/box-bounds.interface.d.ts.map +1 -0
  124. package/build/_models/interfaces/box-bounds.interface.js +3 -0
  125. package/build/_models/interfaces/box-bounds.interface.js.map +1 -0
  126. package/build/_models/interfaces/environment/global-settings.interface.d.ts +1 -0
  127. package/build/_models/interfaces/environment/global-settings.interface.d.ts.map +1 -1
  128. package/build/_models/interfaces/route-settings.interface.d.ts +6 -1
  129. package/build/_models/interfaces/route-settings.interface.d.ts.map +1 -1
  130. package/build/_modules/crypto/_collections/crypto.util.d.ts +11 -17
  131. package/build/_modules/crypto/_collections/crypto.util.d.ts.map +1 -1
  132. package/build/_modules/crypto/_collections/crypto.util.js +74 -58
  133. package/build/_modules/crypto/_collections/crypto.util.js.map +1 -1
  134. package/build/_modules/crypto/_collections/crypto.util.spec.js +390 -0
  135. package/build/_modules/crypto/_collections/crypto.util.spec.js.map +1 -1
  136. package/build/_modules/custom-data/_collections/cud-module-settings.const.d.ts +6 -0
  137. package/build/_modules/custom-data/_collections/cud-module-settings.const.d.ts.map +1 -1
  138. package/build/_modules/custom-data/_collections/cud-module-settings.const.js +6 -0
  139. package/build/_modules/custom-data/_collections/cud-module-settings.const.js.map +1 -1
  140. package/build/_modules/custom-data/_models/cud.data-model.d.ts +3 -0
  141. package/build/_modules/custom-data/_models/cud.data-model.d.ts.map +1 -1
  142. package/build/_modules/custom-data/_models/cud.data-model.js +3 -0
  143. package/build/_modules/custom-data/_models/cud.data-model.js.map +1 -1
  144. package/build/_modules/location/_collections/loc-country-divisions.const.d.ts +1 -0
  145. package/build/_modules/location/_collections/loc-country-divisions.const.d.ts.map +1 -1
  146. package/build/_modules/location/_collections/loc-country-divisions.const.js +1 -0
  147. package/build/_modules/location/_collections/loc-country-divisions.const.js.map +1 -1
  148. package/build/_modules/location/_collections/loc-regions.util.d.ts +4 -0
  149. package/build/_modules/location/_collections/loc-regions.util.d.ts.map +1 -1
  150. package/build/_modules/location/_collections/loc-regions.util.js +4 -0
  151. package/build/_modules/location/_collections/loc-regions.util.js.map +1 -1
  152. package/build/_modules/location/_collections/loc.util.d.ts +9 -0
  153. package/build/_modules/location/_collections/loc.util.d.ts.map +1 -1
  154. package/build/_modules/location/_collections/loc.util.js +9 -0
  155. package/build/_modules/location/_collections/loc.util.js.map +1 -1
  156. package/build/_modules/location/_enums/loc-region.enum.d.ts +3 -0
  157. package/build/_modules/location/_enums/loc-region.enum.d.ts.map +1 -1
  158. package/build/_modules/location/_enums/loc-region.enum.js +3 -0
  159. package/build/_modules/location/_enums/loc-region.enum.js.map +1 -1
  160. package/build/_modules/location/_enums/loc-sub-region.enum.d.ts +3 -0
  161. package/build/_modules/location/_enums/loc-sub-region.enum.d.ts.map +1 -1
  162. package/build/_modules/location/_enums/loc-sub-region.enum.js +3 -0
  163. package/build/_modules/location/_enums/loc-sub-region.enum.js.map +1 -1
  164. package/build/_modules/location/_enums/loc-subdivision-region-type.enum.d.ts +37 -34
  165. package/build/_modules/location/_enums/loc-subdivision-region-type.enum.d.ts.map +1 -1
  166. package/build/_modules/location/_enums/loc-subdivision-region-type.enum.js +3 -0
  167. package/build/_modules/location/_enums/loc-subdivision-region-type.enum.js.map +1 -1
  168. package/build/_modules/location/_models/loc-coordinates.interface.d.ts +1 -0
  169. package/build/_modules/location/_models/loc-coordinates.interface.d.ts.map +1 -1
  170. package/build/_modules/open-ai/_enums/open-ai-model.enum.d.ts +10 -7
  171. package/build/_modules/open-ai/_enums/open-ai-model.enum.d.ts.map +1 -1
  172. package/build/_modules/open-ai/_enums/open-ai-model.enum.js +3 -0
  173. package/build/_modules/open-ai/_enums/open-ai-model.enum.js.map +1 -1
  174. package/build/_modules/pipe/_enums/pip-range-pipe-setting.enum.d.ts +3 -0
  175. package/build/_modules/pipe/_enums/pip-range-pipe-setting.enum.d.ts.map +1 -1
  176. package/build/_modules/pipe/_enums/pip-range-pipe-setting.enum.js +3 -0
  177. package/build/_modules/pipe/_enums/pip-range-pipe-setting.enum.js.map +1 -1
  178. package/build/_modules/pipe/_enums/pip.enum.d.ts +14 -0
  179. package/build/_modules/pipe/_enums/pip.enum.d.ts.map +1 -1
  180. package/build/_modules/pipe/_enums/pip.enum.js +11 -0
  181. package/build/_modules/pipe/_enums/pip.enum.js.map +1 -1
  182. package/build/_modules/socket/_enums/sck-event-key.enum.d.ts +3 -0
  183. package/build/_modules/socket/_enums/sck-event-key.enum.d.ts.map +1 -1
  184. package/build/_modules/socket/_enums/sck-event-key.enum.js +3 -0
  185. package/build/_modules/socket/_enums/sck-event-key.enum.js.map +1 -1
  186. package/build/_modules/socket/_models/sck-client-params.control-model.d.ts +12 -0
  187. package/build/_modules/socket/_models/sck-client-params.control-model.d.ts.map +1 -1
  188. package/build/_modules/socket/_models/sck-client-params.control-model.js +12 -0
  189. package/build/_modules/socket/_models/sck-client-params.control-model.js.map +1 -1
  190. package/build/_modules/socket/_models/sck-socket-event.control-model.d.ts +12 -1
  191. package/build/_modules/socket/_models/sck-socket-event.control-model.d.ts.map +1 -1
  192. package/build/_modules/socket/_models/sck-socket-event.control-model.js +12 -1
  193. package/build/_modules/socket/_models/sck-socket-event.control-model.js.map +1 -1
  194. package/build/_modules/socket/_services/sck-client.service-base.d.ts +4 -0
  195. package/build/_modules/socket/_services/sck-client.service-base.d.ts.map +1 -1
  196. package/build/_modules/socket/_services/sck-client.service-base.js +4 -0
  197. package/build/_modules/socket/_services/sck-client.service-base.js.map +1 -1
  198. package/build/_modules/test/_collections/tst-module-settings.const.d.ts +9 -0
  199. package/build/_modules/test/_collections/tst-module-settings.const.d.ts.map +1 -1
  200. package/build/_modules/test/_collections/tst-module-settings.const.js +9 -0
  201. package/build/_modules/test/_collections/tst-module-settings.const.js.map +1 -1
  202. package/build/_modules/usage/_models/usg-action.control-model.d.ts +13 -0
  203. package/build/_modules/usage/_models/usg-action.control-model.d.ts.map +1 -1
  204. package/build/_modules/usage/_models/usg-action.control-model.js +13 -0
  205. package/build/_modules/usage/_models/usg-action.control-model.js.map +1 -1
  206. package/build/_modules/usage/_models/usg-daily-usage-data.control-model.d.ts +14 -0
  207. package/build/_modules/usage/_models/usg-daily-usage-data.control-model.d.ts.map +1 -1
  208. package/build/_modules/usage/_models/usg-daily-usage-data.control-model.js +14 -0
  209. package/build/_modules/usage/_models/usg-daily-usage-data.control-model.js.map +1 -1
  210. package/build/_modules/usage/_models/usg-data.control-model.d.ts +16 -0
  211. package/build/_modules/usage/_models/usg-data.control-model.d.ts.map +1 -1
  212. package/build/_modules/usage/_models/usg-data.control-model.js +16 -0
  213. package/build/_modules/usage/_models/usg-data.control-model.js.map +1 -1
  214. package/build/_modules/usage/_models/usg-session.data-model.d.ts +17 -0
  215. package/build/_modules/usage/_models/usg-session.data-model.d.ts.map +1 -1
  216. package/build/_modules/usage/_models/usg-session.data-model.js +17 -0
  217. package/build/_modules/usage/_models/usg-session.data-model.js.map +1 -1
  218. package/build/_modules/usage/_models/usg-session.data-model.spec.js.map +1 -1
  219. package/build/index.d.ts +1 -0
  220. package/build/index.d.ts.map +1 -1
  221. package/build/index.js +1 -0
  222. package/build/index.js.map +1 -1
  223. package/futdevpro-fsm-dynamo-01.10.39.tgz +0 -0
  224. package/package.json +9 -5
  225. package/src/_collections/constants/error-defaults.const.ts +8 -0
  226. package/src/_collections/constants/global-settings.const.ts +12 -2
  227. package/src/_collections/constants/numbers.const.ts +32 -0
  228. package/src/_collections/constants/times.const.ts +37 -0
  229. package/src/_collections/utils/array.util.spec.ts +36 -38
  230. package/src/_collections/utils/array.util.ts +146 -12
  231. package/src/_collections/utils/log.util.ts +126 -2
  232. package/src/_collections/utils/math/box-bounds.spec.ts +8 -13
  233. package/src/_collections/utils/math/box-bounds.util.spec.ts +3 -3
  234. package/src/_collections/utils/math/box-bounds.util.ts +65 -12
  235. package/src/_collections/utils/math/math.util.ts +30 -6
  236. package/src/_collections/utils/math/random.util.spec.ts +7 -7
  237. package/src/_collections/utils/math/random.util.ts +27 -4
  238. package/src/_collections/utils/math/vector2.util.ts +148 -21
  239. package/src/_collections/utils/round-list.util.ts +36 -3
  240. package/src/_collections/utils/shared.util.ts +17 -17
  241. package/src/_collections/utils/stack.util.ts +6 -6
  242. package/src/_collections/utils/string.util.ts +8 -1
  243. package/src/_collections/utils/time.util.ts +37 -2
  244. package/src/_collections/utils/type-cloning-facility.util.ts +57 -8
  245. package/src/_collections/utils/utilities.util.spec.ts +2 -2
  246. package/src/_collections/utils/utilities.util.ts +61 -8
  247. package/src/_collections/utils/uuid.util.ts +5 -0
  248. package/src/_enums/basic-property-type.enum.ts +8 -0
  249. package/src/_enums/data-model-type.enum.ts +11 -6
  250. package/src/_enums/environment-flag.enum.ts +18 -0
  251. package/src/_enums/error-level.enum.ts +10 -0
  252. package/src/_enums/http-call-type.enum.ts +6 -2
  253. package/src/_enums/http-response-type.enum.ts +8 -0
  254. package/src/_enums/log-style.enum.ts +8 -0
  255. package/src/_enums/time/day-of-week.enum.ts +13 -1
  256. package/src/_enums/time/month.enum.ts +8 -0
  257. package/src/_enums/time/relative-date.enum.ts +10 -0
  258. package/src/_models/control-models/data-model-params.control-model.ts +6 -6
  259. package/src/_models/control-models/data-property-params.control-model.ts +1 -1
  260. package/src/_models/control-models/error.control-model.spec.ts +2 -2
  261. package/src/_models/interfaces/box-bounds.interface.ts +8 -0
  262. package/src/_models/interfaces/environment/global-settings.interface.ts +2 -0
  263. package/src/_models/interfaces/route-settings.interface.ts +6 -1
  264. package/src/_modules/crypto/_collections/crypto.util.spec.ts +428 -0
  265. package/src/_modules/crypto/_collections/crypto.util.ts +88 -52
  266. package/src/_modules/custom-data/_collections/cud-module-settings.const.ts +6 -0
  267. package/src/_modules/custom-data/_models/cud.data-model.ts +3 -0
  268. package/src/_modules/location/_collections/loc-country-divisions.const.ts +2 -1
  269. package/src/_modules/location/_collections/loc-regions.util.ts +4 -0
  270. package/src/_modules/location/_collections/loc.util.ts +13 -5
  271. package/src/_modules/location/_enums/loc-region.enum.ts +3 -0
  272. package/src/_modules/location/_enums/loc-sub-region.enum.ts +3 -0
  273. package/src/_modules/location/_enums/loc-subdivision-region-type.enum.ts +37 -34
  274. package/src/_modules/location/_models/loc-coordinates.interface.ts +1 -0
  275. package/src/_modules/open-ai/_enums/open-ai-model.enum.ts +11 -8
  276. package/src/_modules/pipe/_enums/pip-range-pipe-setting.enum.ts +3 -0
  277. package/src/_modules/pipe/_enums/pip.enum.ts +17 -3
  278. package/src/_modules/socket/_enums/sck-event-key.enum.ts +3 -0
  279. package/src/_modules/socket/_models/sck-client-params.control-model.ts +12 -0
  280. package/src/_modules/socket/_models/sck-socket-event.control-model.ts +12 -1
  281. package/src/_modules/socket/_services/sck-client.service-base.ts +4 -0
  282. package/src/_modules/test/_collections/tst-module-settings.const.ts +9 -0
  283. package/src/_modules/usage/_models/usg-action.control-model.ts +13 -0
  284. package/src/_modules/usage/_models/usg-daily-usage-data.control-model.ts +14 -0
  285. package/src/_modules/usage/_models/usg-data.control-model.ts +16 -0
  286. package/src/_modules/usage/_models/usg-session.data-model.spec.ts +2 -1
  287. package/src/_modules/usage/_models/usg-session.data-model.ts +17 -0
  288. package/src/index.ts +1 -0
  289. package/tsconfig.json +1 -0
  290. package/futdevpro-fsm-dynamo-01.10.37.tgz +0 -0
@@ -1,4 +1,3 @@
1
-
2
1
  export type DyFM_TCF = DyFM_TypeCloningFacility;
3
2
 
4
3
  /**
@@ -15,6 +14,14 @@ export type DyFM_TCF = DyFM_TypeCloningFacility;
15
14
  * */
16
15
  export class DyFM_TypeCloningFacility {
17
16
 
17
+ /**
18
+ * Clone an object
19
+ * @param object - The object to clone
20
+ * @param skip - An array of keys to skip
21
+ * @param affectedObjects - An array of objects that have already been cloned
22
+ * @param debug - Whether to log debug information
23
+ * @returns The cloned object
24
+ */
18
25
  static clone<T>(
19
26
  object: T,
20
27
  skip: string[] = [],
@@ -28,8 +35,8 @@ export class DyFM_TypeCloningFacility {
28
35
  console.log('clone DEBUG; key:', key);
29
36
  }
30
37
 
31
- if (typeof object === 'object'/* object.hasOwnProperty(key) */) {
32
- const type = typeof object[key];
38
+ if (object && typeof object === 'object'/* object.hasOwnProperty(key) */) {
39
+ const type: string = typeof object[key];
33
40
 
34
41
  if (skip.includes(key)) {
35
42
  continue;
@@ -44,7 +51,7 @@ export class DyFM_TypeCloningFacility {
44
51
 
45
52
  } else {
46
53
  const newAffectedObject: ObjectCollector = {
47
- id: object[key]
54
+ id: object[key] as string
48
55
  };
49
56
 
50
57
  affectedObjects.push(newAffectedObject);
@@ -83,6 +90,14 @@ export class DyFM_TypeCloningFacility {
83
90
  return result;
84
91
  }
85
92
 
93
+ /**
94
+ * Clone an array
95
+ * @param array - The array to clone
96
+ * @param skip - An array of keys to skip
97
+ * @param affectedObjects - An array of objects that have already been cloned
98
+ * @param debug - Whether to log debug information
99
+ * @returns The cloned array
100
+ */
86
101
  static cloneArray<T>(
87
102
  array: T[],
88
103
  skip: string[] = [],
@@ -107,13 +122,47 @@ export class DyFM_TypeCloningFacility {
107
122
  return result;
108
123
  }
109
124
 
110
- storeCirculation // TODO stringifyable -------------------------------------------------------------------------------------------------------------------------------------------
125
+ /**
126
+ * Store the circulation of an object
127
+ * @param object - The object to store the circulation of
128
+ * @returns The serialized object
129
+ */
130
+ static storeCirculation(object: any): string {
131
+ const cache = new Map();
132
+ const result = JSON.stringify(object, (key, value) => {
133
+ if (typeof value === 'object' && value !== null) {
134
+ if (cache.has(value)) {
135
+ return `__cycle__${cache.get(value)}`;
136
+ }
137
+ cache.set(value, cache.size);
138
+ }
139
+ return value;
140
+ });
141
+ return result;
142
+ }
111
143
 
112
- restoreCirculation // TODO stringified -------------------------------------------------------------------------------------------------------------------------------------------
144
+ /**
145
+ * Restore the circulation of an object
146
+ * @param serialized - The serialized object
147
+ * @returns The restored object
148
+ */
149
+ static restoreCirculation(serialized: string): any {
150
+ const cache = new Map();
151
+ const result = JSON.parse(serialized, (key, value) => {
152
+ if (typeof value === 'string' && value.startsWith('__cycle__')) {
153
+ return cache.get(parseInt(value.slice(9), 10));
154
+ }
155
+ if (typeof value === 'object' && value !== null) {
156
+ cache.set(cache.size, value);
157
+ }
158
+ return value;
159
+ });
160
+ return result;
161
+ }
113
162
  }
114
163
 
115
164
  interface ObjectCollector {
116
- id;
117
- clonedObject?;
165
+ id: string;
166
+ clonedObject?: any;
118
167
  }
119
168
 
@@ -157,8 +157,8 @@ describe('| Utilities', () => {
157
157
 
158
158
  describe('| DyFM_JSONListify', () => {
159
159
  it('| should convert a JSON list to an array', () => {
160
- const JSONList = { 0: 'a', 1: 'b', 2: 'c' };
161
- const result = DyFM_JSONListify<string>(JSONList);
160
+ const JSONList: Record<string, string> = { 0: 'a', 1: 'b', 2: 'c' };
161
+ const result = DyFM_JSONListify<string>(JSONList as any as string[]);
162
162
  expect(result).toEqual(['a', 'b', 'c']);
163
163
  });
164
164
  });
@@ -8,6 +8,11 @@ const defaultErrorMsg =
8
8
  'contains object hooks for its own objects, therefore its creating an object loop. ' +
9
9
  'See further information in the detailed error:\n\n';
10
10
 
11
+ /**
12
+ * Clone an object
13
+ * @param object - The object to clone
14
+ * @returns The cloned object
15
+ */
11
16
  export function DyFM_clone<T>(object: T): T {
12
17
  try {
13
18
  return object ? JSON.parse(JSON.stringify(object)) as T : object;
@@ -22,9 +27,14 @@ export function DyFM_clone<T>(object: T): T {
22
27
  }
23
28
  export const DyFM_copy = DyFM_clone;
24
29
 
25
- export function DyFM_surfaceClone<T>(object: T): T {
30
+ /**
31
+ * Surface clone an object
32
+ * @param object - The object to surface clone
33
+ * @returns The surface cloned object
34
+ */
35
+ export function DyFM_surfaceClone<T extends Record<string, any>>(object: T): T {
26
36
  try {
27
- const result = {};
37
+ const result: Record<string, any> = {};
28
38
 
29
39
  Object.keys(object).forEach((key: string): void => {
30
40
  result[key] = object[key];
@@ -42,9 +52,14 @@ export function DyFM_surfaceClone<T>(object: T): T {
42
52
  }
43
53
  export const DyFM_surfaceCopy = DyFM_surfaceClone;
44
54
 
45
- export function DyFM_deepClone<T>(object: T): T {
55
+ /**
56
+ * Deep clone an object
57
+ * @param object - The object to deep clone
58
+ * @returns The deep cloned object
59
+ */
60
+ export function DyFM_deepClone<T extends Record<string, any>>(object: T): T {
46
61
  try {
47
- const result = {};
62
+ const result: Record<string, any> = {};
48
63
 
49
64
  Object.keys(object).forEach((key: string): void => {
50
65
  if (typeof object[key] === 'object') {
@@ -141,6 +156,13 @@ export function DyFM_orderedSameObject<T>(objA: T, objB: T): boolean {
141
156
  }
142
157
  }
143
158
 
159
+ /**
160
+ * We experienced that sameObjects() function is not working properly for cases when
161
+ * deleting a key from the objects (to prevent strict results).
162
+ *
163
+ * This function is created to prevent that issue.
164
+ * But be aware that this function is not as fast as sameObjects() function.
165
+ */
144
166
  export function DyFM_orderedSameObject2<T>(objA: T, objB: T): boolean {
145
167
  try {
146
168
  console.log('using orderedSameObject2');
@@ -175,6 +197,12 @@ export function DyFM_orderedSameObject2<T>(objA: T, objB: T): boolean {
175
197
  }
176
198
  }
177
199
 
200
+ /**
201
+ * compares the surface of two objects
202
+ * @param objA
203
+ * @param objB
204
+ * @returns
205
+ */
178
206
  export function DyFM_sameObjectSurface<T>(objA: T, objB: T): boolean {
179
207
  let result = true;
180
208
 
@@ -201,6 +229,11 @@ export function DyFM_setExistingValuesOnly(setOn: any, setTo: any): void {
201
229
  }
202
230
  }
203
231
 
232
+ /**
233
+ * delays the execution of a function
234
+ * @param ms
235
+ * @returns
236
+ */
204
237
  export function DyFM_delay(ms: number): Promise<void> {
205
238
  return new Promise((resolve): any => setTimeout(resolve, ms));
206
239
  }
@@ -267,13 +300,16 @@ export function DyFM_takeUntil<T>(
267
300
  (value?: T): void => {
268
301
  if (check(value)) {
269
302
  sub.unsubscribe();
270
- resolve(value);
303
+ resolve(value as T);
271
304
  }
272
305
  }
273
306
  );
274
307
  });
275
308
  }
276
309
 
310
+ /**
311
+ * the return type of the sortForTrue function
312
+ */
277
313
  export type DyFM_SortDirection = 0 | 1 | -1
278
314
 
279
315
  /**
@@ -294,20 +330,37 @@ export function DyFM_sortForTrue<T>(
294
330
  ): DyFM_SortDirection {
295
331
  const isA = check(a);
296
332
 
297
- return isA === check(b) ? 0 : isA ? -1 : 1;
333
+ if (isA === check(b)) {
334
+ return 0;
335
+ } else if (isA) {
336
+ return -1;
337
+ } else {
338
+ return 1;
339
+ }
298
340
  }
299
341
 
342
+ /**
343
+ * returns a function that can be used to sort an array of objects
344
+ * sorts so that the objects that have the value true for the checkFor function are at the beginning of the array
345
+ * @param checkFor
346
+ * @returns
347
+ */
300
348
  export function DyFM_getSortForTrueFn<T>(
301
349
  checkFor: (a: T) => boolean
302
350
  ): (a: T, b: T) => DyFM_SortDirection {
303
351
  return (a: T, b: T): DyFM_SortDirection => DyFM_sortForTrue<T>(a, b, checkFor);
304
352
  }
305
353
 
306
- export function DyFM_JSONListify<T>(JSONList): T[] {
354
+ /**
355
+ * converts a JSONList to an array
356
+ * @param JSONList
357
+ * @returns
358
+ */
359
+ export function DyFM_JSONListify<T>(JSONList: any): T[] {
307
360
  const result: T[] = [];
308
361
 
309
362
  for (let i = 0; JSONList[i]; i++) {
310
- result.push(JSONList[i] as T);
363
+ result.push(JSONList[i]);
311
364
  }
312
365
 
313
366
  return result;
@@ -5,6 +5,11 @@ import * as UUID from 'uuid';
5
5
  export class DyFM_UUID {
6
6
  /* static readonly getUUID = UUID.v4; */
7
7
 
8
+ /**
9
+ * generates a UUID
10
+ * @param reserved - an array of reserved UUIDs
11
+ * @returns a UUID
12
+ */
8
13
  static generate(reserved?: string[]): string {
9
14
  let uuid = UUID.v4();
10
15
 
@@ -1,6 +1,14 @@
1
1
 
2
2
 
3
3
 
4
+ /**
5
+ * Basic property types used by the framework.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * const type: DyFM_BasicProperty_Type = DyFM_BasicProperty_Type.string;
10
+ * ```
11
+ */
4
12
  export enum DyFM_BasicProperty_Type {
5
13
  string = 'string',
6
14
  number = 'number',
@@ -2,17 +2,22 @@
2
2
 
3
3
 
4
4
  /**
5
- * DataModelType is declaring where the data type is used
6
- *
7
- * data: used in DB
8
- * control: used only in runtime and needs a constructor
9
- * interface: used only in runtime and doesnt need constructor
5
+ * Indicates in which layer a given structure is used based on its model type.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * const type = DyFM_DataModel_Type.data;
10
+ * ```
10
11
  */
11
12
  export enum DyFM_DataModel_Type {
12
13
  data = 'data-model',
13
14
  control = 'control-model',
14
15
  interface = 'interface',
15
16
  }
16
- export const DyFM_allDataModelTypes: DyFM_DataModel_Type[] =
17
+
18
+ /**
19
+ * Array containing every available data model type.
20
+ */
21
+ export const DyFM_allDataModelTypes: DyFM_DataModel_Type[] =
17
22
  Object.values(DyFM_DataModel_Type);
18
23
 
@@ -1,5 +1,15 @@
1
1
 
2
2
 
3
+ /**
4
+ * Flags representing the runtime environment of the application.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * if (flag === DyFM_EnvironmentFlag.dev) {
9
+ * console.log('Development environment');
10
+ * }
11
+ * ```
12
+ */
3
13
  export enum DyFM_EnvironmentFlag {
4
14
  local = 'local',
5
15
  dev = 'dev',
@@ -7,4 +17,12 @@ export enum DyFM_EnvironmentFlag {
7
17
  prod = 'prod',
8
18
  }
9
19
 
20
+ /**
21
+ * Every available environment flag collected into an array.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * console.log(DyFM_allEnvironmentFlags);
26
+ * ```
27
+ */
10
28
  export const DyFM_allEnvironmentFlags = Object.values(DyFM_EnvironmentFlag);
@@ -2,6 +2,16 @@
2
2
 
3
3
 
4
4
 
5
+ /**
6
+ * Severity levels used for logging and error handling.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * if (err.level === DyFM_ErrorLevel.warning) {
11
+ * console.warn('Handle warning');
12
+ * }
13
+ * ```
14
+ */
5
15
  export enum DyFM_ErrorLevel {
6
16
  user = 'user',
7
17
  debug = 'debug',
@@ -1,7 +1,11 @@
1
1
 
2
2
  /**
3
- * basic Http Call Types such as;
4
- * get, post, put, patch, delete
3
+ * Basic HTTP request methods.
4
+ *
5
+ * @example
6
+ * ```ts
7
+ * const method: DyFM_HttpCallType = DyFM_HttpCallType.get;
8
+ * ```
5
9
  */
6
10
  export enum DyFM_HttpCallType {
7
11
  get = 'get',
@@ -1,4 +1,12 @@
1
1
 
2
+ /**
3
+ * Expected payload type of an HTTP response.
4
+ *
5
+ * @example
6
+ * ```ts
7
+ * const responseType = DyFM_HttpResponseType.json;
8
+ * ```
9
+ */
2
10
  export enum DyFM_HttpResponseType {
3
11
  arraybuffer = 'arraybuffer',
4
12
  blob = 'blob',
@@ -1,6 +1,14 @@
1
1
 
2
2
 
3
3
 
4
+ /**
5
+ * ANSI escape codes for console styling.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * console.log(DyFM_LogStyle.green + 'OK' + DyFM_LogStyle.reset);
10
+ * ```
11
+ */
4
12
  export enum DyFM_LogStyle {
5
13
  reset = '\x1b[0m',
6
14
 
@@ -2,6 +2,14 @@
2
2
 
3
3
 
4
4
 
5
+ /**
6
+ * Names of the days of the week.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const today = DyFM_DayOfWeek.monday;
11
+ * ```
12
+ */
5
13
  export enum DyFM_DayOfWeek {
6
14
  monday = 'monday',
7
15
  tuesday = 'tuesday',
@@ -12,10 +20,13 @@ export enum DyFM_DayOfWeek {
12
20
  sunday = 'sunday',
13
21
  }
14
22
 
23
+ /**
24
+ * Every day of the week in an array.
25
+ */
15
26
  export const DyFM_allDaysOfWeek = Object.values(DyFM_DayOfWeek);
16
27
 
17
28
 
18
- /** stupid style */
29
+ /** In U.S. order starting with Sunday */
19
30
  export const DyFM_allDaysOfWeekAmericanStyle = [
20
31
  DyFM_DayOfWeek.sunday,
21
32
  DyFM_DayOfWeek.monday,
@@ -26,5 +37,6 @@ export const DyFM_allDaysOfWeekAmericanStyle = [
26
37
  DyFM_DayOfWeek.saturday,
27
38
  ];
28
39
 
40
+ /** Same as `DyFM_allDaysOfWeekAmericanStyle`. */
29
41
  export const DyFM_allDaysOfWeekStupid = DyFM_allDaysOfWeekAmericanStyle;
30
42
 
@@ -1,6 +1,14 @@
1
1
 
2
2
 
3
3
 
4
+ /**
5
+ * Enumeration of calendar months.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * const month = DyFM_Month.january;
10
+ * ```
11
+ */
4
12
  export enum DyFM_Month {
5
13
  january = 'january',
6
14
  february = 'february',
@@ -1,6 +1,16 @@
1
1
 
2
2
 
3
3
 
4
+ /**
5
+ * Human readable identifiers for relative date ranges.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * if (range === DyFM_RelativeDate.lastWeek) {
10
+ * // ...
11
+ * }
12
+ * ```
13
+ */
4
14
  export enum DyFM_RelativeDate {
5
15
  lastDay = 'lastDay',
6
16
  lastWeek = 'lastWeek',
@@ -5,20 +5,20 @@ import { DyFM_DataModel_Type } from '../../_enums/data-model-type.enum';
5
5
  import { DyFM_Metadata } from '../data-models/metadata.data-model';
6
6
  import { DyFM_DataProperties, DyFM_DataProperty_Params } from './data-property-params.control-model';
7
7
 
8
- export type DyFM_Data_S<T> = DyFM_DataModel_Settings<T>;
9
- export type DyFM_Data_Settings<T> = DyFM_DataModel_Settings<T>;
8
+ export type DyFM_Data_S<T extends DyFM_Metadata> = DyFM_DataModel_Settings<T>;
9
+ export type DyFM_Data_Settings<T extends DyFM_Metadata> = DyFM_DataModel_Settings<T>;
10
10
  export class DyFM_DataModel_Settings<T extends DyFM_Metadata> extends DyFM_Metadata {
11
11
  /** this will be used as db table name, therefore it should be in snake_case,
12
12
  * this also will be used in logs and errors
13
13
  */
14
- dataName: string;
14
+ dataName!: string;
15
15
  modelType?: DyFM_DataModel_Type;
16
16
  addArchive?: boolean;
17
- properties: DyFM_DataProperties<T>;
17
+ properties!: DyFM_DataProperties<T>;
18
18
  }
19
19
 
20
- export type DyFM_Data_P<T> = DyFM_DataModel_Params<T>;
21
- export type DyFM_Data_Params<T> = DyFM_DataModel_Params<T>;
20
+ export type DyFM_Data_P<T extends DyFM_Metadata> = DyFM_DataModel_Params<T>;
21
+ export type DyFM_Data_Params<T extends DyFM_Metadata> = DyFM_DataModel_Params<T>;
22
22
  export class DyFM_DataModel_Params<T extends DyFM_Metadata> extends DyFM_DataModel_Settings<T> {
23
23
 
24
24
  /* override properties?: DyFM_DataProperties<T>; */
@@ -11,7 +11,7 @@ export type DyFM_DataPropertySettings<T = any> = DyFM_DataProperty_Settings<T>;
11
11
 
12
12
  export class DyFM_DataProperty_Settings<T>{
13
13
  key?: string;
14
- type: DyFM_BasicProperty_Type | string;
14
+ type!: DyFM_BasicProperty_Type | string;
15
15
  default?: T;
16
16
 
17
17
  unique?: boolean;
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { DyFM_error_defaults } from '../../_collections/constants/error-defaults.const';
4
4
  import { DyFM_Log } from '../../_collections/utils/log.util';
5
- import { DyFM_Error } from './error.control-model';
5
+ import { DyFM_Error, DyFM_Error_Settings } from './error.control-model';
6
6
 
7
7
  function testFormatter(any: any): any {
8
8
  if (any instanceof Error) {
@@ -479,7 +479,7 @@ describe('| DyFM_Error;', (): void => {
479
479
  });
480
480
 
481
481
  describe('| should have get proper simplified;', (): void => {
482
- let simplified;
482
+ let simplified: DyFM_Error_Settings;
483
483
 
484
484
  describe('| on error_0;', (): void => {
485
485
  beforeEach((): void => {
@@ -0,0 +1,8 @@
1
+ import { DyFM_Vector2 } from './vector2.interface';
2
+
3
+ export interface DyFM_BoxBounds {
4
+ pos: DyFM_Vector2;
5
+ size: DyFM_Vector2;
6
+ center: DyFM_Vector2;
7
+ centerMargin: DyFM_Vector2;
8
+ }
@@ -9,6 +9,8 @@ import { DyFM_GlobalLog_Settings } from './global-log-settings.interface';
9
9
  *
10
10
  */
11
11
  export interface DyFM_Global_Settings {
12
+ systemShortCodeName: string;
13
+
12
14
  /**
13
15
  * this will be used as the main baseUrl for the application,
14
16
  * this is not required, but we suggest to use at least a '/api' as base route
@@ -3,7 +3,12 @@ export type DyFM_Route_S<T> = DyFM_Route_Settings<T>;
3
3
  export interface DyFM_Route_Settings<T> {
4
4
  mainRoute: string;
5
5
 
6
- /** TODO ezitten tökszar mert nem ellenőriz típust */
6
+ /**
7
+ * Mapping of route keys to their endpoint paths.
8
+ *
9
+ * The generic type is not fully enforced here, so make sure
10
+ * that the keys correspond to the enum provided for <T>.
11
+ */
7
12
  endPoints: {
8
13
  [key in T as string]: string
9
14
  };