@bgord/tools 1.4.0 → 1.4.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 (425) hide show
  1. package/dist/{src/day.vo.d.ts → day.vo.d.ts} +1 -1
  2. package/dist/{src/day.vo.js → day.vo.js} +3 -3
  3. package/dist/{src/index.d.ts → index.d.ts} +1 -0
  4. package/dist/{src/index.js → index.js} +1 -0
  5. package/dist/int.vo.d.ts +8 -0
  6. package/dist/int.vo.js +15 -0
  7. package/dist/{src/month.vo.d.ts → month.vo.d.ts} +1 -1
  8. package/dist/{src/month.vo.js → month.vo.js} +3 -3
  9. package/dist/tsconfig.tsbuildinfo +1 -1
  10. package/dist/{src/week.vo.d.ts → week.vo.d.ts} +1 -1
  11. package/dist/{src/week.vo.js → week.vo.js} +3 -3
  12. package/dist/{src/year.vo.d.ts → year.vo.d.ts} +1 -1
  13. package/dist/{src/year.vo.js → year.vo.js} +3 -3
  14. package/package.json +2 -2
  15. package/readme.md +1 -0
  16. package/dist/tests/age-years.vo.test.d.ts +0 -1
  17. package/dist/tests/age-years.vo.test.js +0 -24
  18. package/dist/tests/age.vo.test.d.ts +0 -1
  19. package/dist/tests/age.vo.test.js +0 -106
  20. package/dist/tests/api-key.vo.test.d.ts +0 -1
  21. package/dist/tests/api-key.vo.test.js +0 -24
  22. package/dist/tests/basename.vo.test.d.ts +0 -1
  23. package/dist/tests/basename.vo.test.js +0 -53
  24. package/dist/tests/batch.test.d.ts +0 -1
  25. package/dist/tests/batch.test.js +0 -24
  26. package/dist/tests/date-calculator.service.test.d.ts +0 -1
  27. package/dist/tests/date-calculator.service.test.js +0 -32
  28. package/dist/tests/date-formatter.service.test.d.ts +0 -1
  29. package/dist/tests/date-formatter.service.test.js +0 -22
  30. package/dist/tests/date-range.vo.test.d.ts +0 -1
  31. package/dist/tests/date-range.vo.test.js +0 -49
  32. package/dist/tests/day-iso-id.vo.test.d.ts +0 -1
  33. package/dist/tests/day-iso-id.vo.test.js +0 -36
  34. package/dist/tests/day.vo.test.d.ts +0 -1
  35. package/dist/tests/day.vo.test.js +0 -68
  36. package/dist/tests/directory-path-absolute.vo.test.d.ts +0 -1
  37. package/dist/tests/directory-path-absolute.vo.test.js +0 -47
  38. package/dist/tests/directory-path-relative.vo.test.d.ts +0 -1
  39. package/dist/tests/directory-path-relative.vo.test.js +0 -44
  40. package/dist/tests/distance-value.vo.test.d.ts +0 -1
  41. package/dist/tests/distance-value.vo.test.js +0 -21
  42. package/dist/tests/distance.vo.test.d.ts +0 -1
  43. package/dist/tests/distance.vo.test.js +0 -74
  44. package/dist/tests/division-factor.vo.test.d.ts +0 -1
  45. package/dist/tests/division-factor.vo.test.js +0 -21
  46. package/dist/tests/dll.service.test.d.ts +0 -1
  47. package/dist/tests/dll.service.test.js +0 -381
  48. package/dist/tests/duration-ms.vo.test.d.ts +0 -1
  49. package/dist/tests/duration-ms.vo.test.js +0 -18
  50. package/dist/tests/duration.service.test.d.ts +0 -1
  51. package/dist/tests/duration.service.test.js +0 -126
  52. package/dist/tests/email-mask.service.test.d.ts +0 -1
  53. package/dist/tests/email-mask.service.test.js +0 -15
  54. package/dist/tests/email.vo.test.d.ts +0 -1
  55. package/dist/tests/email.vo.test.js +0 -17
  56. package/dist/tests/etags.vo.test.d.ts +0 -1
  57. package/dist/tests/etags.vo.test.js +0 -54
  58. package/dist/tests/extension.vo.test.d.ts +0 -1
  59. package/dist/tests/extension.vo.test.js +0 -51
  60. package/dist/tests/feature-flag-value.vo.test.d.ts +0 -1
  61. package/dist/tests/feature-flag-value.vo.test.js +0 -12
  62. package/dist/tests/feature-flag.vo.test.d.ts +0 -1
  63. package/dist/tests/feature-flag.vo.test.js +0 -13
  64. package/dist/tests/file-path-absolute-schema.vo.test.d.ts +0 -1
  65. package/dist/tests/file-path-absolute-schema.vo.test.js +0 -53
  66. package/dist/tests/file-path-relative-schema.vo.test.d.ts +0 -1
  67. package/dist/tests/file-path-relative-schema.vo.test.js +0 -52
  68. package/dist/tests/file-path.vo.test.d.ts +0 -1
  69. package/dist/tests/file-path.vo.test.js +0 -74
  70. package/dist/tests/filename-affix.vo.test.d.ts +0 -1
  71. package/dist/tests/filename-affix.vo.test.js +0 -30
  72. package/dist/tests/filename-from-string.vo.test.d.ts +0 -1
  73. package/dist/tests/filename-from-string.vo.test.js +0 -37
  74. package/dist/tests/filename.vo.test.d.ts +0 -1
  75. package/dist/tests/filename.vo.test.js +0 -93
  76. package/dist/tests/height-milimiters.vo.test.d.ts +0 -1
  77. package/dist/tests/height-milimiters.vo.test.js +0 -21
  78. package/dist/tests/height.vo.test.d.ts +0 -1
  79. package/dist/tests/height.vo.test.js +0 -64
  80. package/dist/tests/hour-value.vo.test.d.ts +0 -1
  81. package/dist/tests/hour-value.vo.test.js +0 -24
  82. package/dist/tests/hour.vo.test.d.ts +0 -1
  83. package/dist/tests/hour.vo.test.js +0 -64
  84. package/dist/tests/iban-mask.service.test.d.ts +0 -1
  85. package/dist/tests/iban-mask.service.test.js +0 -13
  86. package/dist/tests/iban-schema.vo.test.d.ts +0 -1
  87. package/dist/tests/iban-schema.vo.test.js +0 -43
  88. package/dist/tests/iban.vo.test.d.ts +0 -1
  89. package/dist/tests/iban.vo.test.js +0 -46
  90. package/dist/tests/image.vo.test.d.ts +0 -1
  91. package/dist/tests/image.vo.test.js +0 -41
  92. package/dist/tests/integer-non-negative.vo.test.d.ts +0 -1
  93. package/dist/tests/integer-non-negative.vo.test.js +0 -22
  94. package/dist/tests/integer-positive.vo.test.d.ts +0 -1
  95. package/dist/tests/integer-positive.vo.test.js +0 -21
  96. package/dist/tests/integer.vo.test.d.ts +0 -1
  97. package/dist/tests/integer.vo.test.js +0 -21
  98. package/dist/tests/language.vo.test.d.ts +0 -1
  99. package/dist/tests/language.vo.test.js +0 -28
  100. package/dist/tests/linear-regression.service.test.d.ts +0 -1
  101. package/dist/tests/linear-regression.service.test.js +0 -111
  102. package/dist/tests/mean.service.test.d.ts +0 -1
  103. package/dist/tests/mean.service.test.js +0 -23
  104. package/dist/tests/mime-registry-entry.vo.test.d.ts +0 -1
  105. package/dist/tests/mime-registry-entry.vo.test.js +0 -15
  106. package/dist/tests/mime-registry.service.test.d.ts +0 -1
  107. package/dist/tests/mime-registry.service.test.js +0 -45
  108. package/dist/tests/mime-value.vo.test.d.ts +0 -1
  109. package/dist/tests/mime-value.vo.test.js +0 -49
  110. package/dist/tests/mime.vo.test.d.ts +0 -1
  111. package/dist/tests/mime.vo.test.js +0 -53
  112. package/dist/tests/mimes.test.d.ts +0 -1
  113. package/dist/tests/mimes.test.js +0 -28
  114. package/dist/tests/min-max-scaler.service.test.d.ts +0 -1
  115. package/dist/tests/min-max-scaler.service.test.js +0 -116
  116. package/dist/tests/minute-value.vo.test.d.ts +0 -1
  117. package/dist/tests/minute-value.vo.test.js +0 -24
  118. package/dist/tests/minute.vo.test.d.ts +0 -1
  119. package/dist/tests/minute.vo.test.js +0 -64
  120. package/dist/tests/mocks.d.ts +0 -6
  121. package/dist/tests/mocks.js +0 -7
  122. package/dist/tests/money-amount.vo.test.d.ts +0 -1
  123. package/dist/tests/money-amount.vo.test.js +0 -21
  124. package/dist/tests/money.vo.test.d.ts +0 -1
  125. package/dist/tests/money.vo.test.js +0 -90
  126. package/dist/tests/month-iso-id.vo.test.d.ts +0 -1
  127. package/dist/tests/month-iso-id.vo.test.js +0 -36
  128. package/dist/tests/month.vo.test.d.ts +0 -1
  129. package/dist/tests/month.vo.test.js +0 -65
  130. package/dist/tests/multiplication-factor.vo.test.d.ts +0 -1
  131. package/dist/tests/multiplication-factor.vo.test.js +0 -19
  132. package/dist/tests/noop.test.d.ts +0 -1
  133. package/dist/tests/noop.test.js +0 -12
  134. package/dist/tests/object-key.vo.test.d.ts +0 -1
  135. package/dist/tests/object-key.vo.test.js +0 -56
  136. package/dist/tests/outlier-detector.service.test.d.ts +0 -1
  137. package/dist/tests/outlier-detector.service.test.js +0 -35
  138. package/dist/tests/package-version-schema.vo.test.d.ts +0 -1
  139. package/dist/tests/package-version-schema.vo.test.js +0 -32
  140. package/dist/tests/package-version.vo.test.d.ts +0 -1
  141. package/dist/tests/package-version.vo.test.js +0 -138
  142. package/dist/tests/pagination-page.vo.test.d.ts +0 -1
  143. package/dist/tests/pagination-page.vo.test.js +0 -26
  144. package/dist/tests/pagination-skip.vo.test.d.ts +0 -1
  145. package/dist/tests/pagination-skip.vo.test.js +0 -23
  146. package/dist/tests/pagination-take.vo.test.d.ts +0 -1
  147. package/dist/tests/pagination-take.vo.test.js +0 -25
  148. package/dist/tests/pagination.service.test.d.ts +0 -1
  149. package/dist/tests/pagination.service.test.js +0 -92
  150. package/dist/tests/percentage.service.test.d.ts +0 -1
  151. package/dist/tests/percentage.service.test.js +0 -16
  152. package/dist/tests/population-standard-deviation.service.test.d.ts +0 -1
  153. package/dist/tests/population-standard-deviation.service.test.js +0 -20
  154. package/dist/tests/quarter-iso-id.vo.test.d.ts +0 -1
  155. package/dist/tests/quarter-iso-id.vo.test.js +0 -30
  156. package/dist/tests/quarter.vo.test.d.ts +0 -1
  157. package/dist/tests/quarter.vo.test.js +0 -54
  158. package/dist/tests/random.service.test.d.ts +0 -1
  159. package/dist/tests/random.service.test.js +0 -93
  160. package/dist/tests/rate-limiter.service.test.d.ts +0 -1
  161. package/dist/tests/rate-limiter.service.test.js +0 -39
  162. package/dist/tests/relative-date.vo.test.d.ts +0 -1
  163. package/dist/tests/relative-date.vo.test.js +0 -22
  164. package/dist/tests/reordering-item-position-value.vo.test.d.ts +0 -1
  165. package/dist/tests/reordering-item-position-value.vo.test.js +0 -21
  166. package/dist/tests/reordering.service.test.d.ts +0 -1
  167. package/dist/tests/reordering.service.test.js +0 -76
  168. package/dist/tests/repeat.test.d.ts +0 -1
  169. package/dist/tests/repeat.test.js +0 -8
  170. package/dist/tests/revision-value.vo.test.d.ts +0 -1
  171. package/dist/tests/revision-value.vo.test.js +0 -21
  172. package/dist/tests/revision.vo.test.d.ts +0 -1
  173. package/dist/tests/revision.vo.test.js +0 -52
  174. package/dist/tests/rounding-decimal.strategy.test.d.ts +0 -1
  175. package/dist/tests/rounding-decimal.strategy.test.js +0 -17
  176. package/dist/tests/rounding-down.strategy.test.d.ts +0 -1
  177. package/dist/tests/rounding-down.strategy.test.js +0 -9
  178. package/dist/tests/rounding-to-nearest.strategy.test.d.ts +0 -1
  179. package/dist/tests/rounding-to-nearest.strategy.test.js +0 -9
  180. package/dist/tests/rounding-up.strategy.test.d.ts +0 -1
  181. package/dist/tests/rounding-up.strategy.test.js +0 -9
  182. package/dist/tests/size-bytes.vo.test.d.ts +0 -1
  183. package/dist/tests/size-bytes.vo.test.js +0 -21
  184. package/dist/tests/size.vo.test.d.ts +0 -1
  185. package/dist/tests/size.vo.test.js +0 -93
  186. package/dist/tests/slug.service.test.d.ts +0 -1
  187. package/dist/tests/slug.service.test.js +0 -45
  188. package/dist/tests/sum.service.test.d.ts +0 -1
  189. package/dist/tests/sum.service.test.js +0 -22
  190. package/dist/tests/thousands-separator.service.test.d.ts +0 -1
  191. package/dist/tests/thousands-separator.service.test.js +0 -27
  192. package/dist/tests/time-zone-offset-value.test.d.ts +0 -1
  193. package/dist/tests/time-zone-offset-value.test.js +0 -27
  194. package/dist/tests/timestamp-value.vo.test.d.ts +0 -1
  195. package/dist/tests/timestamp-value.vo.test.js +0 -21
  196. package/dist/tests/timestamp.vo.test.d.ts +0 -1
  197. package/dist/tests/timestamp.vo.test.js +0 -73
  198. package/dist/tests/timezone.vo.test.d.ts +0 -1
  199. package/dist/tests/timezone.vo.test.js +0 -29
  200. package/dist/tests/url-with-slash.vo.test.d.ts +0 -1
  201. package/dist/tests/url-with-slash.vo.test.js +0 -24
  202. package/dist/tests/url-without-slash.vo.test.d.ts +0 -1
  203. package/dist/tests/url-without-slash.vo.test.js +0 -25
  204. package/dist/tests/visually-unambiguous-characters-generator.service.test.d.ts +0 -1
  205. package/dist/tests/visually-unambiguous-characters-generator.service.test.js +0 -89
  206. package/dist/tests/week-iso-id.vo.test.d.ts +0 -1
  207. package/dist/tests/week-iso-id.vo.test.js +0 -37
  208. package/dist/tests/week.vo.test.d.ts +0 -1
  209. package/dist/tests/week.vo.test.js +0 -64
  210. package/dist/tests/weekday-iso-id.vo.test.d.ts +0 -1
  211. package/dist/tests/weekday-iso-id.vo.test.js +0 -24
  212. package/dist/tests/weekday.vo.test.d.ts +0 -1
  213. package/dist/tests/weekday.vo.test.js +0 -51
  214. package/dist/tests/weight-grams.vo.test.d.ts +0 -1
  215. package/dist/tests/weight-grams.vo.test.js +0 -21
  216. package/dist/tests/weight.vo.test.d.ts +0 -1
  217. package/dist/tests/weight.vo.test.js +0 -66
  218. package/dist/tests/year-iso-id.vo.test.d.ts +0 -1
  219. package/dist/tests/year-iso-id.vo.test.js +0 -23
  220. package/dist/tests/year.vo.test.d.ts +0 -1
  221. package/dist/tests/year.vo.test.js +0 -79
  222. package/dist/tests/z-score.service.test.d.ts +0 -1
  223. package/dist/tests/z-score.service.test.js +0 -26
  224. /package/dist/{src/age-years.vo.d.ts → age-years.vo.d.ts} +0 -0
  225. /package/dist/{src/age-years.vo.js → age-years.vo.js} +0 -0
  226. /package/dist/{src/age.vo.d.ts → age.vo.d.ts} +0 -0
  227. /package/dist/{src/age.vo.js → age.vo.js} +0 -0
  228. /package/dist/{src/api-key.vo.d.ts → api-key.vo.d.ts} +0 -0
  229. /package/dist/{src/api-key.vo.js → api-key.vo.js} +0 -0
  230. /package/dist/{src/basename.vo.d.ts → basename.vo.d.ts} +0 -0
  231. /package/dist/{src/basename.vo.js → basename.vo.js} +0 -0
  232. /package/dist/{src/batch.d.ts → batch.d.ts} +0 -0
  233. /package/dist/{src/batch.js → batch.js} +0 -0
  234. /package/dist/{src/date-calculator.service.d.ts → date-calculator.service.d.ts} +0 -0
  235. /package/dist/{src/date-calculator.service.js → date-calculator.service.js} +0 -0
  236. /package/dist/{src/date-formatter.service.d.ts → date-formatter.service.d.ts} +0 -0
  237. /package/dist/{src/date-formatter.service.js → date-formatter.service.js} +0 -0
  238. /package/dist/{src/date-range.vo.d.ts → date-range.vo.d.ts} +0 -0
  239. /package/dist/{src/date-range.vo.js → date-range.vo.js} +0 -0
  240. /package/dist/{src/day-iso-id.vo.d.ts → day-iso-id.vo.d.ts} +0 -0
  241. /package/dist/{src/day-iso-id.vo.js → day-iso-id.vo.js} +0 -0
  242. /package/dist/{src/directory-path-absolute.vo.d.ts → directory-path-absolute.vo.d.ts} +0 -0
  243. /package/dist/{src/directory-path-absolute.vo.js → directory-path-absolute.vo.js} +0 -0
  244. /package/dist/{src/directory-path-relative.vo.d.ts → directory-path-relative.vo.d.ts} +0 -0
  245. /package/dist/{src/directory-path-relative.vo.js → directory-path-relative.vo.js} +0 -0
  246. /package/dist/{src/distance-value.vo.d.ts → distance-value.vo.d.ts} +0 -0
  247. /package/dist/{src/distance-value.vo.js → distance-value.vo.js} +0 -0
  248. /package/dist/{src/distance.vo.d.ts → distance.vo.d.ts} +0 -0
  249. /package/dist/{src/distance.vo.js → distance.vo.js} +0 -0
  250. /package/dist/{src/division-factor.vo.d.ts → division-factor.vo.d.ts} +0 -0
  251. /package/dist/{src/division-factor.vo.js → division-factor.vo.js} +0 -0
  252. /package/dist/{src/dll.service.d.ts → dll.service.d.ts} +0 -0
  253. /package/dist/{src/dll.service.js → dll.service.js} +0 -0
  254. /package/dist/{src/duration-ms.vo.d.ts → duration-ms.vo.d.ts} +0 -0
  255. /package/dist/{src/duration-ms.vo.js → duration-ms.vo.js} +0 -0
  256. /package/dist/{src/duration.service.d.ts → duration.service.d.ts} +0 -0
  257. /package/dist/{src/duration.service.js → duration.service.js} +0 -0
  258. /package/dist/{src/email-mask.service.d.ts → email-mask.service.d.ts} +0 -0
  259. /package/dist/{src/email-mask.service.js → email-mask.service.js} +0 -0
  260. /package/dist/{src/email.vo.d.ts → email.vo.d.ts} +0 -0
  261. /package/dist/{src/email.vo.js → email.vo.js} +0 -0
  262. /package/dist/{src/etags.vo.d.ts → etags.vo.d.ts} +0 -0
  263. /package/dist/{src/etags.vo.js → etags.vo.js} +0 -0
  264. /package/dist/{src/extension.vo.d.ts → extension.vo.d.ts} +0 -0
  265. /package/dist/{src/extension.vo.js → extension.vo.js} +0 -0
  266. /package/dist/{src/feature-flag-value.vo.d.ts → feature-flag-value.vo.d.ts} +0 -0
  267. /package/dist/{src/feature-flag-value.vo.js → feature-flag-value.vo.js} +0 -0
  268. /package/dist/{src/feature-flag.vo.d.ts → feature-flag.vo.d.ts} +0 -0
  269. /package/dist/{src/feature-flag.vo.js → feature-flag.vo.js} +0 -0
  270. /package/dist/{src/file-path-absolute-schema.vo.d.ts → file-path-absolute-schema.vo.d.ts} +0 -0
  271. /package/dist/{src/file-path-absolute-schema.vo.js → file-path-absolute-schema.vo.js} +0 -0
  272. /package/dist/{src/file-path-relative-schema.vo.d.ts → file-path-relative-schema.vo.d.ts} +0 -0
  273. /package/dist/{src/file-path-relative-schema.vo.js → file-path-relative-schema.vo.js} +0 -0
  274. /package/dist/{src/file-path.vo.d.ts → file-path.vo.d.ts} +0 -0
  275. /package/dist/{src/file-path.vo.js → file-path.vo.js} +0 -0
  276. /package/dist/{src/filename-affix.vo.d.ts → filename-affix.vo.d.ts} +0 -0
  277. /package/dist/{src/filename-affix.vo.js → filename-affix.vo.js} +0 -0
  278. /package/dist/{src/filename-from-string.vo.d.ts → filename-from-string.vo.d.ts} +0 -0
  279. /package/dist/{src/filename-from-string.vo.js → filename-from-string.vo.js} +0 -0
  280. /package/dist/{src/filename.vo.d.ts → filename.vo.d.ts} +0 -0
  281. /package/dist/{src/filename.vo.js → filename.vo.js} +0 -0
  282. /package/dist/{src/height-milimiters.vo.d.ts → height-milimiters.vo.d.ts} +0 -0
  283. /package/dist/{src/height-milimiters.vo.js → height-milimiters.vo.js} +0 -0
  284. /package/dist/{src/height.vo.d.ts → height.vo.d.ts} +0 -0
  285. /package/dist/{src/height.vo.js → height.vo.js} +0 -0
  286. /package/dist/{src/hour-value.vo.d.ts → hour-value.vo.d.ts} +0 -0
  287. /package/dist/{src/hour-value.vo.js → hour-value.vo.js} +0 -0
  288. /package/dist/{src/hour.vo.d.ts → hour.vo.d.ts} +0 -0
  289. /package/dist/{src/hour.vo.js → hour.vo.js} +0 -0
  290. /package/dist/{src/iban-mask.service.d.ts → iban-mask.service.d.ts} +0 -0
  291. /package/dist/{src/iban-mask.service.js → iban-mask.service.js} +0 -0
  292. /package/dist/{src/iban-schema.vo.d.ts → iban-schema.vo.d.ts} +0 -0
  293. /package/dist/{src/iban-schema.vo.js → iban-schema.vo.js} +0 -0
  294. /package/dist/{src/iban.vo.d.ts → iban.vo.d.ts} +0 -0
  295. /package/dist/{src/iban.vo.js → iban.vo.js} +0 -0
  296. /package/dist/{src/image.vo.d.ts → image.vo.d.ts} +0 -0
  297. /package/dist/{src/image.vo.js → image.vo.js} +0 -0
  298. /package/dist/{src/integer-non-negative.vo.d.ts → integer-non-negative.vo.d.ts} +0 -0
  299. /package/dist/{src/integer-non-negative.vo.js → integer-non-negative.vo.js} +0 -0
  300. /package/dist/{src/integer-positive.vo.d.ts → integer-positive.vo.d.ts} +0 -0
  301. /package/dist/{src/integer-positive.vo.js → integer-positive.vo.js} +0 -0
  302. /package/dist/{src/integer.vo.d.ts → integer.vo.d.ts} +0 -0
  303. /package/dist/{src/integer.vo.js → integer.vo.js} +0 -0
  304. /package/dist/{src/language.vo.d.ts → language.vo.d.ts} +0 -0
  305. /package/dist/{src/language.vo.js → language.vo.js} +0 -0
  306. /package/dist/{src/linear-regression.service.d.ts → linear-regression.service.d.ts} +0 -0
  307. /package/dist/{src/linear-regression.service.js → linear-regression.service.js} +0 -0
  308. /package/dist/{src/mean.service.d.ts → mean.service.d.ts} +0 -0
  309. /package/dist/{src/mean.service.js → mean.service.js} +0 -0
  310. /package/dist/{src/mime-registry-entry.vo.d.ts → mime-registry-entry.vo.d.ts} +0 -0
  311. /package/dist/{src/mime-registry-entry.vo.js → mime-registry-entry.vo.js} +0 -0
  312. /package/dist/{src/mime-registry.service.d.ts → mime-registry.service.d.ts} +0 -0
  313. /package/dist/{src/mime-registry.service.js → mime-registry.service.js} +0 -0
  314. /package/dist/{src/mime-value.vo.d.ts → mime-value.vo.d.ts} +0 -0
  315. /package/dist/{src/mime-value.vo.js → mime-value.vo.js} +0 -0
  316. /package/dist/{src/mime.vo.d.ts → mime.vo.d.ts} +0 -0
  317. /package/dist/{src/mime.vo.js → mime.vo.js} +0 -0
  318. /package/dist/{src/mimes.d.ts → mimes.d.ts} +0 -0
  319. /package/dist/{src/mimes.js → mimes.js} +0 -0
  320. /package/dist/{src/min-max-scaler.service.d.ts → min-max-scaler.service.d.ts} +0 -0
  321. /package/dist/{src/min-max-scaler.service.js → min-max-scaler.service.js} +0 -0
  322. /package/dist/{src/minute-value.vo.d.ts → minute-value.vo.d.ts} +0 -0
  323. /package/dist/{src/minute-value.vo.js → minute-value.vo.js} +0 -0
  324. /package/dist/{src/minute.vo.d.ts → minute.vo.d.ts} +0 -0
  325. /package/dist/{src/minute.vo.js → minute.vo.js} +0 -0
  326. /package/dist/{src/money-amount.vo.d.ts → money-amount.vo.d.ts} +0 -0
  327. /package/dist/{src/money-amount.vo.js → money-amount.vo.js} +0 -0
  328. /package/dist/{src/money.vo.d.ts → money.vo.d.ts} +0 -0
  329. /package/dist/{src/money.vo.js → money.vo.js} +0 -0
  330. /package/dist/{src/month-iso-id.vo.d.ts → month-iso-id.vo.d.ts} +0 -0
  331. /package/dist/{src/month-iso-id.vo.js → month-iso-id.vo.js} +0 -0
  332. /package/dist/{src/multiplication-factor.vo.d.ts → multiplication-factor.vo.d.ts} +0 -0
  333. /package/dist/{src/multiplication-factor.vo.js → multiplication-factor.vo.js} +0 -0
  334. /package/dist/{src/noop.service.d.ts → noop.service.d.ts} +0 -0
  335. /package/dist/{src/noop.service.js → noop.service.js} +0 -0
  336. /package/dist/{src/object-key.vo.d.ts → object-key.vo.d.ts} +0 -0
  337. /package/dist/{src/object-key.vo.js → object-key.vo.js} +0 -0
  338. /package/dist/{src/outlier-detector.service.d.ts → outlier-detector.service.d.ts} +0 -0
  339. /package/dist/{src/outlier-detector.service.js → outlier-detector.service.js} +0 -0
  340. /package/dist/{src/package-version-schema.vo.d.ts → package-version-schema.vo.d.ts} +0 -0
  341. /package/dist/{src/package-version-schema.vo.js → package-version-schema.vo.js} +0 -0
  342. /package/dist/{src/package-version.vo.d.ts → package-version.vo.d.ts} +0 -0
  343. /package/dist/{src/package-version.vo.js → package-version.vo.js} +0 -0
  344. /package/dist/{src/pagination-page.vo.d.ts → pagination-page.vo.d.ts} +0 -0
  345. /package/dist/{src/pagination-page.vo.js → pagination-page.vo.js} +0 -0
  346. /package/dist/{src/pagination-skip.vo.d.ts → pagination-skip.vo.d.ts} +0 -0
  347. /package/dist/{src/pagination-skip.vo.js → pagination-skip.vo.js} +0 -0
  348. /package/dist/{src/pagination-take.vo.d.ts → pagination-take.vo.d.ts} +0 -0
  349. /package/dist/{src/pagination-take.vo.js → pagination-take.vo.js} +0 -0
  350. /package/dist/{src/pagination.service.d.ts → pagination.service.d.ts} +0 -0
  351. /package/dist/{src/pagination.service.js → pagination.service.js} +0 -0
  352. /package/dist/{src/percentage.service.d.ts → percentage.service.d.ts} +0 -0
  353. /package/dist/{src/percentage.service.js → percentage.service.js} +0 -0
  354. /package/dist/{src/population-standard-deviation.service.d.ts → population-standard-deviation.service.d.ts} +0 -0
  355. /package/dist/{src/population-standard-deviation.service.js → population-standard-deviation.service.js} +0 -0
  356. /package/dist/{src/quarter-iso-id.vo.d.ts → quarter-iso-id.vo.d.ts} +0 -0
  357. /package/dist/{src/quarter-iso-id.vo.js → quarter-iso-id.vo.js} +0 -0
  358. /package/dist/{src/quarter.vo.d.ts → quarter.vo.d.ts} +0 -0
  359. /package/dist/{src/quarter.vo.js → quarter.vo.js} +0 -0
  360. /package/dist/{src/random.service.d.ts → random.service.d.ts} +0 -0
  361. /package/dist/{src/random.service.js → random.service.js} +0 -0
  362. /package/dist/{src/rate-limiter.service.d.ts → rate-limiter.service.d.ts} +0 -0
  363. /package/dist/{src/rate-limiter.service.js → rate-limiter.service.js} +0 -0
  364. /package/dist/{src/relative-date.vo.d.ts → relative-date.vo.d.ts} +0 -0
  365. /package/dist/{src/relative-date.vo.js → relative-date.vo.js} +0 -0
  366. /package/dist/{src/reordering-item-position-value.vo.d.ts → reordering-item-position-value.vo.d.ts} +0 -0
  367. /package/dist/{src/reordering-item-position-value.vo.js → reordering-item-position-value.vo.js} +0 -0
  368. /package/dist/{src/reordering.service.d.ts → reordering.service.d.ts} +0 -0
  369. /package/dist/{src/reordering.service.js → reordering.service.js} +0 -0
  370. /package/dist/{src/repeat.d.ts → repeat.d.ts} +0 -0
  371. /package/dist/{src/repeat.js → repeat.js} +0 -0
  372. /package/dist/{src/revision-value.vo.d.ts → revision-value.vo.d.ts} +0 -0
  373. /package/dist/{src/revision-value.vo.js → revision-value.vo.js} +0 -0
  374. /package/dist/{src/revision.vo.d.ts → revision.vo.d.ts} +0 -0
  375. /package/dist/{src/revision.vo.js → revision.vo.js} +0 -0
  376. /package/dist/{src/rounding-decimal.strategy.d.ts → rounding-decimal.strategy.d.ts} +0 -0
  377. /package/dist/{src/rounding-decimal.strategy.js → rounding-decimal.strategy.js} +0 -0
  378. /package/dist/{src/rounding-down.strategy.d.ts → rounding-down.strategy.d.ts} +0 -0
  379. /package/dist/{src/rounding-down.strategy.js → rounding-down.strategy.js} +0 -0
  380. /package/dist/{src/rounding-to-nearest.strategy.d.ts → rounding-to-nearest.strategy.d.ts} +0 -0
  381. /package/dist/{src/rounding-to-nearest.strategy.js → rounding-to-nearest.strategy.js} +0 -0
  382. /package/dist/{src/rounding-up.strategy.d.ts → rounding-up.strategy.d.ts} +0 -0
  383. /package/dist/{src/rounding-up.strategy.js → rounding-up.strategy.js} +0 -0
  384. /package/dist/{src/rounding.strategy.d.ts → rounding.strategy.d.ts} +0 -0
  385. /package/dist/{src/rounding.strategy.js → rounding.strategy.js} +0 -0
  386. /package/dist/{src/size-bytes.vo.d.ts → size-bytes.vo.d.ts} +0 -0
  387. /package/dist/{src/size-bytes.vo.js → size-bytes.vo.js} +0 -0
  388. /package/dist/{src/size.vo.d.ts → size.vo.d.ts} +0 -0
  389. /package/dist/{src/size.vo.js → size.vo.js} +0 -0
  390. /package/dist/{src/slug.service.d.ts → slug.service.d.ts} +0 -0
  391. /package/dist/{src/slug.service.js → slug.service.js} +0 -0
  392. /package/dist/{src/sum.service.d.ts → sum.service.d.ts} +0 -0
  393. /package/dist/{src/sum.service.js → sum.service.js} +0 -0
  394. /package/dist/{src/thousands-separator.service.d.ts → thousands-separator.service.d.ts} +0 -0
  395. /package/dist/{src/thousands-separator.service.js → thousands-separator.service.js} +0 -0
  396. /package/dist/{src/time-zone-offset-value.vo.d.ts → time-zone-offset-value.vo.d.ts} +0 -0
  397. /package/dist/{src/time-zone-offset-value.vo.js → time-zone-offset-value.vo.js} +0 -0
  398. /package/dist/{src/timestamp-value.vo.d.ts → timestamp-value.vo.d.ts} +0 -0
  399. /package/dist/{src/timestamp-value.vo.js → timestamp-value.vo.js} +0 -0
  400. /package/dist/{src/timestamp.vo.d.ts → timestamp.vo.d.ts} +0 -0
  401. /package/dist/{src/timestamp.vo.js → timestamp.vo.js} +0 -0
  402. /package/dist/{src/timezone.vo.d.ts → timezone.vo.d.ts} +0 -0
  403. /package/dist/{src/timezone.vo.js → timezone.vo.js} +0 -0
  404. /package/dist/{src/ts-utils.d.ts → ts-utils.d.ts} +0 -0
  405. /package/dist/{src/ts-utils.js → ts-utils.js} +0 -0
  406. /package/dist/{src/url-with-slash.vo.d.ts → url-with-slash.vo.d.ts} +0 -0
  407. /package/dist/{src/url-with-slash.vo.js → url-with-slash.vo.js} +0 -0
  408. /package/dist/{src/url-without-slash.vo.d.ts → url-without-slash.vo.d.ts} +0 -0
  409. /package/dist/{src/url-without-slash.vo.js → url-without-slash.vo.js} +0 -0
  410. /package/dist/{src/visually-unambiguous-characters-generator.service.d.ts → visually-unambiguous-characters-generator.service.d.ts} +0 -0
  411. /package/dist/{src/visually-unambiguous-characters-generator.service.js → visually-unambiguous-characters-generator.service.js} +0 -0
  412. /package/dist/{src/week-iso-id.vo.d.ts → week-iso-id.vo.d.ts} +0 -0
  413. /package/dist/{src/week-iso-id.vo.js → week-iso-id.vo.js} +0 -0
  414. /package/dist/{src/weekday-iso-id.vo.d.ts → weekday-iso-id.vo.d.ts} +0 -0
  415. /package/dist/{src/weekday-iso-id.vo.js → weekday-iso-id.vo.js} +0 -0
  416. /package/dist/{src/weekday.vo.d.ts → weekday.vo.d.ts} +0 -0
  417. /package/dist/{src/weekday.vo.js → weekday.vo.js} +0 -0
  418. /package/dist/{src/weight-grams.vo.d.ts → weight-grams.vo.d.ts} +0 -0
  419. /package/dist/{src/weight-grams.vo.js → weight-grams.vo.js} +0 -0
  420. /package/dist/{src/weight.vo.d.ts → weight.vo.d.ts} +0 -0
  421. /package/dist/{src/weight.vo.js → weight.vo.js} +0 -0
  422. /package/dist/{src/year-iso-id.vo.d.ts → year-iso-id.vo.d.ts} +0 -0
  423. /package/dist/{src/year-iso-id.vo.js → year-iso-id.vo.js} +0 -0
  424. /package/dist/{src/z-score.service.d.ts → z-score.service.d.ts} +0 -0
  425. /package/dist/{src/z-score.service.js → z-score.service.js} +0 -0
@@ -1,381 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import { DoublyLinkedList, Node } from "../src/dll.service";
3
- class Token {
4
- value;
5
- constructor(value) {
6
- this.value = value;
7
- }
8
- }
9
- const token = new Token("test");
10
- describe("DLL", () => {
11
- test("creates an empty List", () => {
12
- const dll = new DoublyLinkedList();
13
- expect(dll.getSize()).toEqual(0);
14
- expect(dll.getHead()).toEqual(null);
15
- expect(dll.getTail()).toEqual(null);
16
- });
17
- test("isEmpty", () => {
18
- const dll = new DoublyLinkedList();
19
- expect(dll.isEmpty()).toEqual(true);
20
- dll.append(new Node(token));
21
- expect(dll.isEmpty()).toEqual(false);
22
- });
23
- test("appends the first Node", () => {
24
- const dll = new DoublyLinkedList();
25
- const node = new Node(token);
26
- dll.append(node);
27
- expect(dll.getSize()).toEqual(1);
28
- expect(dll.getHead()).toEqual(node);
29
- expect(dll.getTail()).toEqual(node);
30
- });
31
- test("appends two Nodes", () => {
32
- const dll = new DoublyLinkedList();
33
- const firstNode = new Node(token);
34
- const secondNode = new Node(token);
35
- dll.append(firstNode);
36
- expect(dll.getSize()).toEqual(1);
37
- expect(dll.getHead()).toEqual(firstNode);
38
- expect(dll.getTail()).toEqual(firstNode);
39
- dll.append(secondNode);
40
- expect(dll.getSize()).toEqual(2);
41
- expect(dll.getHead()).toEqual(firstNode);
42
- expect(dll.getTail()).toEqual(secondNode);
43
- expect(firstNode.backward(1)).toEqual(null);
44
- expect(firstNode.forward(1)).toEqual(secondNode);
45
- expect(secondNode.backward(1)).toEqual(firstNode);
46
- expect(secondNode.forward(1)).toEqual(null);
47
- });
48
- test("appends three Nodes", () => {
49
- const dll = new DoublyLinkedList();
50
- const firstNode = new Node(token);
51
- const secondNode = new Node(token);
52
- const thirdNode = new Node(token);
53
- dll.append(firstNode);
54
- expect(dll.getSize()).toEqual(1);
55
- expect(dll.getHead()).toEqual(firstNode);
56
- expect(dll.getTail()).toEqual(firstNode);
57
- dll.append(secondNode);
58
- expect(dll.getSize()).toEqual(2);
59
- expect(dll.getHead()).toEqual(firstNode);
60
- expect(dll.getTail()).toEqual(secondNode);
61
- expect(firstNode.backward(1)).toEqual(null);
62
- expect(firstNode.forward(1)).toEqual(secondNode);
63
- expect(secondNode.backward(1)).toEqual(firstNode);
64
- expect(secondNode.forward(1)).toEqual(null);
65
- dll.append(thirdNode);
66
- expect(dll.getSize()).toEqual(3);
67
- expect(dll.getHead()).toEqual(firstNode);
68
- expect(dll.getTail()).toEqual(thirdNode);
69
- expect(firstNode.backward(1)).toEqual(null);
70
- expect(firstNode.forward(1)).toEqual(secondNode);
71
- expect(secondNode.backward(1)).toEqual(firstNode);
72
- expect(secondNode.forward(1)).toEqual(thirdNode);
73
- expect(thirdNode.backward(1)).toEqual(secondNode);
74
- expect(thirdNode.forward(1)).toEqual(null);
75
- });
76
- test("appends four Nodes", () => {
77
- const dll = new DoublyLinkedList();
78
- const firstNode = new Node(token);
79
- const secondNode = new Node(token);
80
- const thirdNode = new Node(token);
81
- const fourthNode = new Node(token);
82
- dll.append(firstNode);
83
- expect(dll.getSize()).toEqual(1);
84
- expect(dll.getHead()).toEqual(firstNode);
85
- expect(dll.getTail()).toEqual(firstNode);
86
- dll.append(secondNode);
87
- expect(dll.getSize()).toEqual(2);
88
- expect(dll.getHead()).toEqual(firstNode);
89
- expect(dll.getTail()).toEqual(secondNode);
90
- expect(firstNode.backward(1)).toEqual(null);
91
- expect(firstNode.forward(1)).toEqual(secondNode);
92
- expect(secondNode.backward(1)).toEqual(firstNode);
93
- expect(secondNode.forward(1)).toEqual(null);
94
- dll.append(thirdNode);
95
- expect(dll.getSize()).toEqual(3);
96
- expect(dll.getHead()).toEqual(firstNode);
97
- expect(dll.getTail()).toEqual(thirdNode);
98
- expect(firstNode.backward(1)).toEqual(null);
99
- expect(firstNode.forward(1)).toEqual(secondNode);
100
- expect(secondNode.backward(1)).toEqual(firstNode);
101
- expect(secondNode.forward(1)).toEqual(thirdNode);
102
- expect(thirdNode.backward(1)).toEqual(secondNode);
103
- expect(thirdNode.forward(1)).toEqual(null);
104
- dll.append(fourthNode);
105
- expect(dll.getSize()).toEqual(4);
106
- expect(dll.getHead()).toEqual(firstNode);
107
- expect(dll.getTail()).toEqual(fourthNode);
108
- expect(firstNode.backward(1)).toEqual(null);
109
- expect(firstNode.forward(1)).toEqual(secondNode);
110
- expect(secondNode.backward(1)).toEqual(firstNode);
111
- expect(secondNode.forward(1)).toEqual(thirdNode);
112
- expect(thirdNode.backward(1)).toEqual(secondNode);
113
- expect(thirdNode.forward(1)).toEqual(fourthNode);
114
- expect(fourthNode.backward(1)).toEqual(thirdNode);
115
- expect(fourthNode.forward(1)).toEqual(null);
116
- });
117
- test("prepend on empty dll", () => {
118
- const dll = new DoublyLinkedList();
119
- const node1 = new Node(token);
120
- expect(dll.getSize()).toEqual(0);
121
- expect(dll.getHead()).toEqual(null);
122
- expect(dll.getTail()).toEqual(null);
123
- dll.prepend(node1);
124
- expect(dll.getSize()).toEqual(1);
125
- expect(dll.getHead()).toEqual(node1);
126
- expect(dll.getTail()).toEqual(node1);
127
- });
128
- test("prepend one node", () => {
129
- const dll = new DoublyLinkedList();
130
- const node1 = new Node(token);
131
- const node2 = new Node(token);
132
- dll.append(node1);
133
- expect(dll.getSize()).toEqual(1);
134
- expect(dll.getHead()).toEqual(node1);
135
- expect(dll.getTail()).toEqual(node1);
136
- dll.prepend(node2);
137
- expect(dll.getSize()).toEqual(2);
138
- expect(dll.getHead()).toEqual(node2);
139
- expect(dll.getTail()).toEqual(node1);
140
- });
141
- test("prepend two node", () => {
142
- const dll = new DoublyLinkedList();
143
- const node1 = new Node(token);
144
- const node2 = new Node(token);
145
- const node3 = new Node(token);
146
- dll.append(node1);
147
- expect(dll.getSize()).toEqual(1);
148
- expect(dll.getHead()).toEqual(node1);
149
- expect(dll.getTail()).toEqual(node1);
150
- dll.prepend(node2);
151
- expect(dll.getSize()).toEqual(2);
152
- expect(dll.getHead()).toEqual(node2);
153
- expect(dll.getTail()).toEqual(node1);
154
- dll.prepend(node3);
155
- expect(dll.getSize()).toEqual(3);
156
- expect(dll.getHead()).toEqual(node3);
157
- expect(dll.getHead()?.next).toEqual(node2);
158
- expect(dll.getHead()?.next?.next).toEqual(node1);
159
- expect(dll.getTail()).toEqual(node1);
160
- });
161
- test("clear", () => {
162
- const dll = new DoublyLinkedList();
163
- const node = new Node(token);
164
- dll.append(node);
165
- expect(dll.getSize()).toEqual(1);
166
- expect(dll.getHead()).toEqual(node);
167
- expect(dll.getTail()).toEqual(node);
168
- dll.clear();
169
- expect(dll.getSize()).toEqual(0);
170
- expect(dll.getHead()).toEqual(null);
171
- expect(dll.getTail()).toEqual(null);
172
- });
173
- test("remove - head", () => {
174
- const dll = new DoublyLinkedList();
175
- const node1 = new Node(token);
176
- const node2 = new Node(token);
177
- const node3 = new Node(token);
178
- dll.append(node1);
179
- dll.append(node2);
180
- dll.append(node3);
181
- expect(dll.getSize()).toEqual(3);
182
- dll.remove(node1);
183
- expect(dll.getSize()).toEqual(2);
184
- expect(dll.getHead()).toEqual(node2);
185
- expect(dll.getHead()?.next).toEqual(node3);
186
- expect(dll.getTail()).toEqual(node3);
187
- });
188
- test("remove - tail", () => {
189
- const dll = new DoublyLinkedList();
190
- const node1 = new Node(token);
191
- const node2 = new Node(token);
192
- const node3 = new Node(token);
193
- dll.append(node1);
194
- dll.append(node2);
195
- dll.append(node3);
196
- expect(dll.getSize()).toEqual(3);
197
- dll.remove(node3);
198
- expect(dll.getSize()).toEqual(2);
199
- expect(dll.getHead()).toEqual(node1);
200
- expect(dll.getHead()?.next).toEqual(node2);
201
- expect(dll.getTail()).toEqual(node2);
202
- });
203
- test("remove - in between", () => {
204
- const dll = new DoublyLinkedList();
205
- const node1 = new Node(token);
206
- const node2 = new Node(token);
207
- const node3 = new Node(token);
208
- dll.append(node1);
209
- dll.append(node2);
210
- dll.append(node3);
211
- expect(dll.getSize()).toEqual(3);
212
- dll.remove(node2);
213
- expect(dll.getSize()).toEqual(2);
214
- expect(dll.getHead()).toEqual(node1);
215
- expect(dll.getHead()?.next).toEqual(node3);
216
- expect(node3.prev).toEqual(node1);
217
- expect(dll.getTail()).toEqual(node3);
218
- });
219
- test("insertAfter - head", () => {
220
- const dll = new DoublyLinkedList();
221
- const node1 = new Node(token);
222
- const node2 = new Node(token);
223
- dll.append(node1);
224
- expect(dll.getSize()).toEqual(1);
225
- dll.insertAfter(node2, node1);
226
- expect(dll.getSize()).toEqual(2);
227
- expect(dll.getHead()).toEqual(node1);
228
- expect(dll.getTail()).toEqual(node2);
229
- });
230
- test("insertAfter - tail", () => {
231
- const dll = new DoublyLinkedList();
232
- const node1 = new Node(token);
233
- const node2 = new Node(token);
234
- const node3 = new Node(token);
235
- dll.append(node1);
236
- dll.append(node2);
237
- expect(dll.getSize()).toEqual(2);
238
- dll.insertAfter(node3, node2);
239
- expect(dll.getSize()).toEqual(3);
240
- expect(dll.getHead()).toEqual(node1);
241
- expect(dll.getHead()?.next).toEqual(node2);
242
- expect(dll.getHead()?.next?.next).toEqual(node3);
243
- expect(dll.getTail()).toEqual(node3);
244
- });
245
- test("insertAfter - node in between", () => {
246
- const dll = new DoublyLinkedList();
247
- const node1 = new Node(token);
248
- const node2 = new Node(token);
249
- const node3 = new Node(token);
250
- dll.append(node1);
251
- dll.append(node2);
252
- expect(dll.getSize()).toEqual(2);
253
- dll.insertAfter(node3, node1);
254
- expect(dll.getSize()).toEqual(3);
255
- expect(dll.getHead()).toEqual(node1);
256
- expect(dll.getHead()?.next).toEqual(node3);
257
- expect(dll.getHead()?.next?.next).toEqual(node2);
258
- expect(dll.getTail()).toEqual(node2);
259
- });
260
- test("insertBefore - head", () => {
261
- const dll = new DoublyLinkedList();
262
- const node1 = new Node(token);
263
- const node2 = new Node(token);
264
- dll.append(node1);
265
- expect(dll.getSize()).toEqual(1);
266
- dll.insertBefore(node2, node1);
267
- expect(dll.getSize()).toEqual(2);
268
- expect(dll.getHead()).toEqual(node2);
269
- expect(dll.getTail()).toEqual(node1);
270
- });
271
- test("insertBefore - tail", () => {
272
- const dll = new DoublyLinkedList();
273
- const node1 = new Node(token);
274
- const node2 = new Node(token);
275
- const node3 = new Node(token);
276
- dll.append(node1);
277
- dll.append(node2);
278
- expect(dll.getSize()).toEqual(2);
279
- dll.insertBefore(node3, node2);
280
- expect(dll.getSize()).toEqual(3);
281
- expect(dll.getHead()).toEqual(node1);
282
- expect(dll.getHead()?.next).toEqual(node3);
283
- expect(dll.getHead()?.next?.next).toEqual(node2);
284
- expect(dll.getTail()).toEqual(node2);
285
- });
286
- test("insertBefore - node in between", () => {
287
- const dll = new DoublyLinkedList();
288
- const node1 = new Node(token);
289
- const node2 = new Node(token);
290
- const node3 = new Node(token);
291
- dll.append(node1);
292
- dll.append(node2);
293
- expect(dll.getSize()).toEqual(2);
294
- dll.insertBefore(node3, node1);
295
- expect(dll.getSize()).toEqual(3);
296
- expect(dll.getHead()).toEqual(node3);
297
- expect(dll.getHead()?.next).toEqual(node1);
298
- expect(dll.getHead()?.next?.next).toEqual(node2);
299
- expect(dll.getTail()).toEqual(node2);
300
- });
301
- test("find", () => {
302
- const dll = new DoublyLinkedList();
303
- const node1 = new Node(token);
304
- const node2 = new Node(token);
305
- const node3 = new Node(token);
306
- dll.append(node1);
307
- dll.append(node2);
308
- dll.append(node3);
309
- expect(dll.getSize()).toEqual(3);
310
- expect(dll.find((node) => node === dll.getHead())).toEqual(node1);
311
- expect(dll.find((node) => node === dll.getTail())).toEqual(node3);
312
- expect(dll.find((node) => node.data.value === "ok")).toEqual(null);
313
- });
314
- test("fromArray", () => {
315
- const data = [token, token, token];
316
- const dll = DoublyLinkedList.fromArray(data);
317
- expect(dll.getSize()).toEqual(3);
318
- expect(dll.getHead()?.backward(1)).toEqual(null);
319
- expect(dll.getHead()?.forward(1)).not.toEqual(null);
320
- expect(dll.getHead()?.forward(2)).not.toEqual(null);
321
- expect(dll.getHead()?.forward(3)).toEqual(null);
322
- expect(dll.getTail()?.forward(1)).toEqual(null);
323
- expect(dll.getTail()?.backward(1)).not.toEqual(null);
324
- expect(dll.getTail()?.backward(2)).not.toEqual(null);
325
- expect(dll.getTail()?.backward(3)).toEqual(null);
326
- });
327
- test("toArray", () => {
328
- const data = [token, token, token];
329
- const dll = DoublyLinkedList.fromArray(data);
330
- expect(dll.getSize()).toEqual(3);
331
- expect(dll.toArray().length).toEqual(3);
332
- expect(dll?.toArray?.()?.[0]?.data).toEqual(data[0]);
333
- expect(dll?.toArray?.()?.[1]?.data).toEqual(data[1]);
334
- expect(dll?.toArray?.()?.[2]?.data).toEqual(data[2]);
335
- });
336
- test("reverse", () => {
337
- const token1 = new Token("test1");
338
- const token2 = new Token("test2");
339
- const token3 = new Token("test3");
340
- const token4 = new Token("test4");
341
- const dll = new DoublyLinkedList();
342
- const node1 = new Node(token1);
343
- const node2 = new Node(token2);
344
- const node3 = new Node(token3);
345
- const node4 = new Node(token4);
346
- dll.append(node1);
347
- dll.append(node2);
348
- dll.append(node3);
349
- dll.append(node4);
350
- expect(dll.getSize()).toEqual(4);
351
- dll.reverse();
352
- expect(dll.getSize()).toEqual(4);
353
- expect(dll.getHead()).toEqual(node4);
354
- expect(dll.getHead()?.next).toEqual(node3);
355
- expect(dll.getHead()?.next?.next).toEqual(node2);
356
- expect(dll.getHead()?.next?.next?.next).toEqual(node1);
357
- expect(dll.getTail()).toEqual(node1);
358
- });
359
- test("Symbol.iterator", () => {
360
- const dll = new DoublyLinkedList();
361
- const firstToken = new Token("first");
362
- const firstNode = new Node(firstToken);
363
- const secondToken = new Token("second");
364
- const secondNode = new Node(secondToken);
365
- const thirdToken = new Token("third");
366
- const thirdNode = new Node(thirdToken);
367
- dll.append(firstNode);
368
- dll.append(secondNode);
369
- dll.append(thirdNode);
370
- let index = 0;
371
- for (const node of dll) {
372
- if (index === 0)
373
- expect(node.data).toEqual(firstToken);
374
- if (index === 1)
375
- expect(node.data).toEqual(secondToken);
376
- if (index === 2)
377
- expect(node.data).toEqual(thirdToken);
378
- index += 1;
379
- }
380
- });
381
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,18 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import * as v from "valibot";
3
- import { DurationMs } from "../src/duration-ms.vo";
4
- describe("DurationMs", () => {
5
- test("happy path", () => {
6
- expect(v.safeParse(DurationMs, 0).success).toEqual(true);
7
- expect(v.safeParse(DurationMs, 10_000).success).toEqual(true);
8
- });
9
- test("rejects non-number - null", () => {
10
- expect(() => v.parse(DurationMs, null)).toThrow("duration.invalid");
11
- });
12
- test("rejects non-number - string", () => {
13
- expect(() => v.parse(DurationMs, "123")).toThrow("duration.invalid");
14
- });
15
- test("rejects fractions", () => {
16
- expect(() => v.parse(DurationMs, 1.5)).toThrow("duration.invalid");
17
- });
18
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,126 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import * as v from "valibot";
3
- import { Duration } from "../src/duration.service";
4
- import { DurationMs } from "../src/duration-ms.vo";
5
- import { MultiplicationFactor } from "../src/multiplication-factor.vo";
6
- describe("Duration", () => {
7
- test("weeks", () => {
8
- const weeks = Duration.Weeks(2);
9
- expect(weeks.days).toEqual(14);
10
- expect(weeks.hours).toEqual(336);
11
- expect(weeks.minutes).toEqual(20160);
12
- expect(weeks.seconds).toEqual(1209600);
13
- expect(weeks.ms).toEqual(v.parse(DurationMs, 1_209_600_000));
14
- expect(weeks.ns).toEqual(1_209_600_000_000_000);
15
- });
16
- test("days", () => {
17
- const days = Duration.Days(2);
18
- expect(days.weeks).toEqual(0.29);
19
- expect(days.days).toEqual(2);
20
- expect(days.hours).toEqual(48);
21
- expect(days.minutes).toEqual(2880);
22
- expect(days.seconds).toEqual(172800);
23
- expect(days.ms).toEqual(v.parse(DurationMs, 172_800_000));
24
- expect(days.ns).toEqual(172_800_000_000_000);
25
- });
26
- test("hours", () => {
27
- const hours = Duration.Hours(3);
28
- expect(hours.weeks).toEqual(0.02);
29
- expect(hours.days).toEqual(0.13);
30
- expect(hours.hours).toEqual(3);
31
- expect(hours.minutes).toEqual(180);
32
- expect(hours.seconds).toEqual(10_800);
33
- expect(hours.ms).toEqual(v.parse(DurationMs, 10_800_000));
34
- expect(hours.ns).toEqual(10_800_000_000_000);
35
- });
36
- test("minutes", () => {
37
- const minutes = Duration.Minutes(30);
38
- expect(minutes.weeks).toEqual(0);
39
- expect(minutes.days).toEqual(0.02);
40
- expect(minutes.hours).toEqual(0.5);
41
- expect(minutes.minutes).toEqual(30);
42
- expect(minutes.seconds).toEqual(1_800);
43
- expect(minutes.ms).toEqual(v.parse(DurationMs, 1_800_000));
44
- expect(minutes.ns).toEqual(1_800_000_000_000);
45
- });
46
- test("seconds", () => {
47
- const seconds = Duration.Seconds(120);
48
- expect(seconds.weeks).toEqual(0);
49
- expect(seconds.days).toEqual(0);
50
- expect(seconds.hours).toEqual(0.03);
51
- expect(seconds.minutes).toEqual(2);
52
- expect(seconds.seconds).toEqual(120);
53
- expect(seconds.ms).toEqual(v.parse(DurationMs, 120_000));
54
- expect(seconds.ns).toEqual(120_000_000_000);
55
- });
56
- test("ms", () => {
57
- const ms = Duration.Ms(500);
58
- expect(ms.weeks).toEqual(0);
59
- expect(ms.days).toEqual(0);
60
- expect(ms.hours).toEqual(0);
61
- expect(ms.minutes).toEqual(0.01);
62
- expect(ms.seconds).toEqual(0.5);
63
- expect(ms.ms).toEqual(v.parse(DurationMs, 500));
64
- expect(ms.ns).toEqual(500_000_000);
65
- });
66
- test("ns", () => {
67
- const ns = Duration.Ns(5_499_999);
68
- expect(ns.weeks).toEqual(0);
69
- expect(ns.days).toEqual(0);
70
- expect(ns.hours).toEqual(0);
71
- expect(ns.minutes).toEqual(0);
72
- expect(ns.seconds).toEqual(0.01);
73
- expect(ns.ms).toEqual(v.parse(DurationMs, 5));
74
- expect(ns.ns).toEqual(5_000_000);
75
- });
76
- test("add/subtract", () => {
77
- const base = Duration.Seconds(10);
78
- const added = base.add(Duration.Seconds(5));
79
- const subtracted = base.subtract(Duration.Seconds(3));
80
- expect(added.seconds).toEqual(15);
81
- expect(subtracted.seconds).toEqual(7);
82
- });
83
- test("times", () => {
84
- const base = Duration.Ms(10);
85
- const factor = v.parse(MultiplicationFactor, 1.5);
86
- const result = base.times(factor);
87
- expect(result.ms).toEqual(v.parse(DurationMs, 15));
88
- });
89
- test("times - rounding", () => {
90
- const base = Duration.Ms(7);
91
- const factor = v.parse(MultiplicationFactor, 1.29);
92
- const result = base.times(factor);
93
- expect(result.ms).toEqual(v.parse(DurationMs, 9));
94
- });
95
- test("equals", () => {
96
- const a = Duration.Ms(1_000);
97
- const b = Duration.Ms(2_000);
98
- expect(a.equals(a)).toEqual(true);
99
- expect(a.equals(b)).toEqual(false);
100
- });
101
- test("isLongerThan", () => {
102
- const a = Duration.Ms(2_000);
103
- const b = Duration.Ms(1_000);
104
- expect(a.isLongerThan(b)).toEqual(true);
105
- expect(a.isLongerThan(a)).toEqual(false);
106
- });
107
- test("isShorterThan", () => {
108
- const a = Duration.Ms(1_000);
109
- const b = Duration.Ms(2_000);
110
- expect(a.isShorterThan(b)).toEqual(true);
111
- expect(a.isShorterThan(a)).toEqual(false);
112
- });
113
- test("toAbsolute", () => {
114
- expect(Duration.Ms(1000).toAbsolute()).toEqual(Duration.Ms(1000));
115
- expect(Duration.Ms(-1000).toAbsolute()).toEqual(Duration.Ms(1000));
116
- });
117
- test("MIN", () => {
118
- expect(Duration.MIN.ms).toEqual(v.parse(DurationMs, 1));
119
- });
120
- test("toString", () => {
121
- expect(Duration.MIN.toString()).toEqual("1");
122
- });
123
- test("toJSON", () => {
124
- expect(Duration.MIN.toJSON()).toEqual(1);
125
- });
126
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,15 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import * as v from "valibot";
3
- import { Email } from "../src/email.vo";
4
- import { EmailMask } from "../src/email-mask.service";
5
- describe("EmailMask", () => {
6
- test("works for 1 char", () => {
7
- expect(EmailMask.censor(v.parse(Email, "t@example.com"))).toEqual("*@example.com");
8
- });
9
- test("works for 2 chars", () => {
10
- expect(EmailMask.censor(v.parse(Email, "te@example.com"))).toEqual("**@example.com");
11
- });
12
- test("works for more than 2 chars", () => {
13
- expect(EmailMask.censor(v.parse(Email, "testing@example.com"))).toEqual("t*****g@example.com");
14
- });
15
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,17 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import * as v from "valibot";
3
- import { Email } from "../src/email.vo";
4
- describe("Email", () => {
5
- test("happy path", () => {
6
- expect(v.safeParse(Email, "user@example.com").success).toEqual(true);
7
- });
8
- test("rejects empty", () => {
9
- expect(() => v.parse(Email, "")).toThrow("email.invalid");
10
- });
11
- test("rejects non-string - null", () => {
12
- expect(() => v.parse(Email, null)).toThrow("email.invalid");
13
- });
14
- test("rejects non-string - number", () => {
15
- expect(() => v.parse(Email, 123)).toThrow("email.invalid");
16
- });
17
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,54 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import * as v from "valibot";
3
- import { ETag, WeakETag } from "../src/etags.vo";
4
- import { RevisionValue } from "../src/revision-value.vo";
5
- describe("ETag", () => {
6
- test("happy path", () => {
7
- const value = "123";
8
- const etag = ETag.fromHeader(value);
9
- //@ts-expect-error
10
- expect(etag.value).toEqual(value);
11
- //@ts-expect-error
12
- expect(etag.revision).toEqual(123);
13
- });
14
- test("returns null for W/ prefix", () => {
15
- const weakETagValue = "W/123";
16
- const etag = ETag.fromHeader(weakETagValue);
17
- expect(etag).toEqual(null);
18
- });
19
- test("returns null for nan", () => {
20
- const weakETagValue = "abc";
21
- const etag = ETag.fromHeader(weakETagValue);
22
- expect(etag).toEqual(null);
23
- });
24
- test("returns null for empty", () => {
25
- expect(ETag.fromHeader()).toEqual(null);
26
- });
27
- test("static", () => {
28
- expect(ETag.HEADER_NAME).toEqual("ETag");
29
- expect(ETag.IF_MATCH_HEADER_NAME).toEqual("if-match");
30
- });
31
- });
32
- describe("WeakETag", () => {
33
- test("happy path", () => {
34
- const value = "W/123";
35
- const weakEtag = WeakETag.fromHeader(value);
36
- expect(weakEtag?.value).toEqual(value);
37
- expect(weakEtag?.revision).toEqual(v.parse(RevisionValue, 123));
38
- });
39
- test("returns null for nan", () => {
40
- const invalidValue = "W/abc";
41
- expect(WeakETag.fromHeader(invalidValue)).toEqual(null);
42
- });
43
- test("throws for invalid", () => {
44
- const invalidValue = "invalid";
45
- expect(() => WeakETag.fromHeader(invalidValue)).toThrow("weak.etag.invalid");
46
- });
47
- test("throws for empty", () => {
48
- expect(() => WeakETag.fromHeader()).toThrow("weak.etag.invalid");
49
- });
50
- test("static", () => {
51
- expect(WeakETag.HEADER_NAME).toEqual("ETag");
52
- expect(WeakETag.IF_MATCH_HEADER_NAME).toEqual("if-match");
53
- });
54
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,51 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import * as v from "valibot";
3
- import { Extension } from "../src/extension.vo";
4
- describe("Extension", () => {
5
- test("happy path", () => {
6
- expect(v.safeParse(Extension, "webp").success).toEqual(true);
7
- expect(v.safeParse(Extension, "jpg").success).toEqual(true);
8
- expect(v.safeParse(Extension, "7z").success).toEqual(true);
9
- expect(v.safeParse(Extension, ".PNG").success).toEqual(true);
10
- expect(v.safeParse(Extension, "a".repeat(16)).success).toEqual(true);
11
- });
12
- test("rejects non-string - number", () => {
13
- expect(() => v.parse(Extension, 123)).toThrow("extension.type");
14
- });
15
- test("rejects non-string - null", () => {
16
- expect(() => v.parse(Extension, null)).toThrow("extension.type");
17
- });
18
- test("rejects empty string", () => {
19
- expect(() => v.parse(Extension, "")).toThrow("extension.empty");
20
- });
21
- test("rejects single char", () => {
22
- expect(() => v.parse(Extension, "a")).toThrow("extension.empty");
23
- });
24
- test("rejects single dot", () => {
25
- expect(() => v.parse(Extension, ".")).toThrow("extension.empty");
26
- });
27
- test("rejects too long", () => {
28
- expect(() => v.parse(Extension, "a".repeat(17))).toThrow("extension.too.long");
29
- });
30
- test("rejects hyphen", () => {
31
- expect(() => v.parse(Extension, "web-p")).toThrow("extension.bad.chars");
32
- });
33
- test("rejects space", () => {
34
- expect(() => v.parse(Extension, "web p")).toThrow("extension.bad.chars");
35
- });
36
- test("rejects punctuation", () => {
37
- expect(() => v.parse(Extension, "webp!")).toThrow("extension.bad.chars");
38
- });
39
- test("rejects double dot", () => {
40
- expect(() => v.parse(Extension, "..png")).toThrow("extension.bad.chars");
41
- });
42
- test("rejects prefix", () => {
43
- expect(() => v.parse(Extension, "!webp")).toThrow("extension.bad.chars");
44
- });
45
- test("rejects suffix", () => {
46
- expect(() => v.parse(Extension, "webp ")).toThrow("extension.bad.chars");
47
- });
48
- test("rejects internal dot", () => {
49
- expect(() => v.parse(Extension, "a.png")).toThrow("extension.bad.chars");
50
- });
51
- });