@atlantjs/arch 15.7.7 → 15.7.8

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 (316) hide show
  1. package/package.json +4 -2
  2. package/src/@tool-box/tests/builder.abstract.util.d.ts +0 -1
  3. package/src/@tool-box/tests/builder.abstract.util.js +40 -0
  4. package/src/@tool-box/tests/builders/datetime/datetime.edge.builder.d.ts +2 -3
  5. package/src/@tool-box/tests/builders/datetime/datetime.edge.builder.js +15 -0
  6. package/src/@tool-box/tests/builders/failures/dummies/failure.dummy.d.ts +1 -2
  7. package/src/@tool-box/tests/builders/failures/dummies/failure.dummy.js +13 -0
  8. package/src/@tool-box/tests/builders/failures/failure.builder.d.ts +1 -2
  9. package/src/@tool-box/tests/builders/failures/failure.builder.js +18 -0
  10. package/src/@tool-box/tests/builders/metadata/metadata-uv.builder.d.ts +2 -3
  11. package/src/@tool-box/tests/builders/metadata/metadata-uv.builder.js +18 -0
  12. package/src/@tool-box/tests/builders/metadata/metadata.edge.builder.d.ts +2 -3
  13. package/src/@tool-box/tests/builders/metadata/metadata.edge.builder.js +15 -0
  14. package/src/@tool-box/tests/builders/user/email.edge.builder.d.ts +2 -3
  15. package/src/@tool-box/tests/builders/user/email.edge.builder.js +15 -0
  16. package/src/@tool-box/tests/builders/user/username.edge.builder.d.ts +2 -3
  17. package/src/@tool-box/tests/builders/user/username.edge.builder.js +15 -0
  18. package/src/@tool-box/tests/faker/faker.d.ts +0 -1
  19. package/src/@tool-box/tests/faker/faker.js +208 -0
  20. package/src/@tool-box/utils/convert-units/convert-units.d.ts +5 -6
  21. package/src/@tool-box/utils/convert-units/convert-units.js +154 -0
  22. package/src/@tool-box/utils/datatypes/boolean-utils.d.ts +0 -1
  23. package/src/@tool-box/utils/datatypes/boolean-utils.js +155 -0
  24. package/src/@tool-box/utils/datatypes/generic-types.d.ts +0 -1
  25. package/src/@tool-box/utils/datatypes/generic-types.js +3 -0
  26. package/src/@tool-box/utils/datatypes/plainify.d.ts +0 -1
  27. package/src/@tool-box/utils/datatypes/plainify.js +2 -0
  28. package/src/@tool-box/utils/datatypes/string-utils.d.ts +0 -1
  29. package/src/@tool-box/utils/datatypes/string-utils.js +292 -0
  30. package/src/@tool-box/utils/datetime/mappers/month.mapper.d.ts +2 -3
  31. package/src/@tool-box/utils/datetime/mappers/month.mapper.js +58 -0
  32. package/src/@tool-box/utils/datetime/mappers/points/month-abbreviation.enum.d.ts +0 -1
  33. package/src/@tool-box/utils/datetime/mappers/points/month-abbreviation.enum.js +18 -0
  34. package/src/@tool-box/utils/datetime/mappers/points/month-number.enum.d.ts +0 -1
  35. package/src/@tool-box/utils/datetime/mappers/points/month-number.enum.js +18 -0
  36. package/src/@tool-box/utils/ducts/common.d.ts +0 -1
  37. package/src/@tool-box/utils/ducts/common.js +47 -0
  38. package/src/@tool-box/utils/ducts/optional-type.d.ts +1 -2
  39. package/src/@tool-box/utils/ducts/optional-type.js +130 -0
  40. package/src/@tool-box/utils/ducts/return-type.d.ts +2 -3
  41. package/src/@tool-box/utils/ducts/return-type.js +69 -0
  42. package/src/@tool-box/utils/http-provider/http-provider-failure-response.d.ts +1 -2
  43. package/src/@tool-box/utils/http-provider/http-provider-failure-response.js +22 -0
  44. package/src/@tool-box/utils/http-provider/http-provider-success-response.d.ts +1 -2
  45. package/src/@tool-box/utils/http-provider/http-provider-success-response.js +22 -0
  46. package/src/@tool-box/utils/http-provider/http-provider.d.ts +4 -5
  47. package/src/@tool-box/utils/http-provider/http-provider.js +87 -0
  48. package/src/@tool-box/utils/logger/index.d.ts +0 -1
  49. package/src/@tool-box/utils/logger/index.js +31 -0
  50. package/src/@tool-box/utils/map/map.abstract.d.ts +0 -1
  51. package/src/@tool-box/utils/map/map.abstract.js +84 -0
  52. package/src/@tool-box/utils/random/random.d.ts +0 -1
  53. package/src/@tool-box/utils/random/random.js +260 -0
  54. package/src/@tool-box/utils/type-guard/guardian-exception.d.ts +0 -1
  55. package/src/@tool-box/utils/type-guard/guardian-exception.js +6 -0
  56. package/src/@tool-box/utils/type-guard/guardian.d.ts +2 -3
  57. package/src/@tool-box/utils/type-guard/guardian.js +625 -0
  58. package/src/@tool-box/utils/type-guard/guardian.type.d.ts +0 -1
  59. package/src/@tool-box/utils/type-guard/guardian.type.js +2 -0
  60. package/src/@tool-box/utils/validators/is-cron-expression.d.ts +0 -1
  61. package/src/@tool-box/utils/validators/is-cron-expression.js +39 -0
  62. package/src/@tool-box/utils/validators/is-date-string.d.ts +0 -1
  63. package/src/@tool-box/utils/validators/is-date-string.js +39 -0
  64. package/src/@tool-box/utils/validators/is-password-match.d.ts +0 -1
  65. package/src/@tool-box/utils/validators/is-password-match.js +27 -0
  66. package/src/@tool-box/utils/validators/is-password-policy.validator.d.ts +0 -1
  67. package/src/@tool-box/utils/validators/is-password-policy.validator.js +30 -0
  68. package/src/@tool-box/utils/validators/is-schedule.d.ts +0 -1
  69. package/src/@tool-box/utils/validators/is-schedule.js +43 -0
  70. package/src/@tool-box/utils/validators/is-time-string.d.ts +0 -1
  71. package/src/@tool-box/utils/validators/is-time-string.js +39 -0
  72. package/src/@tool-box/utils/validators/is-ulid.d.ts +0 -1
  73. package/src/@tool-box/utils/validators/is-ulid.js +39 -0
  74. package/src/index.d.ts +74 -75
  75. package/src/index.js +179 -0
  76. package/src/objects/@common/edges/email.edge.d.ts +1 -2
  77. package/src/objects/@common/edges/email.edge.js +88 -0
  78. package/src/objects/@common/edges/ulid.sketch.edge.d.ts +0 -1
  79. package/src/objects/@common/edges/ulid.sketch.edge.js +92 -0
  80. package/src/objects/@common/edges/url.edge.d.ts +1 -2
  81. package/src/objects/@common/edges/url.edge.js +270 -0
  82. package/src/objects/@common/edges/username.edge.d.ts +1 -2
  83. package/src/objects/@common/edges/username.edge.js +38 -0
  84. package/src/objects/@common/edges/uuid.sketch.edge.d.ts +0 -1
  85. package/src/objects/@common/edges/uuid.sketch.edge.js +146 -0
  86. package/src/objects/@common/points/environment.point.d.ts +0 -1
  87. package/src/objects/@common/points/environment.point.js +10 -0
  88. package/src/objects/@common/points/header-token-name.point.d.ts +0 -1
  89. package/src/objects/@common/points/header-token-name.point.js +10 -0
  90. package/src/objects/@common/points/http-status-codes.point.d.ts +0 -1
  91. package/src/objects/@common/points/http-status-codes.point.js +244 -0
  92. package/src/objects/amount/amount-value.edge.d.ts +1 -2
  93. package/src/objects/amount/amount-value.edge.js +76 -0
  94. package/src/objects/amount/amount.edge.d.ts +1 -2
  95. package/src/objects/amount/amount.edge.js +628 -0
  96. package/src/objects/amount/amount.polygon.d.ts +0 -1
  97. package/src/objects/amount/amount.polygon.js +2 -0
  98. package/src/objects/amount/amount.uv.d.ts +3 -4
  99. package/src/objects/amount/amount.uv.js +31 -0
  100. package/src/objects/amount/points/duration-unit.point.d.ts +0 -1
  101. package/src/objects/amount/points/duration-unit.point.js +15 -0
  102. package/src/objects/amount/points/energy-unit.point.d.ts +0 -1
  103. package/src/objects/amount/points/energy-unit.point.js +10 -0
  104. package/src/objects/amount/points/length-unit.point.d.ts +0 -1
  105. package/src/objects/amount/points/length-unit.point.js +10 -0
  106. package/src/objects/amount/points/mass-unit.point.d.ts +0 -1
  107. package/src/objects/amount/points/mass-unit.point.js +11 -0
  108. package/src/objects/amount/points/month-name.point.d.ts +0 -1
  109. package/src/objects/amount/points/month-name.point.js +18 -0
  110. package/src/objects/amount/points/object-unit.point.d.ts +0 -1
  111. package/src/objects/amount/points/object-unit.point.js +7 -0
  112. package/src/objects/amount/points/units.point.d.ts +5 -6
  113. package/src/objects/amount/points/units.point.js +2 -0
  114. package/src/objects/amount/points/volume-unit.point.d.ts +0 -1
  115. package/src/objects/amount/points/volume-unit.point.js +8 -0
  116. package/src/objects/amount/points/week-day.point.d.ts +0 -1
  117. package/src/objects/amount/points/week-day.point.js +13 -0
  118. package/src/objects/datetime/edges/datetime.edge.d.ts +2 -3
  119. package/src/objects/datetime/edges/datetime.edge.js +675 -0
  120. package/src/objects/datetime/edges/locale/day/day-name-to-english.mapper.d.ts +1 -2
  121. package/src/objects/datetime/edges/locale/day/day-name-to-english.mapper.js +16 -0
  122. package/src/objects/datetime/edges/locale/day/day-name-to-portuguese.mapper.d.ts +1 -2
  123. package/src/objects/datetime/edges/locale/day/day-name-to-portuguese.mapper.js +16 -0
  124. package/src/objects/datetime/edges/locale/day/today-to-language.mapper.d.ts +2 -3
  125. package/src/objects/datetime/edges/locale/day/today-to-language.mapper.js +12 -0
  126. package/src/objects/datetime/edges/locale/holidays-country.type.d.ts +0 -1
  127. package/src/objects/datetime/edges/locale/holidays-country.type.js +2 -0
  128. package/src/objects/datetime/edges/locale/month/month-to-english.mapper.d.ts +1 -2
  129. package/src/objects/datetime/edges/locale/month/month-to-english.mapper.js +21 -0
  130. package/src/objects/datetime/edges/locale/month/month-to-portuguese.mapper.d.ts +1 -2
  131. package/src/objects/datetime/edges/locale/month/month-to-portuguese.mapper.js +21 -0
  132. package/src/objects/datetime/points/month-name.enum.d.ts +0 -1
  133. package/src/objects/datetime/points/month-name.enum.js +18 -0
  134. package/src/objects/datetime/points/week-day.enum.d.ts +0 -1
  135. package/src/objects/datetime/points/week-day.enum.js +13 -0
  136. package/src/objects/failure/edges/failure.abstract.d.ts +1 -2
  137. package/src/objects/failure/edges/failure.abstract.js +27 -0
  138. package/src/objects/failure/edges/failure.abstract.polygon.d.ts +0 -1
  139. package/src/objects/failure/edges/failure.abstract.polygon.js +2 -0
  140. package/src/objects/language/points/language.point.d.ts +0 -1
  141. package/src/objects/language/points/language.point.js +135 -0
  142. package/src/objects/metadata/metadata.edge.d.ts +3 -4
  143. package/src/objects/metadata/metadata.edge.js +27 -0
  144. package/src/objects/metadata/metadata.polygon.d.ts +0 -1
  145. package/src/objects/metadata/metadata.polygon.js +2 -0
  146. package/src/objects/metadata/metadata.uv.d.ts +1 -2
  147. package/src/objects/metadata/metadata.uv.js +31 -0
  148. package/src/objects/password/password.edge.d.ts +2 -3
  149. package/src/objects/password/password.edge.js +176 -0
  150. package/src/objects/password/password.polygon.d.ts +1 -2
  151. package/src/objects/password/password.polygon.js +2 -0
  152. package/src/objects/password/steps/not-allowing-consecutive-chars-step.d.ts +2 -3
  153. package/src/objects/password/steps/not-allowing-consecutive-chars-step.js +35 -0
  154. package/src/objects/password/steps/not-allowing-date-step.d.ts +2 -3
  155. package/src/objects/password/steps/not-allowing-date-step.js +62 -0
  156. package/src/objects/password/steps/not-allowing-phone-step.d.ts +2 -3
  157. package/src/objects/password/steps/not-allowing-phone-step.js +28 -0
  158. package/src/objects/password/steps/not-allowing-repeated-chars-step.d.ts +2 -3
  159. package/src/objects/password/steps/not-allowing-repeated-chars-step.js +35 -0
  160. package/src/objects/password/steps/not-allowing-string-step.d.ts +2 -3
  161. package/src/objects/password/steps/not-allowing-string-step.js +20 -0
  162. package/src/objects/password/steps/not-allowing-these-chars-step.d.ts +2 -3
  163. package/src/objects/password/steps/not-allowing-these-chars-step.js +18 -0
  164. package/src/objects/password/steps/numeric-step.d.ts +2 -3
  165. package/src/objects/password/steps/numeric-step.js +13 -0
  166. package/src/objects/password/steps/with-at-least-one-letter-step.d.ts +2 -3
  167. package/src/objects/password/steps/with-at-least-one-letter-step.js +14 -0
  168. package/src/objects/password/steps/with-at-least-one-number-digit-step.d.ts +2 -3
  169. package/src/objects/password/steps/with-at-least-one-number-digit-step.js +14 -0
  170. package/src/objects/password/steps/with-at-least-one-special-char-step.d.ts +2 -3
  171. package/src/objects/password/steps/with-at-least-one-special-char-step.js +14 -0
  172. package/src/objects/password/steps/with-length-step.d.ts +2 -3
  173. package/src/objects/password/steps/with-length-step.js +19 -0
  174. package/src/objects/password/validation-step.d.ts +1 -2
  175. package/src/objects/password/validation-step.js +9 -0
  176. package/src/objects/password/validation-step.type.d.ts +0 -1
  177. package/src/objects/password/validation-step.type.js +2 -0
  178. package/src/objects/primitives/boolean.edge.sketch.d.ts +0 -1
  179. package/src/objects/primitives/boolean.edge.sketch.js +148 -0
  180. package/src/objects/primitives/datetime.edge.sketch.d.ts +1 -2
  181. package/src/objects/primitives/datetime.edge.sketch.js +7 -0
  182. package/src/objects/primitives/number.edge.sketch.d.ts +0 -1
  183. package/src/objects/primitives/number.edge.sketch.js +347 -0
  184. package/src/objects/primitives/string.edge.sketch.d.ts +0 -1
  185. package/src/objects/primitives/string.edge.sketch.js +219 -0
  186. package/src/objects/scheduling/scheduling.edge.d.ts +6 -7
  187. package/src/objects/scheduling/scheduling.edge.failure.d.ts +1 -2
  188. package/src/objects/scheduling/scheduling.edge.failure.js +14 -0
  189. package/src/objects/scheduling/scheduling.edge.js +281 -0
  190. package/src/objects/time/time.edge.d.ts +1 -2
  191. package/src/objects/time/time.edge.js +448 -0
  192. package/src/objects-interface/edges/edge.abstract.d.ts +1 -2
  193. package/src/objects-interface/edges/edge.abstract.js +6 -0
  194. package/src/objects-interface/face.abstract.d.ts +2 -3
  195. package/src/objects-interface/face.abstract.js +6 -0
  196. package/src/objects-interface/solid.abstract.d.ts +5 -6
  197. package/src/objects-interface/solid.abstract.js +13 -0
  198. package/src/objects-interface/uv.abstract.d.ts +3 -4
  199. package/src/objects-interface/uv.abstract.js +6 -0
  200. package/src/objects-interface/vertices/vertex.abstract.d.ts +5 -6
  201. package/src/objects-interface/vertices/vertex.abstract.js +13 -0
  202. package/src/shared/payload.abstract.d.ts +0 -1
  203. package/src/shared/payload.abstract.js +6 -0
  204. package/src/shared/request.abstract.d.ts +5 -6
  205. package/src/shared/request.abstract.js +3 -0
  206. package/src/shared/response.abstract.d.ts +0 -1
  207. package/src/shared/response.abstract.js +6 -0
  208. package/{tsconfig-lib.json → tsconfig.lib.json} +0 -1
  209. package/tsconfig.tsbuildinfo +1 -1
  210. package/src/@tool-box/tests/builder.abstract.util.d.ts.map +0 -1
  211. package/src/@tool-box/tests/builders/datetime/datetime.edge.builder.d.ts.map +0 -1
  212. package/src/@tool-box/tests/builders/failures/dummies/failure.dummy.d.ts.map +0 -1
  213. package/src/@tool-box/tests/builders/failures/failure.builder.d.ts.map +0 -1
  214. package/src/@tool-box/tests/builders/metadata/metadata-uv.builder.d.ts.map +0 -1
  215. package/src/@tool-box/tests/builders/metadata/metadata.edge.builder.d.ts.map +0 -1
  216. package/src/@tool-box/tests/builders/user/email.edge.builder.d.ts.map +0 -1
  217. package/src/@tool-box/tests/builders/user/username.edge.builder.d.ts.map +0 -1
  218. package/src/@tool-box/tests/faker/faker.d.ts.map +0 -1
  219. package/src/@tool-box/utils/convert-units/convert-units.d.ts.map +0 -1
  220. package/src/@tool-box/utils/datatypes/boolean-utils.d.ts.map +0 -1
  221. package/src/@tool-box/utils/datatypes/generic-types.d.ts.map +0 -1
  222. package/src/@tool-box/utils/datatypes/plainify.d.ts.map +0 -1
  223. package/src/@tool-box/utils/datatypes/string-utils.d.ts.map +0 -1
  224. package/src/@tool-box/utils/datetime/mappers/month.mapper.d.ts.map +0 -1
  225. package/src/@tool-box/utils/datetime/mappers/points/month-abbreviation.enum.d.ts.map +0 -1
  226. package/src/@tool-box/utils/datetime/mappers/points/month-number.enum.d.ts.map +0 -1
  227. package/src/@tool-box/utils/ducts/common.d.ts.map +0 -1
  228. package/src/@tool-box/utils/ducts/optional-type.d.ts.map +0 -1
  229. package/src/@tool-box/utils/ducts/return-type.d.ts.map +0 -1
  230. package/src/@tool-box/utils/http-provider/http-provider-failure-response.d.ts.map +0 -1
  231. package/src/@tool-box/utils/http-provider/http-provider-success-response.d.ts.map +0 -1
  232. package/src/@tool-box/utils/http-provider/http-provider.d.ts.map +0 -1
  233. package/src/@tool-box/utils/logger/index.d.ts.map +0 -1
  234. package/src/@tool-box/utils/map/map.abstract.d.ts.map +0 -1
  235. package/src/@tool-box/utils/random/random.d.ts.map +0 -1
  236. package/src/@tool-box/utils/type-guard/guardian-exception.d.ts.map +0 -1
  237. package/src/@tool-box/utils/type-guard/guardian.d.ts.map +0 -1
  238. package/src/@tool-box/utils/type-guard/guardian.type.d.ts.map +0 -1
  239. package/src/@tool-box/utils/validators/is-cron-expression.d.ts.map +0 -1
  240. package/src/@tool-box/utils/validators/is-date-string.d.ts.map +0 -1
  241. package/src/@tool-box/utils/validators/is-password-match.d.ts.map +0 -1
  242. package/src/@tool-box/utils/validators/is-password-policy.validator.d.ts.map +0 -1
  243. package/src/@tool-box/utils/validators/is-schedule.d.ts.map +0 -1
  244. package/src/@tool-box/utils/validators/is-time-string.d.ts.map +0 -1
  245. package/src/@tool-box/utils/validators/is-ulid.d.ts.map +0 -1
  246. package/src/index.d.ts.map +0 -1
  247. package/src/objects/@common/edges/email.edge.d.ts.map +0 -1
  248. package/src/objects/@common/edges/ulid.sketch.edge.d.ts.map +0 -1
  249. package/src/objects/@common/edges/url.edge.d.ts.map +0 -1
  250. package/src/objects/@common/edges/username.edge.d.ts.map +0 -1
  251. package/src/objects/@common/edges/uuid.sketch.edge.d.ts.map +0 -1
  252. package/src/objects/@common/points/environment.point.d.ts.map +0 -1
  253. package/src/objects/@common/points/header-token-name.point.d.ts.map +0 -1
  254. package/src/objects/@common/points/http-status-codes.point.d.ts.map +0 -1
  255. package/src/objects/amount/amount-value.edge.d.ts.map +0 -1
  256. package/src/objects/amount/amount.edge.d.ts.map +0 -1
  257. package/src/objects/amount/amount.polygon.d.ts.map +0 -1
  258. package/src/objects/amount/amount.uv.d.ts.map +0 -1
  259. package/src/objects/amount/points/duration-unit.point.d.ts.map +0 -1
  260. package/src/objects/amount/points/energy-unit.point.d.ts.map +0 -1
  261. package/src/objects/amount/points/length-unit.point.d.ts.map +0 -1
  262. package/src/objects/amount/points/mass-unit.point.d.ts.map +0 -1
  263. package/src/objects/amount/points/month-name.point.d.ts.map +0 -1
  264. package/src/objects/amount/points/object-unit.point.d.ts.map +0 -1
  265. package/src/objects/amount/points/units.point.d.ts.map +0 -1
  266. package/src/objects/amount/points/volume-unit.point.d.ts.map +0 -1
  267. package/src/objects/amount/points/week-day.point.d.ts.map +0 -1
  268. package/src/objects/datetime/edges/datetime.edge.d.ts.map +0 -1
  269. package/src/objects/datetime/edges/locale/day/day-name-to-english.mapper.d.ts.map +0 -1
  270. package/src/objects/datetime/edges/locale/day/day-name-to-portuguese.mapper.d.ts.map +0 -1
  271. package/src/objects/datetime/edges/locale/day/today-to-language.mapper.d.ts.map +0 -1
  272. package/src/objects/datetime/edges/locale/holidays-country.type.d.ts.map +0 -1
  273. package/src/objects/datetime/edges/locale/month/month-to-english.mapper.d.ts.map +0 -1
  274. package/src/objects/datetime/edges/locale/month/month-to-portuguese.mapper.d.ts.map +0 -1
  275. package/src/objects/datetime/points/month-name.enum.d.ts.map +0 -1
  276. package/src/objects/datetime/points/week-day.enum.d.ts.map +0 -1
  277. package/src/objects/failure/edges/failure.abstract.d.ts.map +0 -1
  278. package/src/objects/failure/edges/failure.abstract.polygon.d.ts.map +0 -1
  279. package/src/objects/language/points/language.point.d.ts.map +0 -1
  280. package/src/objects/metadata/metadata.edge.d.ts.map +0 -1
  281. package/src/objects/metadata/metadata.polygon.d.ts.map +0 -1
  282. package/src/objects/metadata/metadata.uv.d.ts.map +0 -1
  283. package/src/objects/password/password.edge.d.ts.map +0 -1
  284. package/src/objects/password/password.polygon.d.ts.map +0 -1
  285. package/src/objects/password/steps/not-allowing-consecutive-chars-step.d.ts.map +0 -1
  286. package/src/objects/password/steps/not-allowing-date-step.d.ts.map +0 -1
  287. package/src/objects/password/steps/not-allowing-phone-step.d.ts.map +0 -1
  288. package/src/objects/password/steps/not-allowing-repeated-chars-step.d.ts.map +0 -1
  289. package/src/objects/password/steps/not-allowing-string-step.d.ts.map +0 -1
  290. package/src/objects/password/steps/not-allowing-these-chars-step.d.ts.map +0 -1
  291. package/src/objects/password/steps/numeric-step.d.ts.map +0 -1
  292. package/src/objects/password/steps/with-at-least-one-letter-step.d.ts.map +0 -1
  293. package/src/objects/password/steps/with-at-least-one-number-digit-step.d.ts.map +0 -1
  294. package/src/objects/password/steps/with-at-least-one-special-char-step.d.ts.map +0 -1
  295. package/src/objects/password/steps/with-length-step.d.ts.map +0 -1
  296. package/src/objects/password/validation-step.d.ts.map +0 -1
  297. package/src/objects/password/validation-step.type.d.ts.map +0 -1
  298. package/src/objects/primitives/boolean.edge.sketch.d.ts.map +0 -1
  299. package/src/objects/primitives/datetime.edge.sketch.d.ts.map +0 -1
  300. package/src/objects/primitives/number.edge.sketch.d.ts.map +0 -1
  301. package/src/objects/primitives/string.edge.sketch.d.ts.map +0 -1
  302. package/src/objects/scheduling/scheduling.edge.d.ts.map +0 -1
  303. package/src/objects/scheduling/scheduling.edge.failure.d.ts.map +0 -1
  304. package/src/objects/time/time.edge.d.ts.map +0 -1
  305. package/src/objects-interface/edges/edge.abstract.d.ts.map +0 -1
  306. package/src/objects-interface/face.abstract.d.ts.map +0 -1
  307. package/src/objects-interface/solid.abstract.d.ts.map +0 -1
  308. package/src/objects-interface/uv.abstract.d.ts.map +0 -1
  309. package/src/objects-interface/vertices/vertex.abstract.d.ts.map +0 -1
  310. package/src/shared/payload.abstract.d.ts.map +0 -1
  311. package/src/shared/request.abstract.d.ts.map +0 -1
  312. package/src/shared/response.abstract.d.ts.map +0 -1
  313. /package/{tsconfig-backend.json → tsconfig.backend.json} +0 -0
  314. /package/{tsconfig-default.json → tsconfig.base.json} +0 -0
  315. /package/{tsconfig-mobile.json → tsconfig.mobile.json} +0 -0
  316. /package/{tsconfig-web.json → tsconfig.web.json} +0 -0
@@ -0,0 +1,628 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AmountEdge = void 0;
4
+ const convert_units_1 = require("../../@tool-box/utils/convert-units/convert-units");
5
+ const guardian_1 = require("../../@tool-box/utils/type-guard/guardian");
6
+ const amount_value_edge_1 = require("../../objects/amount/amount-value.edge");
7
+ const energy_unit_point_1 = require("../../objects/amount/points/energy-unit.point");
8
+ const length_unit_point_1 = require("../../objects/amount/points/length-unit.point");
9
+ const mass_unit_point_1 = require("../../objects/amount/points/mass-unit.point");
10
+ const volume_unit_point_1 = require("../../objects/amount/points/volume-unit.point");
11
+ class AmountEdge {
12
+ _value;
13
+ _unit;
14
+ constructor(_value, _unit) {
15
+ this._value = _value;
16
+ this._unit = _unit;
17
+ }
18
+ get value() {
19
+ return this._value;
20
+ }
21
+ get unit() {
22
+ return this._unit;
23
+ }
24
+ // ====================
25
+ // Rounding and Precision
26
+ // ====================
27
+ /**
28
+ * Rounds the value to the nearest integer.
29
+ * @returns `this` to allow method chaining.
30
+ * @example
31
+ * const amount = new AmountEdge(5.7, MassUnitPoint.gram);
32
+ * amount.round(); // value is now 6
33
+ */
34
+ round() {
35
+ this._value = Math.round(this._value);
36
+ return this;
37
+ }
38
+ /**
39
+ * Rounds the value up to the next highest integer.
40
+ * @returns `this` to allow method chaining.
41
+ * @example
42
+ * const amount = new AmountEdge(5.2, MassUnitPoint.gram);
43
+ * amount.ceil(); // value is now 6
44
+ */
45
+ ceil() {
46
+ this._value = Math.ceil(this._value);
47
+ return this;
48
+ }
49
+ /**
50
+ * Rounds the value down to the next lowest integer.
51
+ * @returns `this` to allow method chaining.
52
+ * @example
53
+ * const amount = new AmountEdge(5.9, MassUnitPoint.gram);
54
+ * amount.floor(); // value is now 5
55
+ */
56
+ floor() {
57
+ this._value = Math.floor(this._value);
58
+ return this;
59
+ }
60
+ /**
61
+ * Rounds the value to a specified number of decimal places.
62
+ * @param precision - The number of decimal places to keep.
63
+ * @returns `this` to allow method chaining.
64
+ * @example
65
+ * const amount = new AmountEdge(5.6789, MassUnitPoint.gram);
66
+ * amount.toFixed(2); // value is now 5.68
67
+ */
68
+ toFixed(precision) {
69
+ this._value = Number(this._value.toFixed(precision));
70
+ return this;
71
+ }
72
+ /**
73
+ * Returns the absolute value (without sign).
74
+ * @returns `this` to allow method chaining.
75
+ * @example
76
+ * const amount = new AmountEdge(-5.5, MassUnitPoint.gram);
77
+ * amount.abs(); // value is now 5.5
78
+ */
79
+ abs() {
80
+ this._value = Math.abs(this._value);
81
+ return this;
82
+ }
83
+ // ====================
84
+ // Unit Compaction
85
+ // ====================
86
+ /**
87
+ * Compacts the amount into a more appropriate unit based on its value.
88
+ * For example, 1000 grams is converted to 1 kilogram.
89
+ *
90
+ * @returns A new instance with the compacted unit.
91
+ *
92
+ * @example
93
+ * const amount = new AmountEdge(1500, MassUnitPoint.gram);
94
+ * const compact = amount.compact(); // 1.5 kg
95
+ */
96
+ compact() {
97
+ const amountValue = new amount_value_edge_1.AmountValueEdge(this._value);
98
+ // Mass
99
+ if (amountValue.isEqualOrBiggerThan(1000) &&
100
+ guardian_1._.isEqual(this._unit, mass_unit_point_1.MassUnitPoint.gram)) {
101
+ return new AmountEdge(convert_units_1.ConvertUnit.toKilogram(this), mass_unit_point_1.MassUnitPoint.kilogram);
102
+ }
103
+ if (amountValue.isEqualOrBiggerThan(1000) &&
104
+ guardian_1._.isEqual(this._unit, mass_unit_point_1.MassUnitPoint.milligram)) {
105
+ return new AmountEdge(convert_units_1.ConvertUnit.toGram(this), mass_unit_point_1.MassUnitPoint.gram);
106
+ }
107
+ if (amountValue.isEqualOrBiggerThan(1000) &&
108
+ guardian_1._.isEqual(this._unit, mass_unit_point_1.MassUnitPoint.micrograma)) {
109
+ return new AmountEdge(convert_units_1.ConvertUnit.toMilligram(this), mass_unit_point_1.MassUnitPoint.milligram);
110
+ }
111
+ // Volume
112
+ if (amountValue.isEqualOrBiggerThan(1000) &&
113
+ guardian_1._.isEqual(this._unit, volume_unit_point_1.VolumeUnitPoint.milliliter)) {
114
+ return new AmountEdge(convert_units_1.ConvertUnit.toLiter(this), volume_unit_point_1.VolumeUnitPoint.liter);
115
+ }
116
+ // Length
117
+ if (amountValue.isEqualOrBiggerThan(1000) &&
118
+ guardian_1._.isEqual(this._unit, length_unit_point_1.LengthUnitPoint.meter)) {
119
+ return new AmountEdge(convert_units_1.ConvertUnit.toKilometer(this), length_unit_point_1.LengthUnitPoint.kilometer);
120
+ }
121
+ if (amountValue.isEqualOrBiggerThan(100) &&
122
+ guardian_1._.isEqual(this._unit, length_unit_point_1.LengthUnitPoint.centimeter)) {
123
+ return new AmountEdge(convert_units_1.ConvertUnit.toMeter(this), length_unit_point_1.LengthUnitPoint.meter);
124
+ }
125
+ if (amountValue.isEqualOrBiggerThan(1000) &&
126
+ guardian_1._.isEqual(this._unit, length_unit_point_1.LengthUnitPoint.millimeter)) {
127
+ return new AmountEdge(convert_units_1.ConvertUnit.toMeter(this), length_unit_point_1.LengthUnitPoint.meter);
128
+ }
129
+ // Energy
130
+ if (amountValue.isEqualOrBiggerThan(1000) &&
131
+ guardian_1._.isEqual(this._unit, energy_unit_point_1.EnergyUnitPoint.calorie)) {
132
+ return new AmountEdge(convert_units_1.ConvertUnit.toKilocalorie(this), energy_unit_point_1.EnergyUnitPoint.kilocalorie);
133
+ }
134
+ return this;
135
+ }
136
+ // ====================
137
+ // Arithmetic Operations
138
+ // ====================
139
+ /**
140
+ * Adds another amount to the current value.
141
+ * @param amount - The amount to be added.
142
+ * @returns `this` to allow method chaining.
143
+ * @example
144
+ * const amount1 = new AmountEdge(5, MassUnitPoint.gram);
145
+ * const amount2 = new AmountEdge(3, MassUnitPoint.gram);
146
+ * amount1.sum(amount2); // value is now 8
147
+ */
148
+ sum(amount) {
149
+ this._value += amount.value;
150
+ return this;
151
+ }
152
+ /**
153
+ * Subtracts another amount from the current value.
154
+ * @param amount - The amount to be subtracted.
155
+ * @returns `this` to allow method chaining.
156
+ * @example
157
+ * const amount1 = new AmountEdge(8, MassUnitPoint.gram);
158
+ * const amount2 = new AmountEdge(3, MassUnitPoint.gram);
159
+ * amount1.subtract(amount2); // value is now 5
160
+ */
161
+ subtract(amount) {
162
+ this._value -= amount.value;
163
+ return this;
164
+ }
165
+ /**
166
+ * Divides the value by a number or another amount.
167
+ * @param amount - Divisor (number or AmountEdge)
168
+ * @returns `this` to allow method chaining
169
+ * @example
170
+ * const amount = new AmountEdge(10, MassUnitPoint.gram);
171
+ * amount.divideBy(2); // value is now 5
172
+ * amount.divideBy(new AmountEdge(2, MassUnitPoint.gram)); // value is now 2.5
173
+ */
174
+ divideBy(amount) {
175
+ if (typeof amount === "number") {
176
+ this._value /= amount;
177
+ }
178
+ else {
179
+ this._value /= amount.value;
180
+ }
181
+ return this;
182
+ }
183
+ /**
184
+ * Multiplies the value by a number or another amount.
185
+ * @param amount - Multiplier (number or AmountEdge)
186
+ * @returns `this` to allow method chaining
187
+ * @example
188
+ * const amount = new AmountEdge(5, MassUnitPoint.gram);
189
+ * amount.multiplyBy(2); // value is now 10
190
+ * amount.multiplyBy(new AmountEdge(3, MassUnitPoint.gram)); // value is now 30
191
+ */
192
+ multiplyBy(amount) {
193
+ if (typeof amount === "number") {
194
+ this._value *= amount;
195
+ }
196
+ else {
197
+ this._value *= amount.value;
198
+ }
199
+ return this;
200
+ }
201
+ /**
202
+ * Calculates the remainder (modulus) of the current value.
203
+ * @param amount - The divisor, either a number or an AmountEdge instance.
204
+ * @returns `this` to allow method chaining.
205
+ * @example
206
+ * const amount = new AmountEdge(10, MassUnitPoint.gram);
207
+ * amount.modBy(3); // value is now 1
208
+ */
209
+ modBy(amount) {
210
+ if (typeof amount === "number") {
211
+ this._value %= amount;
212
+ }
213
+ else {
214
+ this._value %= amount.value;
215
+ }
216
+ return this;
217
+ }
218
+ /**
219
+ * Calculates the absolute difference between this amount and another.
220
+ * @param amount - The amount to compare against
221
+ * @returns A new instance with the absolute difference
222
+ * @example
223
+ * const amount1 = new AmountEdge(10, MassUnitPoint.gram);
224
+ * const amount2 = new AmountEdge(3, MassUnitPoint.gram);
225
+ * const diff = amount1.difference(amount2); // 7
226
+ */
227
+ difference(amount) {
228
+ const diff = Math.abs(this._value - amount.value);
229
+ return new AmountEdge(diff, this._unit);
230
+ }
231
+ /**
232
+ * Applies a percentage to the current value.
233
+ * @param percentage - The percentage to apply (0-100)
234
+ * @returns `this` to allow method chaining
235
+ * @example
236
+ * const amount = new AmountEdge(100, MassUnitPoint.gram);
237
+ * amount.applyPercentage(20); // value is now 120 (100 + 20%)
238
+ */
239
+ applyPercentage(percentage) {
240
+ const percentageValue = (this._value * percentage) / 100;
241
+ this._value += percentageValue;
242
+ return this;
243
+ }
244
+ /**
245
+ * Calculates the percentage that this amount represents of a total.
246
+ * @param total - The total amount
247
+ * @returns The percentage as a number (0-100)
248
+ * @example
249
+ * const amount = new AmountEdge(25, MassUnitPoint.gram);
250
+ * const total = new AmountEdge(100, MassUnitPoint.gram);
251
+ * const percentage = amount.percentageOf(total); // 25
252
+ * @returns The percentage as a number (0-100)
253
+ * @example
254
+ * const amount = new AmountEdge(25, MassUnitPoint.gram);
255
+ * const total = new AmountEdge(100, MassUnitPoint.gram);
256
+ * const percentage = amount.percentageOf(total); // 25
257
+ */
258
+ percentageOf(total) {
259
+ if (total.value === 0)
260
+ return 0;
261
+ return (this._value / total.value) * 100;
262
+ }
263
+ // ====================
264
+ // Comparisons
265
+ // ====================
266
+ /**
267
+ * Checks whether this amount is equal to another amount.
268
+ * @param amount - The amount to compare against.
269
+ * @returns `true` if both amounts have the same value and unit; otherwise, `false`.
270
+ * @example
271
+ * const amount1 = new AmountEdge(5, MassUnitPoint.gram);
272
+ * const amount2 = new AmountEdge(5, MassUnitPoint.gram);
273
+ * amount1.isEqual(amount2); // true
274
+ */
275
+ isEqual(amount) {
276
+ return (guardian_1._.isEqual(this._value, amount.value) && guardian_1._.isEqual(this._unit, amount.unit));
277
+ }
278
+ /**
279
+ * Checks whether this amount is different from another amount.
280
+ * @param amount - The amount to compare against.
281
+ * @returns `true` if the amounts are different; otherwise, `false`.
282
+ * @example
283
+ * const amount1 = new AmountEdge(5, MassUnitPoint.gram);
284
+ * const amount2 = new AmountEdge(3, MassUnitPoint.gram);
285
+ * amount1.isDifferent(amount2); // true
286
+ */
287
+ isDifferent(amount) {
288
+ return !this.isEqual(amount);
289
+ }
290
+ /**
291
+ * Checks whether this amount is greater than another amount.
292
+ * @param amount - The amount to compare against.
293
+ * @returns `true` if this amount's value is greater than `amount`'s value; otherwise, `false`.
294
+ * @example
295
+ * const amount1 = new AmountEdge(10, MassUnitPoint.gram);
296
+ * const amount2 = new AmountEdge(5, MassUnitPoint.gram);
297
+ * amount1.isGreaterThan(amount2); // true
298
+ */
299
+ isGreaterThan(amount) {
300
+ return this._value > amount.value;
301
+ }
302
+ /**
303
+ * Checks whether this amount is less than another amount.
304
+ * @param amount - The amount to compare against.
305
+ * @returns `true` if this amount's value is less than `amount`'s value; otherwise, `false`.
306
+ * @example
307
+ * const amount1 = new AmountEdge(3, MassUnitPoint.gram);
308
+ * const amount2 = new AmountEdge(5, MassUnitPoint.gram);
309
+ * amount1.isLessThan(amount2); // true
310
+ */
311
+ isLessThan(amount) {
312
+ return this._value < amount.value;
313
+ }
314
+ /**
315
+ * Checks whether this amount is greater than or equal to another amount.
316
+ * @param amount - The amount to compare against.
317
+ * @returns `true` if this amount's value is greater than or equal to `amount`'s value; otherwise, `false`.
318
+ * @example
319
+ * const amount1 = new AmountEdge(5, MassUnitPoint.gram);
320
+ * const amount2 = new AmountEdge(5, MassUnitPoint.gram);
321
+ * amount1.isGreaterThanOrEqual(amount2); // true
322
+ */
323
+ isGreaterThanOrEqual(amount) {
324
+ return this._value >= amount.value;
325
+ }
326
+ /**
327
+ * Checks whether this amount is less than or equal to another amount.
328
+ * @param amount - The amount to compare against.
329
+ * @returns `true` if this amount's value is less than or equal to `amount`'s value; otherwise, `false`.
330
+ * @example
331
+ * const amount1 = new AmountEdge(5, MassUnitPoint.gram);
332
+ * const amount2 = new AmountEdge(5, MassUnitPoint.gram);
333
+ * amount1.isLessThanOrEqual(amount2); // true
334
+ */
335
+ isLessThanOrEqual(amount) {
336
+ return this._value <= amount.value;
337
+ }
338
+ /**
339
+ * Checks whether this amount is between two bounds (inclusive).
340
+ * @param min - The minimum amount.
341
+ * @param max - The maximum amount.
342
+ * @returns `true` if the value is between min and max; otherwise, `false`.
343
+ * @example
344
+ * const amount = new AmountEdge(5, MassUnitPoint.gram);
345
+ * const min = new AmountEdge(1, MassUnitPoint.gram);
346
+ * const max = new AmountEdge(10, MassUnitPoint.gram);
347
+ * amount.isBetween(min, max); // true
348
+ */
349
+ isBetween(min, max) {
350
+ return this.isGreaterThanOrEqual(min) && this.isLessThanOrEqual(max);
351
+ }
352
+ // ====================
353
+ // Validations
354
+ // ====================
355
+ /**
356
+ * Checks whether the value is zero.
357
+ * @returns `true` if this.value === 0, `false` otherwise
358
+ * @example
359
+ * const amount = new AmountEdge(0, MassUnitPoint.gram);
360
+ * amount.isZero(); // true
361
+ */
362
+ isZero() {
363
+ return this._value === 0;
364
+ }
365
+ /**
366
+ * Checks whether the value is positive (greater than zero).
367
+ * @returns `true` if this.value > 0, `false` otherwise
368
+ * @example
369
+ * const amount = new AmountEdge(5, MassUnitPoint.gram);
370
+ * amount.isPositive(); // true
371
+ */
372
+ isPositive() {
373
+ return this._value > 0;
374
+ }
375
+ /**
376
+ * Checks whether the value is negative (less than zero).
377
+ * @returns `true` if this.value < 0, `false` otherwise
378
+ * @example
379
+ * const amount = new AmountEdge(-5, MassUnitPoint.gram);
380
+ * amount.isNegative(); // true
381
+ */
382
+ isNegative() {
383
+ return this._value < 0;
384
+ }
385
+ /**
386
+ * Checks whether the amount has a specific unit.
387
+ * @param unit - The unit to compare against.
388
+ * @returns `true` if the unit matches; otherwise, `false`.
389
+ * @example
390
+ * const amount = new AmountEdge(5, MassUnitPoint.gram);
391
+ * amount.hasUnit(MassUnitPoint.gram); // true
392
+ * amount.hasUnit(MassUnitPoint.kilogram); // false
393
+ */
394
+ hasUnit(unit) {
395
+ return guardian_1._.isEqual(this._unit, unit);
396
+ }
397
+ // ====================
398
+ // Cloning and Immutability
399
+ // ====================
400
+ /**
401
+ * Creates an independent copy of this amount.
402
+ * Useful for avoiding unintended mutations.
403
+ *
404
+ * @returns A new instance with the same value and unit.
405
+ *
406
+ * @example
407
+ * const amount1 = new AmountEdge(5, MassUnitPoint.gram);
408
+ * const amount2 = amount1.clone();
409
+ * amount2.multiplyBy(2); // amount1 remains 5, amount2 is 10
410
+ */
411
+ clone() {
412
+ return new AmountEdge(this._value, this._unit);
413
+ }
414
+ /**
415
+ * Returns a new instance with the value changed.
416
+ * Maintains the immutability of the original instance.
417
+ * @param value - New value
418
+ * @returns New instance with the changed value
419
+ * @example
420
+ * const amount = new AmountEdge(5, MassUnitPoint.gram);
421
+ * const newAmount = amount.withValue(10); // amount continua 5, newAmount é 10
422
+ */
423
+ withValue(value) {
424
+ return new AmountEdge(value, this._unit);
425
+ }
426
+ /**
427
+ * Returns a new instance with the unit changed.
428
+ * Maintains the immutability of the original instance.
429
+ * @param unit - New unit
430
+ * @returns New instance with the changed unit
431
+ * @example
432
+ * const amount = new AmountEdge(5, MassUnitPoint.gram);
433
+ * const newAmount = amount.withUnit(MassUnitPoint.kilogram);
434
+ */
435
+ withUnit(unit) {
436
+ return new AmountEdge(this._value, unit);
437
+ }
438
+ // ====================
439
+ // Formatting
440
+ // ====================
441
+ /**
442
+ * Returns a string representation of the amount.
443
+ * @returns A string in the format "value unit".
444
+ * @example
445
+ * const amount = new AmountEdge(5, MassUnitPoint.gram);
446
+ * amount.toString(); // "5 g"
447
+ */
448
+ toString() {
449
+ return `${this._value.toString()} ${this._unit}`;
450
+ }
451
+ /**
452
+ * Formats the amount as a string with a thousands separator and decimal precision.
453
+ * @param locale - Locale for formatting (e.g., 'en-US', 'pt-BR')
454
+ * @param precision - NNumber of decimal places
455
+ * @returns Formatted string
456
+ * @example
457
+ * const amount = new AmountEdge(1234.5678, MassUnitPoint.gram);
458
+ * amount.toFormattedString('pt-BR', 2); // "1.234,57 g"
459
+ */
460
+ toFormattedString(locale = "pt-BR", precision = 2) {
461
+ const formatted = this._value.toLocaleString(locale, {
462
+ minimumFractionDigits: precision,
463
+ maximumFractionDigits: precision,
464
+ });
465
+ return `${formatted} ${this._unit}`;
466
+ }
467
+ /**
468
+ * Returns only the value as a string with specific precision.
469
+ * @param precision - NNumber of decimal places
470
+ * @returns Formatted value string
471
+ * @example
472
+ * const amount = new AmountEdge(5.6789, MassUnitPoint.gram);
473
+ * amount.toValueString(2); // "5.68"
474
+ */
475
+ toValueString(precision = 2) {
476
+ return this._value.toFixed(precision);
477
+ }
478
+ // ====================
479
+ // Conversion
480
+ // ====================
481
+ /**
482
+ * Converts the amount to a Polygon object.
483
+ * @param precision - The number of decimal places to retain.
484
+ * @returns A Polygon object containing the value and unit.
485
+ * @example
486
+ * const amount = new AmountEdge(5.6789, MassUnitPoint.gram);
487
+ * amount.toPolygon(2); // { value: 5.68, unit: MassUnitPoint.gram }
488
+ */
489
+ toPolygon(precision = 2) {
490
+ return {
491
+ value: this._unit === mass_unit_point_1.MassUnitPoint.gram
492
+ ? Number(this._value.toFixed(0))
493
+ : Number(this._value.toFixed(precision)),
494
+ unit: this._unit,
495
+ };
496
+ }
497
+ /**
498
+ * Converts the amount to a JSON object.
499
+ * @returns JSON object with value and unit
500
+ * @example
501
+ * const amount = new AmountEdge(5, MassUnitPoint.gram);
502
+ * amount.toJSON(); // { value: 5, unit: "g" }
503
+ */
504
+ toJSON() {
505
+ return {
506
+ value: this._value,
507
+ unit: this._unit,
508
+ };
509
+ }
510
+ // ====================
511
+ // Static Methods
512
+ // ====================
513
+ /**
514
+ * Creates a new amount with a value of zero.
515
+ * @template T - The unit type.
516
+ * @param unit - The unit of the amount.
517
+ * @returns A new instance with a value of zero.
518
+ * @example
519
+ * const zero = AmountEdge.zero(MassUnitPoint.gram); // 0 g
520
+ */
521
+ static zero(unit) {
522
+ return new AmountEdge(0, unit);
523
+ }
524
+ /**
525
+ * Sums a list of amounts.
526
+ * @template T - The unit type.
527
+ * @param amounts - An array of amounts to sum.
528
+ * @returns A new instance containing the total sum.
529
+ * @example
530
+ * const amounts = [
531
+ * new AmountEdge(5, MassUnitPoint.gram),
532
+ * new AmountEdge(3, MassUnitPoint.gram),
533
+ * new AmountEdge(2, MassUnitPoint.gram),
534
+ * ];
535
+ * const total = AmountEdge.sumAll(amounts); // 10 g
536
+ */
537
+ static sumAll(amounts) {
538
+ if (amounts.length === 0) {
539
+ throw new Error("Cannot sum an empty array of amounts");
540
+ }
541
+ const total = amounts[0].clone();
542
+ for (let i = 1; i < amounts.length; i++) {
543
+ total.sum(amounts[i]);
544
+ }
545
+ return total;
546
+ }
547
+ /**
548
+ * Returns the maximum amount from a list.
549
+ * @template T - The unit type.
550
+ * @param amounts - n array of amounts.
551
+ * @returns A new instance with the maximum value.
552
+ * @example
553
+ * const amounts = [
554
+ * new AmountEdge(5, MassUnitPoint.gram),
555
+ * new AmountEdge(10, MassUnitPoint.gram),
556
+ * new AmountEdge(3, MassUnitPoint.gram),
557
+ * ];
558
+ * const max = AmountEdge.max(amounts); // 10 g
559
+ */
560
+ static max(amounts) {
561
+ if (amounts.length === 0) {
562
+ throw new Error("Cannot find max of an empty array of amounts");
563
+ }
564
+ let maxAmount = amounts[0].clone();
565
+ for (let i = 1; i < amounts.length; i++) {
566
+ if (amounts[i].isGreaterThan(maxAmount)) {
567
+ maxAmount = amounts[i].clone();
568
+ }
569
+ }
570
+ return maxAmount;
571
+ }
572
+ /**
573
+ * Returns the minimum amount from a list.
574
+ * @template T - The unit type.
575
+ * @param amounts - An array of amounts.
576
+ * @returns A new instance containing the smallest value.
577
+ * @example
578
+ * const amounts = [
579
+ * new AmountEdge(5, MassUnitPoint.gram),
580
+ * new AmountEdge(10, MassUnitPoint.gram),
581
+ * new AmountEdge(3, MassUnitPoint.gram),
582
+ * ];
583
+ * const min = AmountEdge.min(amounts); // 3 g
584
+ */
585
+ static min(amounts) {
586
+ if (amounts.length === 0) {
587
+ throw new Error("Cannot find min of an empty array of amounts");
588
+ }
589
+ let minAmount = amounts[0].clone();
590
+ for (let i = 1; i < amounts.length; i++) {
591
+ if (amounts[i].isLessThan(minAmount)) {
592
+ minAmount = amounts[i].clone();
593
+ }
594
+ }
595
+ return minAmount;
596
+ }
597
+ /**
598
+ * Calculates the average of a list of amounts.
599
+ * @template T - The unit type.
600
+ * @param amounts - n array of amounts.
601
+ * @returns A new instance with the average value.
602
+ * @example
603
+ * const amounts = [
604
+ * new AmountEdge(10, MassUnitPoint.gram),
605
+ * new AmountEdge(20, MassUnitPoint.gram),
606
+ * new AmountEdge(30, MassUnitPoint.gram),
607
+ * ];
608
+ * const average = AmountEdge.average(amounts); // 20 g
609
+ */
610
+ static average(amounts) {
611
+ const total = AmountEdge.sumAll(amounts);
612
+ total.divideBy(amounts.length);
613
+ return total;
614
+ }
615
+ /**
616
+ * Creates an amount from a Polygon object.
617
+ * @template T - The unit type.
618
+ * @param polygon - A Polygon object containing `value` and `unit`.
619
+ * @returns A new AmountEdge instance.
620
+ * @example
621
+ * const polygon = { value: 5, unit: MassUnitPoint.gram };
622
+ * const amount = AmountEdge.fromPolygon(polygon); // 5 g
623
+ */
624
+ static fromPolygon(polygon) {
625
+ return new AmountEdge(polygon.value, polygon.unit);
626
+ }
627
+ }
628
+ exports.AmountEdge = AmountEdge;
@@ -2,4 +2,3 @@ export interface AmountPolygon<UnitsPoint> {
2
2
  value: number;
3
3
  unit: UnitsPoint;
4
4
  }
5
- //# sourceMappingURL=amount.polygon.d.ts.map
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +1,8 @@
1
- import { AmountEdge } from "#/objects/amount/amount.edge";
2
- import { AmountPolygon } from "#/objects/amount/amount.polygon";
3
- import { UvAbstract } from "#/objects-interface/uv.abstract";
1
+ import { AmountEdge } from "../../objects/amount/amount.edge";
2
+ import { AmountPolygon } from "../../objects/amount/amount.polygon";
3
+ import { UvAbstract } from "../../objects-interface/uv.abstract";
4
4
  export declare class AmountUv<T> extends UvAbstract implements AmountPolygon<T> {
5
5
  value: number;
6
6
  unit: T;
7
7
  toEntity(): AmountEdge<T>;
8
8
  }
9
- //# sourceMappingURL=amount.uv.d.ts.map
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AmountUv = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const amount_edge_1 = require("../../objects/amount/amount.edge");
15
+ const uv_abstract_1 = require("../../objects-interface/uv.abstract");
16
+ class AmountUv extends uv_abstract_1.UvAbstract {
17
+ value;
18
+ unit;
19
+ toEntity() {
20
+ return new amount_edge_1.AmountEdge(this.value, this.unit);
21
+ }
22
+ }
23
+ exports.AmountUv = AmountUv;
24
+ __decorate([
25
+ (0, class_validator_1.IsNumber)(),
26
+ __metadata("design:type", Number)
27
+ ], AmountUv.prototype, "value", void 0);
28
+ __decorate([
29
+ (0, class_validator_1.IsString)(),
30
+ __metadata("design:type", Object)
31
+ ], AmountUv.prototype, "unit", void 0);
@@ -9,4 +9,3 @@ export declare enum DurationUnitPoint {
9
9
  milliseconds = "milliseconds",
10
10
  quarters = "quarters"
11
11
  }
12
- //# sourceMappingURL=duration-unit.point.d.ts.map