@bgord/tools 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (422) hide show
  1. package/dist/tsconfig.tsbuildinfo +1 -1
  2. package/package.json +1 -1
  3. package/dist/tests/age-years.vo.test.d.ts +0 -1
  4. package/dist/tests/age-years.vo.test.js +0 -24
  5. package/dist/tests/age.vo.test.d.ts +0 -1
  6. package/dist/tests/age.vo.test.js +0 -106
  7. package/dist/tests/api-key.vo.test.d.ts +0 -1
  8. package/dist/tests/api-key.vo.test.js +0 -24
  9. package/dist/tests/basename.vo.test.d.ts +0 -1
  10. package/dist/tests/basename.vo.test.js +0 -53
  11. package/dist/tests/batch.test.d.ts +0 -1
  12. package/dist/tests/batch.test.js +0 -24
  13. package/dist/tests/date-calculator.service.test.d.ts +0 -1
  14. package/dist/tests/date-calculator.service.test.js +0 -32
  15. package/dist/tests/date-formatter.service.test.d.ts +0 -1
  16. package/dist/tests/date-formatter.service.test.js +0 -22
  17. package/dist/tests/date-range.vo.test.d.ts +0 -1
  18. package/dist/tests/date-range.vo.test.js +0 -49
  19. package/dist/tests/day-iso-id.vo.test.d.ts +0 -1
  20. package/dist/tests/day-iso-id.vo.test.js +0 -36
  21. package/dist/tests/day.vo.test.d.ts +0 -1
  22. package/dist/tests/day.vo.test.js +0 -68
  23. package/dist/tests/directory-path-absolute.vo.test.d.ts +0 -1
  24. package/dist/tests/directory-path-absolute.vo.test.js +0 -47
  25. package/dist/tests/directory-path-relative.vo.test.d.ts +0 -1
  26. package/dist/tests/directory-path-relative.vo.test.js +0 -44
  27. package/dist/tests/distance-value.vo.test.d.ts +0 -1
  28. package/dist/tests/distance-value.vo.test.js +0 -21
  29. package/dist/tests/distance.vo.test.d.ts +0 -1
  30. package/dist/tests/distance.vo.test.js +0 -74
  31. package/dist/tests/division-factor.vo.test.d.ts +0 -1
  32. package/dist/tests/division-factor.vo.test.js +0 -21
  33. package/dist/tests/dll.service.test.d.ts +0 -1
  34. package/dist/tests/dll.service.test.js +0 -381
  35. package/dist/tests/duration-ms.vo.test.d.ts +0 -1
  36. package/dist/tests/duration-ms.vo.test.js +0 -18
  37. package/dist/tests/duration.service.test.d.ts +0 -1
  38. package/dist/tests/duration.service.test.js +0 -126
  39. package/dist/tests/email-mask.service.test.d.ts +0 -1
  40. package/dist/tests/email-mask.service.test.js +0 -15
  41. package/dist/tests/email.vo.test.d.ts +0 -1
  42. package/dist/tests/email.vo.test.js +0 -17
  43. package/dist/tests/etags.vo.test.d.ts +0 -1
  44. package/dist/tests/etags.vo.test.js +0 -54
  45. package/dist/tests/extension.vo.test.d.ts +0 -1
  46. package/dist/tests/extension.vo.test.js +0 -51
  47. package/dist/tests/feature-flag-value.vo.test.d.ts +0 -1
  48. package/dist/tests/feature-flag-value.vo.test.js +0 -12
  49. package/dist/tests/feature-flag.vo.test.d.ts +0 -1
  50. package/dist/tests/feature-flag.vo.test.js +0 -13
  51. package/dist/tests/file-path-absolute-schema.vo.test.d.ts +0 -1
  52. package/dist/tests/file-path-absolute-schema.vo.test.js +0 -53
  53. package/dist/tests/file-path-relative-schema.vo.test.d.ts +0 -1
  54. package/dist/tests/file-path-relative-schema.vo.test.js +0 -52
  55. package/dist/tests/file-path.vo.test.d.ts +0 -1
  56. package/dist/tests/file-path.vo.test.js +0 -74
  57. package/dist/tests/filename-affix.vo.test.d.ts +0 -1
  58. package/dist/tests/filename-affix.vo.test.js +0 -30
  59. package/dist/tests/filename-from-string.vo.test.d.ts +0 -1
  60. package/dist/tests/filename-from-string.vo.test.js +0 -37
  61. package/dist/tests/filename.vo.test.d.ts +0 -1
  62. package/dist/tests/filename.vo.test.js +0 -93
  63. package/dist/tests/height-milimiters.vo.test.d.ts +0 -1
  64. package/dist/tests/height-milimiters.vo.test.js +0 -21
  65. package/dist/tests/height.vo.test.d.ts +0 -1
  66. package/dist/tests/height.vo.test.js +0 -64
  67. package/dist/tests/hour-value.vo.test.d.ts +0 -1
  68. package/dist/tests/hour-value.vo.test.js +0 -24
  69. package/dist/tests/hour.vo.test.d.ts +0 -1
  70. package/dist/tests/hour.vo.test.js +0 -64
  71. package/dist/tests/iban-mask.service.test.d.ts +0 -1
  72. package/dist/tests/iban-mask.service.test.js +0 -13
  73. package/dist/tests/iban-schema.vo.test.d.ts +0 -1
  74. package/dist/tests/iban-schema.vo.test.js +0 -43
  75. package/dist/tests/iban.vo.test.d.ts +0 -1
  76. package/dist/tests/iban.vo.test.js +0 -46
  77. package/dist/tests/image.vo.test.d.ts +0 -1
  78. package/dist/tests/image.vo.test.js +0 -41
  79. package/dist/tests/integer-non-negative.vo.test.d.ts +0 -1
  80. package/dist/tests/integer-non-negative.vo.test.js +0 -22
  81. package/dist/tests/integer-positive.vo.test.d.ts +0 -1
  82. package/dist/tests/integer-positive.vo.test.js +0 -21
  83. package/dist/tests/integer.vo.test.d.ts +0 -1
  84. package/dist/tests/integer.vo.test.js +0 -21
  85. package/dist/tests/language.vo.test.d.ts +0 -1
  86. package/dist/tests/language.vo.test.js +0 -28
  87. package/dist/tests/linear-regression.service.test.d.ts +0 -1
  88. package/dist/tests/linear-regression.service.test.js +0 -111
  89. package/dist/tests/mean.service.test.d.ts +0 -1
  90. package/dist/tests/mean.service.test.js +0 -23
  91. package/dist/tests/mime-registry-entry.vo.test.d.ts +0 -1
  92. package/dist/tests/mime-registry-entry.vo.test.js +0 -15
  93. package/dist/tests/mime-registry.service.test.d.ts +0 -1
  94. package/dist/tests/mime-registry.service.test.js +0 -45
  95. package/dist/tests/mime-value.vo.test.d.ts +0 -1
  96. package/dist/tests/mime-value.vo.test.js +0 -49
  97. package/dist/tests/mime.vo.test.d.ts +0 -1
  98. package/dist/tests/mime.vo.test.js +0 -53
  99. package/dist/tests/mimes.test.d.ts +0 -1
  100. package/dist/tests/mimes.test.js +0 -28
  101. package/dist/tests/min-max-scaler.service.test.d.ts +0 -1
  102. package/dist/tests/min-max-scaler.service.test.js +0 -116
  103. package/dist/tests/minute-value.vo.test.d.ts +0 -1
  104. package/dist/tests/minute-value.vo.test.js +0 -24
  105. package/dist/tests/minute.vo.test.d.ts +0 -1
  106. package/dist/tests/minute.vo.test.js +0 -64
  107. package/dist/tests/mocks.d.ts +0 -6
  108. package/dist/tests/mocks.js +0 -7
  109. package/dist/tests/money-amount.vo.test.d.ts +0 -1
  110. package/dist/tests/money-amount.vo.test.js +0 -21
  111. package/dist/tests/money.vo.test.d.ts +0 -1
  112. package/dist/tests/money.vo.test.js +0 -90
  113. package/dist/tests/month-iso-id.vo.test.d.ts +0 -1
  114. package/dist/tests/month-iso-id.vo.test.js +0 -36
  115. package/dist/tests/month.vo.test.d.ts +0 -1
  116. package/dist/tests/month.vo.test.js +0 -65
  117. package/dist/tests/multiplication-factor.vo.test.d.ts +0 -1
  118. package/dist/tests/multiplication-factor.vo.test.js +0 -19
  119. package/dist/tests/noop.test.d.ts +0 -1
  120. package/dist/tests/noop.test.js +0 -12
  121. package/dist/tests/object-key.vo.test.d.ts +0 -1
  122. package/dist/tests/object-key.vo.test.js +0 -56
  123. package/dist/tests/outlier-detector.service.test.d.ts +0 -1
  124. package/dist/tests/outlier-detector.service.test.js +0 -35
  125. package/dist/tests/package-version-schema.vo.test.d.ts +0 -1
  126. package/dist/tests/package-version-schema.vo.test.js +0 -32
  127. package/dist/tests/package-version.vo.test.d.ts +0 -1
  128. package/dist/tests/package-version.vo.test.js +0 -138
  129. package/dist/tests/pagination-page.vo.test.d.ts +0 -1
  130. package/dist/tests/pagination-page.vo.test.js +0 -26
  131. package/dist/tests/pagination-skip.vo.test.d.ts +0 -1
  132. package/dist/tests/pagination-skip.vo.test.js +0 -23
  133. package/dist/tests/pagination-take.vo.test.d.ts +0 -1
  134. package/dist/tests/pagination-take.vo.test.js +0 -25
  135. package/dist/tests/pagination.service.test.d.ts +0 -1
  136. package/dist/tests/pagination.service.test.js +0 -92
  137. package/dist/tests/percentage.service.test.d.ts +0 -1
  138. package/dist/tests/percentage.service.test.js +0 -16
  139. package/dist/tests/population-standard-deviation.service.test.d.ts +0 -1
  140. package/dist/tests/population-standard-deviation.service.test.js +0 -20
  141. package/dist/tests/quarter-iso-id.vo.test.d.ts +0 -1
  142. package/dist/tests/quarter-iso-id.vo.test.js +0 -30
  143. package/dist/tests/quarter.vo.test.d.ts +0 -1
  144. package/dist/tests/quarter.vo.test.js +0 -54
  145. package/dist/tests/random.service.test.d.ts +0 -1
  146. package/dist/tests/random.service.test.js +0 -93
  147. package/dist/tests/rate-limiter.service.test.d.ts +0 -1
  148. package/dist/tests/rate-limiter.service.test.js +0 -39
  149. package/dist/tests/relative-date.vo.test.d.ts +0 -1
  150. package/dist/tests/relative-date.vo.test.js +0 -22
  151. package/dist/tests/reordering-item-position-value.vo.test.d.ts +0 -1
  152. package/dist/tests/reordering-item-position-value.vo.test.js +0 -21
  153. package/dist/tests/reordering.service.test.d.ts +0 -1
  154. package/dist/tests/reordering.service.test.js +0 -76
  155. package/dist/tests/repeat.test.d.ts +0 -1
  156. package/dist/tests/repeat.test.js +0 -8
  157. package/dist/tests/revision-value.vo.test.d.ts +0 -1
  158. package/dist/tests/revision-value.vo.test.js +0 -21
  159. package/dist/tests/revision.vo.test.d.ts +0 -1
  160. package/dist/tests/revision.vo.test.js +0 -52
  161. package/dist/tests/rounding-decimal.strategy.test.d.ts +0 -1
  162. package/dist/tests/rounding-decimal.strategy.test.js +0 -17
  163. package/dist/tests/rounding-down.strategy.test.d.ts +0 -1
  164. package/dist/tests/rounding-down.strategy.test.js +0 -9
  165. package/dist/tests/rounding-to-nearest.strategy.test.d.ts +0 -1
  166. package/dist/tests/rounding-to-nearest.strategy.test.js +0 -9
  167. package/dist/tests/rounding-up.strategy.test.d.ts +0 -1
  168. package/dist/tests/rounding-up.strategy.test.js +0 -9
  169. package/dist/tests/size-bytes.vo.test.d.ts +0 -1
  170. package/dist/tests/size-bytes.vo.test.js +0 -21
  171. package/dist/tests/size.vo.test.d.ts +0 -1
  172. package/dist/tests/size.vo.test.js +0 -93
  173. package/dist/tests/slug.service.test.d.ts +0 -1
  174. package/dist/tests/slug.service.test.js +0 -45
  175. package/dist/tests/sum.service.test.d.ts +0 -1
  176. package/dist/tests/sum.service.test.js +0 -22
  177. package/dist/tests/thousands-separator.service.test.d.ts +0 -1
  178. package/dist/tests/thousands-separator.service.test.js +0 -27
  179. package/dist/tests/time-zone-offset-value.test.d.ts +0 -1
  180. package/dist/tests/time-zone-offset-value.test.js +0 -27
  181. package/dist/tests/timestamp-value.vo.test.d.ts +0 -1
  182. package/dist/tests/timestamp-value.vo.test.js +0 -21
  183. package/dist/tests/timestamp.vo.test.d.ts +0 -1
  184. package/dist/tests/timestamp.vo.test.js +0 -73
  185. package/dist/tests/timezone.vo.test.d.ts +0 -1
  186. package/dist/tests/timezone.vo.test.js +0 -29
  187. package/dist/tests/url-with-slash.vo.test.d.ts +0 -1
  188. package/dist/tests/url-with-slash.vo.test.js +0 -24
  189. package/dist/tests/url-without-slash.vo.test.d.ts +0 -1
  190. package/dist/tests/url-without-slash.vo.test.js +0 -25
  191. package/dist/tests/visually-unambiguous-characters-generator.service.test.d.ts +0 -1
  192. package/dist/tests/visually-unambiguous-characters-generator.service.test.js +0 -89
  193. package/dist/tests/week-iso-id.vo.test.d.ts +0 -1
  194. package/dist/tests/week-iso-id.vo.test.js +0 -37
  195. package/dist/tests/week.vo.test.d.ts +0 -1
  196. package/dist/tests/week.vo.test.js +0 -64
  197. package/dist/tests/weekday-iso-id.vo.test.d.ts +0 -1
  198. package/dist/tests/weekday-iso-id.vo.test.js +0 -24
  199. package/dist/tests/weekday.vo.test.d.ts +0 -1
  200. package/dist/tests/weekday.vo.test.js +0 -51
  201. package/dist/tests/weight-grams.vo.test.d.ts +0 -1
  202. package/dist/tests/weight-grams.vo.test.js +0 -21
  203. package/dist/tests/weight.vo.test.d.ts +0 -1
  204. package/dist/tests/weight.vo.test.js +0 -66
  205. package/dist/tests/year-iso-id.vo.test.d.ts +0 -1
  206. package/dist/tests/year-iso-id.vo.test.js +0 -23
  207. package/dist/tests/year.vo.test.d.ts +0 -1
  208. package/dist/tests/year.vo.test.js +0 -79
  209. package/dist/tests/z-score.service.test.d.ts +0 -1
  210. package/dist/tests/z-score.service.test.js +0 -26
  211. /package/dist/{src/age-years.vo.d.ts → age-years.vo.d.ts} +0 -0
  212. /package/dist/{src/age-years.vo.js → age-years.vo.js} +0 -0
  213. /package/dist/{src/age.vo.d.ts → age.vo.d.ts} +0 -0
  214. /package/dist/{src/age.vo.js → age.vo.js} +0 -0
  215. /package/dist/{src/api-key.vo.d.ts → api-key.vo.d.ts} +0 -0
  216. /package/dist/{src/api-key.vo.js → api-key.vo.js} +0 -0
  217. /package/dist/{src/basename.vo.d.ts → basename.vo.d.ts} +0 -0
  218. /package/dist/{src/basename.vo.js → basename.vo.js} +0 -0
  219. /package/dist/{src/batch.d.ts → batch.d.ts} +0 -0
  220. /package/dist/{src/batch.js → batch.js} +0 -0
  221. /package/dist/{src/date-calculator.service.d.ts → date-calculator.service.d.ts} +0 -0
  222. /package/dist/{src/date-calculator.service.js → date-calculator.service.js} +0 -0
  223. /package/dist/{src/date-formatter.service.d.ts → date-formatter.service.d.ts} +0 -0
  224. /package/dist/{src/date-formatter.service.js → date-formatter.service.js} +0 -0
  225. /package/dist/{src/date-range.vo.d.ts → date-range.vo.d.ts} +0 -0
  226. /package/dist/{src/date-range.vo.js → date-range.vo.js} +0 -0
  227. /package/dist/{src/day-iso-id.vo.d.ts → day-iso-id.vo.d.ts} +0 -0
  228. /package/dist/{src/day-iso-id.vo.js → day-iso-id.vo.js} +0 -0
  229. /package/dist/{src/day.vo.d.ts → day.vo.d.ts} +0 -0
  230. /package/dist/{src/day.vo.js → day.vo.js} +0 -0
  231. /package/dist/{src/directory-path-absolute.vo.d.ts → directory-path-absolute.vo.d.ts} +0 -0
  232. /package/dist/{src/directory-path-absolute.vo.js → directory-path-absolute.vo.js} +0 -0
  233. /package/dist/{src/directory-path-relative.vo.d.ts → directory-path-relative.vo.d.ts} +0 -0
  234. /package/dist/{src/directory-path-relative.vo.js → directory-path-relative.vo.js} +0 -0
  235. /package/dist/{src/distance-value.vo.d.ts → distance-value.vo.d.ts} +0 -0
  236. /package/dist/{src/distance-value.vo.js → distance-value.vo.js} +0 -0
  237. /package/dist/{src/distance.vo.d.ts → distance.vo.d.ts} +0 -0
  238. /package/dist/{src/distance.vo.js → distance.vo.js} +0 -0
  239. /package/dist/{src/division-factor.vo.d.ts → division-factor.vo.d.ts} +0 -0
  240. /package/dist/{src/division-factor.vo.js → division-factor.vo.js} +0 -0
  241. /package/dist/{src/dll.service.d.ts → dll.service.d.ts} +0 -0
  242. /package/dist/{src/dll.service.js → dll.service.js} +0 -0
  243. /package/dist/{src/duration-ms.vo.d.ts → duration-ms.vo.d.ts} +0 -0
  244. /package/dist/{src/duration-ms.vo.js → duration-ms.vo.js} +0 -0
  245. /package/dist/{src/duration.service.d.ts → duration.service.d.ts} +0 -0
  246. /package/dist/{src/duration.service.js → duration.service.js} +0 -0
  247. /package/dist/{src/email-mask.service.d.ts → email-mask.service.d.ts} +0 -0
  248. /package/dist/{src/email-mask.service.js → email-mask.service.js} +0 -0
  249. /package/dist/{src/email.vo.d.ts → email.vo.d.ts} +0 -0
  250. /package/dist/{src/email.vo.js → email.vo.js} +0 -0
  251. /package/dist/{src/etags.vo.d.ts → etags.vo.d.ts} +0 -0
  252. /package/dist/{src/etags.vo.js → etags.vo.js} +0 -0
  253. /package/dist/{src/extension.vo.d.ts → extension.vo.d.ts} +0 -0
  254. /package/dist/{src/extension.vo.js → extension.vo.js} +0 -0
  255. /package/dist/{src/feature-flag-value.vo.d.ts → feature-flag-value.vo.d.ts} +0 -0
  256. /package/dist/{src/feature-flag-value.vo.js → feature-flag-value.vo.js} +0 -0
  257. /package/dist/{src/feature-flag.vo.d.ts → feature-flag.vo.d.ts} +0 -0
  258. /package/dist/{src/feature-flag.vo.js → feature-flag.vo.js} +0 -0
  259. /package/dist/{src/file-path-absolute-schema.vo.d.ts → file-path-absolute-schema.vo.d.ts} +0 -0
  260. /package/dist/{src/file-path-absolute-schema.vo.js → file-path-absolute-schema.vo.js} +0 -0
  261. /package/dist/{src/file-path-relative-schema.vo.d.ts → file-path-relative-schema.vo.d.ts} +0 -0
  262. /package/dist/{src/file-path-relative-schema.vo.js → file-path-relative-schema.vo.js} +0 -0
  263. /package/dist/{src/file-path.vo.d.ts → file-path.vo.d.ts} +0 -0
  264. /package/dist/{src/file-path.vo.js → file-path.vo.js} +0 -0
  265. /package/dist/{src/filename-affix.vo.d.ts → filename-affix.vo.d.ts} +0 -0
  266. /package/dist/{src/filename-affix.vo.js → filename-affix.vo.js} +0 -0
  267. /package/dist/{src/filename-from-string.vo.d.ts → filename-from-string.vo.d.ts} +0 -0
  268. /package/dist/{src/filename-from-string.vo.js → filename-from-string.vo.js} +0 -0
  269. /package/dist/{src/filename.vo.d.ts → filename.vo.d.ts} +0 -0
  270. /package/dist/{src/filename.vo.js → filename.vo.js} +0 -0
  271. /package/dist/{src/height-milimiters.vo.d.ts → height-milimiters.vo.d.ts} +0 -0
  272. /package/dist/{src/height-milimiters.vo.js → height-milimiters.vo.js} +0 -0
  273. /package/dist/{src/height.vo.d.ts → height.vo.d.ts} +0 -0
  274. /package/dist/{src/height.vo.js → height.vo.js} +0 -0
  275. /package/dist/{src/hour-value.vo.d.ts → hour-value.vo.d.ts} +0 -0
  276. /package/dist/{src/hour-value.vo.js → hour-value.vo.js} +0 -0
  277. /package/dist/{src/hour.vo.d.ts → hour.vo.d.ts} +0 -0
  278. /package/dist/{src/hour.vo.js → hour.vo.js} +0 -0
  279. /package/dist/{src/iban-mask.service.d.ts → iban-mask.service.d.ts} +0 -0
  280. /package/dist/{src/iban-mask.service.js → iban-mask.service.js} +0 -0
  281. /package/dist/{src/iban-schema.vo.d.ts → iban-schema.vo.d.ts} +0 -0
  282. /package/dist/{src/iban-schema.vo.js → iban-schema.vo.js} +0 -0
  283. /package/dist/{src/iban.vo.d.ts → iban.vo.d.ts} +0 -0
  284. /package/dist/{src/iban.vo.js → iban.vo.js} +0 -0
  285. /package/dist/{src/image.vo.d.ts → image.vo.d.ts} +0 -0
  286. /package/dist/{src/image.vo.js → image.vo.js} +0 -0
  287. /package/dist/{src/index.d.ts → index.d.ts} +0 -0
  288. /package/dist/{src/index.js → index.js} +0 -0
  289. /package/dist/{src/integer-non-negative.vo.d.ts → integer-non-negative.vo.d.ts} +0 -0
  290. /package/dist/{src/integer-non-negative.vo.js → integer-non-negative.vo.js} +0 -0
  291. /package/dist/{src/integer-positive.vo.d.ts → integer-positive.vo.d.ts} +0 -0
  292. /package/dist/{src/integer-positive.vo.js → integer-positive.vo.js} +0 -0
  293. /package/dist/{src/integer.vo.d.ts → integer.vo.d.ts} +0 -0
  294. /package/dist/{src/integer.vo.js → integer.vo.js} +0 -0
  295. /package/dist/{src/language.vo.d.ts → language.vo.d.ts} +0 -0
  296. /package/dist/{src/language.vo.js → language.vo.js} +0 -0
  297. /package/dist/{src/linear-regression.service.d.ts → linear-regression.service.d.ts} +0 -0
  298. /package/dist/{src/linear-regression.service.js → linear-regression.service.js} +0 -0
  299. /package/dist/{src/mean.service.d.ts → mean.service.d.ts} +0 -0
  300. /package/dist/{src/mean.service.js → mean.service.js} +0 -0
  301. /package/dist/{src/mime-registry-entry.vo.d.ts → mime-registry-entry.vo.d.ts} +0 -0
  302. /package/dist/{src/mime-registry-entry.vo.js → mime-registry-entry.vo.js} +0 -0
  303. /package/dist/{src/mime-registry.service.d.ts → mime-registry.service.d.ts} +0 -0
  304. /package/dist/{src/mime-registry.service.js → mime-registry.service.js} +0 -0
  305. /package/dist/{src/mime-value.vo.d.ts → mime-value.vo.d.ts} +0 -0
  306. /package/dist/{src/mime-value.vo.js → mime-value.vo.js} +0 -0
  307. /package/dist/{src/mime.vo.d.ts → mime.vo.d.ts} +0 -0
  308. /package/dist/{src/mime.vo.js → mime.vo.js} +0 -0
  309. /package/dist/{src/mimes.d.ts → mimes.d.ts} +0 -0
  310. /package/dist/{src/mimes.js → mimes.js} +0 -0
  311. /package/dist/{src/min-max-scaler.service.d.ts → min-max-scaler.service.d.ts} +0 -0
  312. /package/dist/{src/min-max-scaler.service.js → min-max-scaler.service.js} +0 -0
  313. /package/dist/{src/minute-value.vo.d.ts → minute-value.vo.d.ts} +0 -0
  314. /package/dist/{src/minute-value.vo.js → minute-value.vo.js} +0 -0
  315. /package/dist/{src/minute.vo.d.ts → minute.vo.d.ts} +0 -0
  316. /package/dist/{src/minute.vo.js → minute.vo.js} +0 -0
  317. /package/dist/{src/money-amount.vo.d.ts → money-amount.vo.d.ts} +0 -0
  318. /package/dist/{src/money-amount.vo.js → money-amount.vo.js} +0 -0
  319. /package/dist/{src/money.vo.d.ts → money.vo.d.ts} +0 -0
  320. /package/dist/{src/money.vo.js → money.vo.js} +0 -0
  321. /package/dist/{src/month-iso-id.vo.d.ts → month-iso-id.vo.d.ts} +0 -0
  322. /package/dist/{src/month-iso-id.vo.js → month-iso-id.vo.js} +0 -0
  323. /package/dist/{src/month.vo.d.ts → month.vo.d.ts} +0 -0
  324. /package/dist/{src/month.vo.js → month.vo.js} +0 -0
  325. /package/dist/{src/multiplication-factor.vo.d.ts → multiplication-factor.vo.d.ts} +0 -0
  326. /package/dist/{src/multiplication-factor.vo.js → multiplication-factor.vo.js} +0 -0
  327. /package/dist/{src/noop.service.d.ts → noop.service.d.ts} +0 -0
  328. /package/dist/{src/noop.service.js → noop.service.js} +0 -0
  329. /package/dist/{src/object-key.vo.d.ts → object-key.vo.d.ts} +0 -0
  330. /package/dist/{src/object-key.vo.js → object-key.vo.js} +0 -0
  331. /package/dist/{src/outlier-detector.service.d.ts → outlier-detector.service.d.ts} +0 -0
  332. /package/dist/{src/outlier-detector.service.js → outlier-detector.service.js} +0 -0
  333. /package/dist/{src/package-version-schema.vo.d.ts → package-version-schema.vo.d.ts} +0 -0
  334. /package/dist/{src/package-version-schema.vo.js → package-version-schema.vo.js} +0 -0
  335. /package/dist/{src/package-version.vo.d.ts → package-version.vo.d.ts} +0 -0
  336. /package/dist/{src/package-version.vo.js → package-version.vo.js} +0 -0
  337. /package/dist/{src/pagination-page.vo.d.ts → pagination-page.vo.d.ts} +0 -0
  338. /package/dist/{src/pagination-page.vo.js → pagination-page.vo.js} +0 -0
  339. /package/dist/{src/pagination-skip.vo.d.ts → pagination-skip.vo.d.ts} +0 -0
  340. /package/dist/{src/pagination-skip.vo.js → pagination-skip.vo.js} +0 -0
  341. /package/dist/{src/pagination-take.vo.d.ts → pagination-take.vo.d.ts} +0 -0
  342. /package/dist/{src/pagination-take.vo.js → pagination-take.vo.js} +0 -0
  343. /package/dist/{src/pagination.service.d.ts → pagination.service.d.ts} +0 -0
  344. /package/dist/{src/pagination.service.js → pagination.service.js} +0 -0
  345. /package/dist/{src/percentage.service.d.ts → percentage.service.d.ts} +0 -0
  346. /package/dist/{src/percentage.service.js → percentage.service.js} +0 -0
  347. /package/dist/{src/population-standard-deviation.service.d.ts → population-standard-deviation.service.d.ts} +0 -0
  348. /package/dist/{src/population-standard-deviation.service.js → population-standard-deviation.service.js} +0 -0
  349. /package/dist/{src/quarter-iso-id.vo.d.ts → quarter-iso-id.vo.d.ts} +0 -0
  350. /package/dist/{src/quarter-iso-id.vo.js → quarter-iso-id.vo.js} +0 -0
  351. /package/dist/{src/quarter.vo.d.ts → quarter.vo.d.ts} +0 -0
  352. /package/dist/{src/quarter.vo.js → quarter.vo.js} +0 -0
  353. /package/dist/{src/random.service.d.ts → random.service.d.ts} +0 -0
  354. /package/dist/{src/random.service.js → random.service.js} +0 -0
  355. /package/dist/{src/rate-limiter.service.d.ts → rate-limiter.service.d.ts} +0 -0
  356. /package/dist/{src/rate-limiter.service.js → rate-limiter.service.js} +0 -0
  357. /package/dist/{src/relative-date.vo.d.ts → relative-date.vo.d.ts} +0 -0
  358. /package/dist/{src/relative-date.vo.js → relative-date.vo.js} +0 -0
  359. /package/dist/{src/reordering-item-position-value.vo.d.ts → reordering-item-position-value.vo.d.ts} +0 -0
  360. /package/dist/{src/reordering-item-position-value.vo.js → reordering-item-position-value.vo.js} +0 -0
  361. /package/dist/{src/reordering.service.d.ts → reordering.service.d.ts} +0 -0
  362. /package/dist/{src/reordering.service.js → reordering.service.js} +0 -0
  363. /package/dist/{src/repeat.d.ts → repeat.d.ts} +0 -0
  364. /package/dist/{src/repeat.js → repeat.js} +0 -0
  365. /package/dist/{src/revision-value.vo.d.ts → revision-value.vo.d.ts} +0 -0
  366. /package/dist/{src/revision-value.vo.js → revision-value.vo.js} +0 -0
  367. /package/dist/{src/revision.vo.d.ts → revision.vo.d.ts} +0 -0
  368. /package/dist/{src/revision.vo.js → revision.vo.js} +0 -0
  369. /package/dist/{src/rounding-decimal.strategy.d.ts → rounding-decimal.strategy.d.ts} +0 -0
  370. /package/dist/{src/rounding-decimal.strategy.js → rounding-decimal.strategy.js} +0 -0
  371. /package/dist/{src/rounding-down.strategy.d.ts → rounding-down.strategy.d.ts} +0 -0
  372. /package/dist/{src/rounding-down.strategy.js → rounding-down.strategy.js} +0 -0
  373. /package/dist/{src/rounding-to-nearest.strategy.d.ts → rounding-to-nearest.strategy.d.ts} +0 -0
  374. /package/dist/{src/rounding-to-nearest.strategy.js → rounding-to-nearest.strategy.js} +0 -0
  375. /package/dist/{src/rounding-up.strategy.d.ts → rounding-up.strategy.d.ts} +0 -0
  376. /package/dist/{src/rounding-up.strategy.js → rounding-up.strategy.js} +0 -0
  377. /package/dist/{src/rounding.strategy.d.ts → rounding.strategy.d.ts} +0 -0
  378. /package/dist/{src/rounding.strategy.js → rounding.strategy.js} +0 -0
  379. /package/dist/{src/size-bytes.vo.d.ts → size-bytes.vo.d.ts} +0 -0
  380. /package/dist/{src/size-bytes.vo.js → size-bytes.vo.js} +0 -0
  381. /package/dist/{src/size.vo.d.ts → size.vo.d.ts} +0 -0
  382. /package/dist/{src/size.vo.js → size.vo.js} +0 -0
  383. /package/dist/{src/slug.service.d.ts → slug.service.d.ts} +0 -0
  384. /package/dist/{src/slug.service.js → slug.service.js} +0 -0
  385. /package/dist/{src/sum.service.d.ts → sum.service.d.ts} +0 -0
  386. /package/dist/{src/sum.service.js → sum.service.js} +0 -0
  387. /package/dist/{src/thousands-separator.service.d.ts → thousands-separator.service.d.ts} +0 -0
  388. /package/dist/{src/thousands-separator.service.js → thousands-separator.service.js} +0 -0
  389. /package/dist/{src/time-zone-offset-value.vo.d.ts → time-zone-offset-value.vo.d.ts} +0 -0
  390. /package/dist/{src/time-zone-offset-value.vo.js → time-zone-offset-value.vo.js} +0 -0
  391. /package/dist/{src/timestamp-value.vo.d.ts → timestamp-value.vo.d.ts} +0 -0
  392. /package/dist/{src/timestamp-value.vo.js → timestamp-value.vo.js} +0 -0
  393. /package/dist/{src/timestamp.vo.d.ts → timestamp.vo.d.ts} +0 -0
  394. /package/dist/{src/timestamp.vo.js → timestamp.vo.js} +0 -0
  395. /package/dist/{src/timezone.vo.d.ts → timezone.vo.d.ts} +0 -0
  396. /package/dist/{src/timezone.vo.js → timezone.vo.js} +0 -0
  397. /package/dist/{src/ts-utils.d.ts → ts-utils.d.ts} +0 -0
  398. /package/dist/{src/ts-utils.js → ts-utils.js} +0 -0
  399. /package/dist/{src/url-with-slash.vo.d.ts → url-with-slash.vo.d.ts} +0 -0
  400. /package/dist/{src/url-with-slash.vo.js → url-with-slash.vo.js} +0 -0
  401. /package/dist/{src/url-without-slash.vo.d.ts → url-without-slash.vo.d.ts} +0 -0
  402. /package/dist/{src/url-without-slash.vo.js → url-without-slash.vo.js} +0 -0
  403. /package/dist/{src/visually-unambiguous-characters-generator.service.d.ts → visually-unambiguous-characters-generator.service.d.ts} +0 -0
  404. /package/dist/{src/visually-unambiguous-characters-generator.service.js → visually-unambiguous-characters-generator.service.js} +0 -0
  405. /package/dist/{src/week-iso-id.vo.d.ts → week-iso-id.vo.d.ts} +0 -0
  406. /package/dist/{src/week-iso-id.vo.js → week-iso-id.vo.js} +0 -0
  407. /package/dist/{src/week.vo.d.ts → week.vo.d.ts} +0 -0
  408. /package/dist/{src/week.vo.js → week.vo.js} +0 -0
  409. /package/dist/{src/weekday-iso-id.vo.d.ts → weekday-iso-id.vo.d.ts} +0 -0
  410. /package/dist/{src/weekday-iso-id.vo.js → weekday-iso-id.vo.js} +0 -0
  411. /package/dist/{src/weekday.vo.d.ts → weekday.vo.d.ts} +0 -0
  412. /package/dist/{src/weekday.vo.js → weekday.vo.js} +0 -0
  413. /package/dist/{src/weight-grams.vo.d.ts → weight-grams.vo.d.ts} +0 -0
  414. /package/dist/{src/weight-grams.vo.js → weight-grams.vo.js} +0 -0
  415. /package/dist/{src/weight.vo.d.ts → weight.vo.d.ts} +0 -0
  416. /package/dist/{src/weight.vo.js → weight.vo.js} +0 -0
  417. /package/dist/{src/year-iso-id.vo.d.ts → year-iso-id.vo.d.ts} +0 -0
  418. /package/dist/{src/year-iso-id.vo.js → year-iso-id.vo.js} +0 -0
  419. /package/dist/{src/year.vo.d.ts → year.vo.d.ts} +0 -0
  420. /package/dist/{src/year.vo.js → year.vo.js} +0 -0
  421. /package/dist/{src/z-score.service.d.ts → z-score.service.d.ts} +0 -0
  422. /package/dist/{src/z-score.service.js → z-score.service.js} +0 -0
@@ -1 +1 @@
1
- {"root":["../src/age-years.vo.ts","../src/age.vo.ts","../src/api-key.vo.ts","../src/basename.vo.ts","../src/batch.ts","../src/date-calculator.service.ts","../src/date-formatter.service.ts","../src/date-range.vo.ts","../src/day-iso-id.vo.ts","../src/day.vo.ts","../src/directory-path-absolute.vo.ts","../src/directory-path-relative.vo.ts","../src/distance-value.vo.ts","../src/distance.vo.ts","../src/division-factor.vo.ts","../src/dll.service.ts","../src/duration-ms.vo.ts","../src/duration.service.ts","../src/email-mask.service.ts","../src/email.vo.ts","../src/etags.vo.ts","../src/extension.vo.ts","../src/feature-flag-value.vo.ts","../src/feature-flag.vo.ts","../src/file-path-absolute-schema.vo.ts","../src/file-path-relative-schema.vo.ts","../src/file-path.vo.ts","../src/filename-affix.vo.ts","../src/filename-from-string.vo.ts","../src/filename.vo.ts","../src/height-milimiters.vo.ts","../src/height.vo.ts","../src/hour-value.vo.ts","../src/hour.vo.ts","../src/iban-mask.service.ts","../src/iban-schema.vo.ts","../src/iban.vo.ts","../src/image.vo.ts","../src/index.ts","../src/integer-non-negative.vo.ts","../src/integer-positive.vo.ts","../src/integer.vo.ts","../src/language.vo.ts","../src/linear-regression.service.ts","../src/mean.service.ts","../src/mime-registry-entry.vo.ts","../src/mime-registry.service.ts","../src/mime-value.vo.ts","../src/mime.vo.ts","../src/mimes.ts","../src/min-max-scaler.service.ts","../src/minute-value.vo.ts","../src/minute.vo.ts","../src/money-amount.vo.ts","../src/money.vo.ts","../src/month-iso-id.vo.ts","../src/month.vo.ts","../src/multiplication-factor.vo.ts","../src/noop.service.ts","../src/object-key.vo.ts","../src/outlier-detector.service.ts","../src/package-version-schema.vo.ts","../src/package-version.vo.ts","../src/pagination-page.vo.ts","../src/pagination-skip.vo.ts","../src/pagination-take.vo.ts","../src/pagination.service.ts","../src/percentage.service.ts","../src/population-standard-deviation.service.ts","../src/quarter-iso-id.vo.ts","../src/quarter.vo.ts","../src/random.service.ts","../src/rate-limiter.service.ts","../src/relative-date.vo.ts","../src/reordering-item-position-value.vo.ts","../src/reordering.service.ts","../src/repeat.ts","../src/revision-value.vo.ts","../src/revision.vo.ts","../src/rounding-decimal.strategy.ts","../src/rounding-down.strategy.ts","../src/rounding-to-nearest.strategy.ts","../src/rounding-up.strategy.ts","../src/rounding.strategy.ts","../src/size-bytes.vo.ts","../src/size.vo.ts","../src/slug.service.ts","../src/sum.service.ts","../src/thousands-separator.service.ts","../src/time-zone-offset-value.vo.ts","../src/timestamp-value.vo.ts","../src/timestamp.vo.ts","../src/timezone.vo.ts","../src/ts-utils.ts","../src/url-with-slash.vo.ts","../src/url-without-slash.vo.ts","../src/visually-unambiguous-characters-generator.service.ts","../src/week-iso-id.vo.ts","../src/week.vo.ts","../src/weekday-iso-id.vo.ts","../src/weekday.vo.ts","../src/weight-grams.vo.ts","../src/weight.vo.ts","../src/year-iso-id.vo.ts","../src/year.vo.ts","../src/z-score.service.ts","../tests/age-years.vo.test.ts","../tests/age.vo.test.ts","../tests/api-key.vo.test.ts","../tests/basename.vo.test.ts","../tests/batch.test.ts","../tests/date-calculator.service.test.ts","../tests/date-formatter.service.test.ts","../tests/date-range.vo.test.ts","../tests/day-iso-id.vo.test.ts","../tests/day.vo.test.ts","../tests/directory-path-absolute.vo.test.ts","../tests/directory-path-relative.vo.test.ts","../tests/distance-value.vo.test.ts","../tests/distance.vo.test.ts","../tests/division-factor.vo.test.ts","../tests/dll.service.test.ts","../tests/duration-ms.vo.test.ts","../tests/duration.service.test.ts","../tests/email-mask.service.test.ts","../tests/email.vo.test.ts","../tests/etags.vo.test.ts","../tests/extension.vo.test.ts","../tests/feature-flag-value.vo.test.ts","../tests/feature-flag.vo.test.ts","../tests/file-path-absolute-schema.vo.test.ts","../tests/file-path-relative-schema.vo.test.ts","../tests/file-path.vo.test.ts","../tests/filename-affix.vo.test.ts","../tests/filename-from-string.vo.test.ts","../tests/filename.vo.test.ts","../tests/height-milimiters.vo.test.ts","../tests/height.vo.test.ts","../tests/hour-value.vo.test.ts","../tests/hour.vo.test.ts","../tests/iban-mask.service.test.ts","../tests/iban-schema.vo.test.ts","../tests/iban.vo.test.ts","../tests/image.vo.test.ts","../tests/integer-non-negative.vo.test.ts","../tests/integer-positive.vo.test.ts","../tests/integer.vo.test.ts","../tests/language.vo.test.ts","../tests/linear-regression.service.test.ts","../tests/mean.service.test.ts","../tests/mime-registry-entry.vo.test.ts","../tests/mime-registry.service.test.ts","../tests/mime-value.vo.test.ts","../tests/mime.vo.test.ts","../tests/mimes.test.ts","../tests/min-max-scaler.service.test.ts","../tests/minute-value.vo.test.ts","../tests/minute.vo.test.ts","../tests/mocks.ts","../tests/money-amount.vo.test.ts","../tests/money.vo.test.ts","../tests/month-iso-id.vo.test.ts","../tests/month.vo.test.ts","../tests/multiplication-factor.vo.test.ts","../tests/noop.test.ts","../tests/object-key.vo.test.ts","../tests/outlier-detector.service.test.ts","../tests/package-version-schema.vo.test.ts","../tests/package-version.vo.test.ts","../tests/pagination-page.vo.test.ts","../tests/pagination-skip.vo.test.ts","../tests/pagination-take.vo.test.ts","../tests/pagination.service.test.ts","../tests/percentage.service.test.ts","../tests/population-standard-deviation.service.test.ts","../tests/quarter-iso-id.vo.test.ts","../tests/quarter.vo.test.ts","../tests/random.service.test.ts","../tests/rate-limiter.service.test.ts","../tests/relative-date.vo.test.ts","../tests/reordering-item-position-value.vo.test.ts","../tests/reordering.service.test.ts","../tests/repeat.test.ts","../tests/revision-value.vo.test.ts","../tests/revision.vo.test.ts","../tests/rounding-decimal.strategy.test.ts","../tests/rounding-down.strategy.test.ts","../tests/rounding-to-nearest.strategy.test.ts","../tests/rounding-up.strategy.test.ts","../tests/size-bytes.vo.test.ts","../tests/size.vo.test.ts","../tests/slug.service.test.ts","../tests/sum.service.test.ts","../tests/thousands-separator.service.test.ts","../tests/time-zone-offset-value.test.ts","../tests/timestamp-value.vo.test.ts","../tests/timestamp.vo.test.ts","../tests/timezone.vo.test.ts","../tests/url-with-slash.vo.test.ts","../tests/url-without-slash.vo.test.ts","../tests/visually-unambiguous-characters-generator.service.test.ts","../tests/week-iso-id.vo.test.ts","../tests/week.vo.test.ts","../tests/weekday-iso-id.vo.test.ts","../tests/weekday.vo.test.ts","../tests/weight-grams.vo.test.ts","../tests/weight.vo.test.ts","../tests/year-iso-id.vo.test.ts","../tests/year.vo.test.ts","../tests/z-score.service.test.ts"],"version":"5.9.3"}
1
+ {"root":["../src/age-years.vo.ts","../src/age.vo.ts","../src/api-key.vo.ts","../src/basename.vo.ts","../src/batch.ts","../src/date-calculator.service.ts","../src/date-formatter.service.ts","../src/date-range.vo.ts","../src/day-iso-id.vo.ts","../src/day.vo.ts","../src/directory-path-absolute.vo.ts","../src/directory-path-relative.vo.ts","../src/distance-value.vo.ts","../src/distance.vo.ts","../src/division-factor.vo.ts","../src/dll.service.ts","../src/duration-ms.vo.ts","../src/duration.service.ts","../src/email-mask.service.ts","../src/email.vo.ts","../src/etags.vo.ts","../src/extension.vo.ts","../src/feature-flag-value.vo.ts","../src/feature-flag.vo.ts","../src/file-path-absolute-schema.vo.ts","../src/file-path-relative-schema.vo.ts","../src/file-path.vo.ts","../src/filename-affix.vo.ts","../src/filename-from-string.vo.ts","../src/filename.vo.ts","../src/height-milimiters.vo.ts","../src/height.vo.ts","../src/hour-value.vo.ts","../src/hour.vo.ts","../src/iban-mask.service.ts","../src/iban-schema.vo.ts","../src/iban.vo.ts","../src/image.vo.ts","../src/index.ts","../src/integer-non-negative.vo.ts","../src/integer-positive.vo.ts","../src/integer.vo.ts","../src/language.vo.ts","../src/linear-regression.service.ts","../src/mean.service.ts","../src/mime-registry-entry.vo.ts","../src/mime-registry.service.ts","../src/mime-value.vo.ts","../src/mime.vo.ts","../src/mimes.ts","../src/min-max-scaler.service.ts","../src/minute-value.vo.ts","../src/minute.vo.ts","../src/money-amount.vo.ts","../src/money.vo.ts","../src/month-iso-id.vo.ts","../src/month.vo.ts","../src/multiplication-factor.vo.ts","../src/noop.service.ts","../src/object-key.vo.ts","../src/outlier-detector.service.ts","../src/package-version-schema.vo.ts","../src/package-version.vo.ts","../src/pagination-page.vo.ts","../src/pagination-skip.vo.ts","../src/pagination-take.vo.ts","../src/pagination.service.ts","../src/percentage.service.ts","../src/population-standard-deviation.service.ts","../src/quarter-iso-id.vo.ts","../src/quarter.vo.ts","../src/random.service.ts","../src/rate-limiter.service.ts","../src/relative-date.vo.ts","../src/reordering-item-position-value.vo.ts","../src/reordering.service.ts","../src/repeat.ts","../src/revision-value.vo.ts","../src/revision.vo.ts","../src/rounding-decimal.strategy.ts","../src/rounding-down.strategy.ts","../src/rounding-to-nearest.strategy.ts","../src/rounding-up.strategy.ts","../src/rounding.strategy.ts","../src/size-bytes.vo.ts","../src/size.vo.ts","../src/slug.service.ts","../src/sum.service.ts","../src/thousands-separator.service.ts","../src/time-zone-offset-value.vo.ts","../src/timestamp-value.vo.ts","../src/timestamp.vo.ts","../src/timezone.vo.ts","../src/ts-utils.ts","../src/url-with-slash.vo.ts","../src/url-without-slash.vo.ts","../src/visually-unambiguous-characters-generator.service.ts","../src/week-iso-id.vo.ts","../src/week.vo.ts","../src/weekday-iso-id.vo.ts","../src/weekday.vo.ts","../src/weight-grams.vo.ts","../src/weight.vo.ts","../src/year-iso-id.vo.ts","../src/year.vo.ts","../src/z-score.service.ts"],"version":"5.9.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bgord/tools",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Bartosz Gordon",
@@ -1 +0,0 @@
1
- export {};
@@ -1,24 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import * as v from "valibot";
3
- import { AgeYears } from "../src/age-years.vo";
4
- describe("AgeYears", () => {
5
- test("happy path", () => {
6
- expect(v.safeParse(AgeYears, 0).success).toEqual(true);
7
- expect(v.safeParse(AgeYears, 130).success).toEqual(true);
8
- });
9
- test("rejects non-number - null", () => {
10
- expect(() => v.parse(AgeYears, null)).toThrow("age.years.type");
11
- });
12
- test("rejects non-number - string", () => {
13
- expect(() => v.parse(AgeYears, "100")).toThrow("age.years.type");
14
- });
15
- test("rejects fraction", () => {
16
- expect(() => v.parse(AgeYears, 100.5)).toThrow("age.years.type");
17
- });
18
- test("rejects negative", () => {
19
- expect(() => v.parse(AgeYears, -1)).toThrow("age.years.invalid");
20
- });
21
- test("rejects 131", () => {
22
- expect(() => v.parse(AgeYears, 131)).toThrow("age.years.invalid");
23
- });
24
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,106 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import * as v from "valibot";
3
- import { Age } from "../src/age.vo";
4
- import { AgeYears } from "../src/age-years.vo";
5
- import { Timestamp } from "../src/timestamp.vo";
6
- import * as mocks from "./mocks";
7
- const min = v.parse(AgeYears, 0);
8
- const max = v.parse(AgeYears, 130);
9
- const twentyThree = v.parse(AgeYears, 23);
10
- describe("Age", () => {
11
- test("fromValue", () => {
12
- expect(Age.fromValue(0).get()).toEqual(min);
13
- expect(Age.fromValue(130).get()).toEqual(max);
14
- });
15
- test("fromValueSafe", () => {
16
- expect(Age.fromValueSafe(min).get()).toEqual(min);
17
- expect(Age.fromValueSafe(max).get()).toEqual(max);
18
- });
19
- test("fromBirthdateTimestamp - birthday has already happened", () => {
20
- expect(Age.fromBirthdateTimestamp({
21
- birthdate: Timestamp.fromDateLike("2000-11-13"),
22
- now: mocks.TIME_ZERO,
23
- }).get()).toEqual(twentyThree);
24
- });
25
- test("fromBirthdateTimestamp - birthday has NOT yet happened", () => {
26
- expect(Age.fromBirthdateTimestamp({
27
- birthdate: Timestamp.fromDateLike("2000-11-15"),
28
- now: mocks.TIME_ZERO,
29
- }).get()).toEqual(v.parse(AgeYears, 22));
30
- });
31
- test("fromBirthdateTimestamp - exactly on birthday", () => {
32
- expect(Age.fromBirthdateTimestamp({
33
- birthdate: Timestamp.fromDateLike("2000-11-14"),
34
- now: mocks.TIME_ZERO,
35
- }).get()).toEqual(twentyThree);
36
- });
37
- test("fromBirthdateTimestamp - rejects future birthdates", () => {
38
- expect(() => Age.fromBirthdateTimestamp({ birthdate: Timestamp.fromDateLike("2125-10-01"), now: mocks.TIME_ZERO })).toThrowError("age.future.birthdate");
39
- });
40
- test("fromBirthdate - birthday has already happened", () => {
41
- expect(Age.fromBirthdate({ birthdate: "2000-11-13", now: mocks.TIME_ZERO }).get()).toEqual(twentyThree);
42
- });
43
- test("fromBirthdate - birthday has NOT yet happened", () => {
44
- expect(Age.fromBirthdate({ birthdate: "2000-11-15", now: mocks.TIME_ZERO }).get()).toEqual(v.parse(AgeYears, 22));
45
- });
46
- test("fromBirthdate - exactly on birthday", () => {
47
- expect(Age.fromBirthdate({ birthdate: "2000-11-14", now: mocks.TIME_ZERO }).get()).toEqual(twentyThree);
48
- });
49
- test("fromBirthdate - rejects future birthdates", () => {
50
- expect(() => Age.fromBirthdate({ birthdate: "2125-10-01", now: mocks.TIME_ZERO })).toThrowError("age.future.birthdate");
51
- });
52
- test("fromBirthdate - rejects above upper bound", () => {
53
- expect(() => Age.fromBirthdate({ birthdate: "1800-01-01", now: mocks.TIME_ZERO })).toThrow("timestamp.invalid");
54
- });
55
- test("fromBirthdate - invalid date string throws", () => {
56
- expect(() => Age.fromBirthdate({ birthdate: "not-a-date", now: mocks.TIME_ZERO })).toThrow("timestamp.invalid");
57
- });
58
- test("MIN", () => {
59
- expect(Age.MIN).toEqual(0);
60
- });
61
- test("MAX", () => {
62
- expect(Age.MAX).toEqual(130);
63
- });
64
- test("get", () => {
65
- expect(Age.fromValue(twentyThree).get()).toEqual(twentyThree);
66
- });
67
- test("equals - true", () => {
68
- const first = Age.fromValue(18);
69
- const second = Age.fromValue(18);
70
- expect(first.equals(second)).toEqual(true);
71
- });
72
- test("equals - false", () => {
73
- const first = Age.fromValue(18);
74
- const second = Age.fromValue(19);
75
- expect(first.equals(second)).toEqual(false);
76
- });
77
- test("isOlderThan", () => {
78
- const youngerAge = Age.fromValue(17);
79
- const olderAge = Age.fromValue(18);
80
- expect(olderAge.isOlderThan(youngerAge)).toEqual(true);
81
- expect(youngerAge.isOlderThan(olderAge)).toEqual(false);
82
- expect(youngerAge.isOlderThan(youngerAge)).toEqual(false);
83
- });
84
- test("isYoungerThan", () => {
85
- const youngerAge = Age.fromValue(17);
86
- const olderAge = Age.fromValue(18);
87
- expect(youngerAge.isYoungerThan(olderAge)).toEqual(true);
88
- expect(olderAge.isYoungerThan(youngerAge)).toEqual(false);
89
- expect(youngerAge.isYoungerThan(youngerAge)).toEqual(false);
90
- });
91
- test("isAdult - treats exactly the same age as adult", () => {
92
- expect(Age.fromValue(18).isAdult(Age.fromValue(18))).toEqual(true);
93
- });
94
- test("isAdult - treats older age as adult", () => {
95
- expect(Age.fromValue(21).isAdult(Age.fromValue(18))).toEqual(true);
96
- });
97
- test("isAdult - treats younger age as not adult", () => {
98
- expect(Age.fromValue(17).isAdult(Age.fromValue(18))).toEqual(false);
99
- });
100
- test("toString", () => {
101
- expect(Age.fromValue(42).toString()).toEqual("42");
102
- });
103
- test("toJSON", () => {
104
- expect(Age.fromValue(42).toJSON()).toEqual(42);
105
- });
106
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,24 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import * as v from "valibot";
3
- import { ApiKey } from "../src/api-key.vo";
4
- describe("ApiKey", () => {
5
- test("happy path", () => {
6
- expect(v.safeParse(ApiKey, "a".repeat(64)).success).toEqual(true);
7
- expect(v.safeParse(ApiKey, "A".repeat(64)).success).toEqual(true);
8
- });
9
- test("rejects non-string - null", () => {
10
- expect(() => v.parse(ApiKey, null)).toThrow("api.key.type");
11
- });
12
- test("rejects non-string - number", () => {
13
- expect(() => v.parse(ApiKey, 123)).toThrow("api.key.type");
14
- });
15
- test("rejects empty", () => {
16
- expect(() => v.parse(ApiKey, "")).toThrow("api.key.bad.chars");
17
- });
18
- test("rejects too long", () => {
19
- expect(() => v.parse(ApiKey, `${"a".repeat(64)}abc`)).toThrow("api.key.bad.chars");
20
- });
21
- test("rejects bad chars", () => {
22
- expect(() => v.parse(ApiKey, `${"a".repeat(63)}!`)).toThrow("api.key.bad.chars");
23
- });
24
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,53 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import * as v from "valibot";
3
- import { Basename } from "../src/basename.vo";
4
- describe("Basename", () => {
5
- test("happy path", () => {
6
- expect(v.safeParse(Basename, "avatar").success).toEqual(true);
7
- expect(v.safeParse(Basename, "Report_v1.2-rc").success).toEqual(true);
8
- expect(v.safeParse(Basename, "a".repeat(128)).success).toEqual(true);
9
- });
10
- test("rejects non-string - null", () => {
11
- expect(() => v.parse(Basename, null)).toThrow("basename.type");
12
- });
13
- test("rejects non-string - number", () => {
14
- expect(() => v.parse(Basename, 42)).toThrow("basename.type");
15
- });
16
- test("rejects 129 chars", () => {
17
- expect(() => v.parse(Basename, "a".repeat(129))).toThrow("basename.too.long");
18
- });
19
- test("rejects empty", () => {
20
- expect(() => v.parse(Basename, "")).toThrow("basename.empty");
21
- });
22
- test("rejects forward slash", () => {
23
- expect(() => v.parse(Basename, "a/b")).toThrow("basename.bad.chars");
24
- });
25
- test("rejects backslash", () => {
26
- expect(() => v.parse(Basename, "a\\b")).toThrow("basename.bad.chars");
27
- });
28
- test("rejects control chars", () => {
29
- expect(() => v.parse(Basename, "line\nbreak")).toThrow("basename.bad.chars");
30
- expect(() => v.parse(Basename, "nul\u0000byte")).toThrow("basename.bad.chars");
31
- });
32
- test("rejects single dot", () => {
33
- expect(() => v.parse(Basename, ".")).toThrow("basename.dot.segments");
34
- });
35
- test("rejects double dot", () => {
36
- expect(() => v.parse(Basename, "..")).toThrow("basename.dot.segments");
37
- });
38
- test("rejects dotfile", () => {
39
- expect(() => v.parse(Basename, ".env")).toThrow("basename.dotfiles");
40
- });
41
- test("rejects trailing dot", () => {
42
- expect(() => v.parse(Basename, "name.")).toThrow("basename.trailing.dot");
43
- });
44
- test("rejects space", () => {
45
- expect(() => v.parse(Basename, "name name")).toThrow("basename.bad.chars");
46
- });
47
- test("rejects emoji", () => {
48
- expect(() => v.parse(Basename, "name🙂")).toThrow("basename.bad.chars");
49
- });
50
- test("rejects symbol", () => {
51
- expect(() => v.parse(Basename, "name@")).toThrow("basename.bad.chars");
52
- });
53
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,24 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import * as v from "valibot";
3
- import { batch } from "../src/batch";
4
- import { IntegerPositive } from "../src/integer-positive.vo";
5
- const size = v.parse(IntegerPositive, 10);
6
- describe("batch", () => {
7
- test("happy path", () => {
8
- const strings = Array.from({ length: 25 }, (_, i) => `item-${i}`);
9
- const result = batch(strings, size);
10
- expect(result.length).toEqual(3);
11
- expect(result[0].length).toEqual(10);
12
- expect(result[1].length).toEqual(10);
13
- expect(result[2].length).toEqual(5);
14
- });
15
- test("happy path - less than size", () => {
16
- const strings = ["a", "b", "c"];
17
- const result = batch(strings, size);
18
- expect(result.length).toEqual(1);
19
- expect(result[0]).toEqual(["a", "b", "c"]);
20
- });
21
- test("empty array", () => {
22
- expect(batch([], size)).toEqual([]);
23
- });
24
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,32 +0,0 @@
1
- import { afterEach, beforeEach, describe, expect, jest, test } from "bun:test";
2
- import { DateCalculator } from "../src/date-calculator.service";
3
- import { Duration } from "../src/duration.service";
4
- import { Timestamp } from "../src/timestamp.vo";
5
- describe("DateCalculator", () => {
6
- beforeEach(() => jest.setSystemTime(new Date("2024-06-01T12:00:00Z")));
7
- afterEach(() => jest.setSystemTime());
8
- test("UTC timezone", () => {
9
- const now = Timestamp.fromNumber(Date.now()); // 2024-06-01T12:00:00Z
10
- const result = DateCalculator.getStartOfDayTsInTz({ now, timeZoneOffset: Duration.Ms(0) });
11
- expect(result).toEqual(Timestamp.fromNumber(new Date("2024-06-01T00:00:00Z").getTime()));
12
- });
13
- test("UTC+2 timezone", () => {
14
- const now = Timestamp.fromNumber(Date.now()); // 2024-06-01T12:00:00Z
15
- const result = DateCalculator.getStartOfDayTsInTz({ now, timeZoneOffset: Duration.Hours(2) });
16
- // Local day = 2024-06-01 (because 12:00Z is 14:00 local).
17
- // Local midnight (00:00 +02:00) corresponds to 2024-06-01T02:00:00Z.
18
- expect(result).toEqual(Timestamp.fromNumber(new Date("2024-06-01T02:00:00Z").getTime()));
19
- });
20
- test("UTC-5 timezone", () => {
21
- const now = Timestamp.fromNumber(Date.now()); // 2024-06-01T12:00:00Z
22
- const result = DateCalculator.getStartOfDayTsInTz({ now, timeZoneOffset: Duration.Hours(-5) });
23
- // Local day = 2024-06-01 (because 12:00Z is 07:00 local).
24
- // Local midnight (00:00 -05:00) corresponds to 2024-05-31T19:00:00Z.
25
- expect(result).toEqual(Timestamp.fromNumber(new Date("2024-05-31T19:00:00Z").getTime()));
26
- });
27
- test("UTC+2 timezone - between days", () => {
28
- const now = Timestamp.fromNumber(new Date("2024-06-01T01:00:00Z").getTime());
29
- const result = DateCalculator.getStartOfDayTsInTz({ now, timeZoneOffset: Duration.Hours(2) });
30
- expect(result).toEqual(Timestamp.fromNumber(new Date("2024-05-31T02:00:00Z").getTime()));
31
- });
32
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,22 +0,0 @@
1
- import { afterEach, beforeEach, describe, expect, jest, test } from "bun:test";
2
- import { DateFormatters } from "../src/date-formatter.service";
3
- import * as mocks from "./mocks";
4
- const date = new Date(mocks.TIME_ZERO.ms);
5
- describe("DateFormatters", () => {
6
- test("datetime", () => {
7
- expect(DateFormatters.datetime(date)).toEqual("2023/11/14 22:13");
8
- });
9
- test("date", () => {
10
- expect(DateFormatters.date(date)).toEqual("2023/11/14");
11
- });
12
- test("monthDay", () => {
13
- expect(DateFormatters.monthDay(date)).toEqual("11/14");
14
- });
15
- describe("relative", () => {
16
- beforeEach(() => jest.setSystemTime(new Date("2024-06-01T15:35:00Z")));
17
- afterEach(() => jest.setSystemTime());
18
- test("happy path", () => {
19
- expect(DateFormatters.relative(date)).toEqual("7 months ago");
20
- });
21
- });
22
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,49 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import { DateRange } from "../src/date-range.vo";
3
- import { Duration } from "../src/duration.service";
4
- import * as mocks from "./mocks";
5
- const duration = Duration.Seconds(1);
6
- const START = mocks.TIME_ZERO;
7
- const END = START.add(duration);
8
- const range = new DateRange(START, END);
9
- describe("DateRange", () => {
10
- test("constructor - start after end", () => {
11
- expect(() => new DateRange(END, START)).toThrow("date.range.invalid");
12
- });
13
- test("constructor - start equals end", () => {
14
- expect(() => new DateRange(START, START)).toThrow("date.range.invalid");
15
- });
16
- test("getStart", () => {
17
- expect(range.getStart()).toEqual(START);
18
- });
19
- test("getEnd", () => {
20
- expect(range.getEnd()).toEqual(END);
21
- });
22
- test("get", () => {
23
- expect(range.get()).toEqual([START, END]);
24
- });
25
- test("getDuration", () => {
26
- expect(range.getDuration()).toEqual(duration);
27
- });
28
- test("contains - true", () => {
29
- expect(range.contains(START)).toEqual(true);
30
- expect(range.contains(START.add(Duration.Ms(500)))).toEqual(true);
31
- expect(range.contains(END)).toEqual(true);
32
- });
33
- test("contains - false", () => {
34
- expect(range.contains(START.subtract(Duration.Ms(1)))).toEqual(false);
35
- expect(range.contains(END.add(Duration.Ms(1)))).toEqual(false);
36
- });
37
- test("equals - true", () => {
38
- expect(range.equals(range)).toEqual(true);
39
- });
40
- test("equals - false", () => {
41
- expect(range.equals(new DateRange(START, END.add(Duration.Seconds(1))))).toEqual(false);
42
- });
43
- test("toString", () => {
44
- expect(range.toString()).toEqual(`${START.toString()} - ${END.toString()}`);
45
- });
46
- test("toJSON", () => {
47
- expect(range.toJSON()).toEqual({ start: START.ms, end: END.ms });
48
- });
49
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,36 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import * as v from "valibot";
3
- import { DayIsoId } from "../src/day-iso-id.vo";
4
- describe("DayIsoId", () => {
5
- test("happy path", () => {
6
- expect(v.safeParse(DayIsoId, "2025-07-15").success).toEqual(true);
7
- expect(v.safeParse(DayIsoId, "2024-02-29").success).toEqual(true);
8
- });
9
- test("rejects prefix", () => {
10
- expect(() => v.parse(DayIsoId, "prefix2025-07-15")).toThrow("day.iso.id.bad.chars");
11
- });
12
- test("rejects suffix", () => {
13
- expect(() => v.parse(DayIsoId, "2025-07-15suffix")).toThrow("day.iso.id.bad.chars");
14
- });
15
- test("rejects non-string - null", () => {
16
- expect(() => v.parse(DayIsoId, null)).toThrow("day.iso.id.type");
17
- });
18
- test("rejects non-string - number", () => {
19
- expect(() => v.parse(DayIsoId, 2024)).toThrow("day.iso.id.type");
20
- });
21
- test("rejects empty", () => {
22
- expect(() => v.parse(DayIsoId, "")).toThrow("day.iso.id.bad.chars");
23
- });
24
- test("rejects strings that don't match YYYY-MM-DD", () => {
25
- const invalid = ["2025-7-15", "25-07-15", "2025/07/15", "20250715"];
26
- for (const value of invalid) {
27
- expect(() => v.parse(DayIsoId, value)).toThrow("day.iso.id.bad.chars");
28
- }
29
- });
30
- test("rejects impossible calendar dates", () => {
31
- const invalid = ["2025-02-30", "2025-13-01", "2025-00-10", "2025-04-31", "2025-02-29"];
32
- for (const value of invalid) {
33
- expect(() => v.parse(DayIsoId, value)).toThrow("day.iso.id.invalid.date");
34
- }
35
- });
36
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,68 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import * as v from "valibot";
3
- import { Day } from "../src/day.vo";
4
- import { DayIsoId } from "../src/day-iso-id.vo";
5
- import { Duration } from "../src/duration.service";
6
- import { Integer } from "../src/integer.vo";
7
- import { Timestamp } from "../src/timestamp.vo";
8
- import * as mocks from "./mocks";
9
- const start = Timestamp.fromNumber(Date.UTC(mocks.TIME_ZERO_DATE.getUTCFullYear(), mocks.TIME_ZERO_DATE.getUTCMonth(), mocks.TIME_ZERO_DATE.getUTCDate()));
10
- const end = start.add(Duration.Days(1)).subtract(mocks.epsilon);
11
- const dayIsoId = v.parse(DayIsoId, mocks.TIME_ZERO_DATE_LIKE);
12
- describe("Day", () => {
13
- test("happy path", () => {
14
- const day = Day.fromTimestamp(mocks.TIME_ZERO);
15
- expect(day.getStart()).toEqual(start);
16
- expect(day.getEnd()).toEqual(end);
17
- expect(day.toIsoId()).toEqual(dayIsoId);
18
- expect(day.contains(mocks.TIME_ZERO)).toEqual(true);
19
- });
20
- test("fromTimestamp", () => {
21
- expect(Day.fromTimestamp(mocks.TIME_ZERO).toIsoId()).toEqual(dayIsoId);
22
- });
23
- test("fromTimestampValue", () => {
24
- expect(Day.fromTimestampValue(mocks.TIME_ZERO.ms).toIsoId()).toEqual(dayIsoId);
25
- });
26
- test("fromNow", () => {
27
- expect(Day.fromNow(mocks.TIME_ZERO).toIsoId()).toEqual(dayIsoId);
28
- });
29
- test("fromIsoId", () => {
30
- expect(Day.fromIsoId(dayIsoId).toIsoId()).toEqual(dayIsoId);
31
- });
32
- test("leap-day", () => {
33
- const timestamp = Timestamp.fromDateLike("2024-02-29");
34
- const day = Day.fromTimestamp(timestamp);
35
- expect(day.toIsoId()).toEqual(v.parse(DayIsoId, "2024-02-29"));
36
- expect(day.contains(timestamp)).toEqual(true);
37
- });
38
- test("equals", () => {
39
- const day = Day.fromTimestamp(mocks.TIME_ZERO);
40
- const now = Day.fromNow(Timestamp.fromNumber(Date.now()));
41
- expect(day.equals(now)).toEqual(false);
42
- expect(day.equals(day)).toEqual(true);
43
- });
44
- test("next", () => {
45
- expect(Day.fromTimestamp(mocks.TIME_ZERO).next().toIsoId()).toEqual(v.parse(DayIsoId, "2023-11-15"));
46
- });
47
- test("previous", () => {
48
- expect(Day.fromTimestamp(mocks.TIME_ZERO).previous().toIsoId()).toEqual(v.parse(DayIsoId, "2023-11-13"));
49
- });
50
- test("shift", () => {
51
- expect(Day.fromTimestamp(mocks.TIME_ZERO).shift(v.parse(Integer, 2)).toIsoId()).toEqual(v.parse(DayIsoId, "2023-11-16"));
52
- expect(Day.fromTimestamp(mocks.TIME_ZERO).shift(v.parse(Integer, -2)).toIsoId()).toEqual(v.parse(DayIsoId, "2023-11-12"));
53
- });
54
- test("round-trips", () => {
55
- expect(Day.fromIsoId(dayIsoId).toIsoId()).toEqual(dayIsoId);
56
- });
57
- test("contains", () => {
58
- const day = Day.fromTimestamp(mocks.TIME_ZERO);
59
- expect(day.contains(day.getStart().subtract(mocks.epsilon))).toEqual(false);
60
- expect(day.contains(day.getEnd().add(mocks.epsilon))).toEqual(false);
61
- });
62
- test("toString", () => {
63
- expect(Day.fromIsoId(dayIsoId).toString()).toEqual(mocks.TIME_ZERO_DATE_LIKE);
64
- });
65
- test("toJSON", () => {
66
- expect(Day.fromIsoId(dayIsoId).toJSON()).toEqual({ start: 1699920000000, end: 1700006399999 });
67
- });
68
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,47 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import * as v from "valibot";
3
- import { DirectoryPathAbsoluteSchema } from "../src/directory-path-absolute.vo";
4
- describe("DirectoryPathAbsoluteSchema", () => {
5
- test("happy path", () => {
6
- const valid = ["/tmp/app/users", "/", "/ok.png"];
7
- for (const value of valid) {
8
- expect(v.safeParse(DirectoryPathAbsoluteSchema, value)).toMatchObject({ success: true, output: value });
9
- }
10
- });
11
- test("rejects non-string - null", () => {
12
- expect(() => v.parse(DirectoryPathAbsoluteSchema, null)).toThrow("directory.path.absolue.type");
13
- });
14
- test("rejects non-string - number", () => {
15
- expect(() => v.parse(DirectoryPathAbsoluteSchema, 42)).toThrow("directory.path.absolue.type");
16
- });
17
- test("rejects too long", () => {
18
- expect(() => v.parse(DirectoryPathAbsoluteSchema, `/${"a".repeat(512)}`)).toThrow("directory.path.absolue.too.long");
19
- });
20
- test("rejects empty", () => {
21
- expect(() => v.parse(DirectoryPathAbsoluteSchema, "")).toThrow("directory.path.absolue.empty");
22
- });
23
- test("rejects empty segment", () => {
24
- expect(() => v.parse(DirectoryPathAbsoluteSchema, "/tmp//app///users")).toThrow("directory.path.absolue.bad.segments");
25
- });
26
- test("rejects trailing slash", () => {
27
- expect(() => v.parse(DirectoryPathAbsoluteSchema, "/tmp/app/")).toThrow("directory.path.absolue.trailing.slash");
28
- });
29
- test("rejects relative path", () => {
30
- expect(() => v.parse(DirectoryPathAbsoluteSchema, "tmp/app")).toThrow("directory.path.absolue.leading.slash");
31
- });
32
- test("rejects backslash", () => {
33
- expect(() => v.parse(DirectoryPathAbsoluteSchema, "/tmp\\app")).toThrow("directory.path.absolue.bad.segments");
34
- });
35
- test("rejects control chars", () => {
36
- expect(() => v.parse(DirectoryPathAbsoluteSchema, "/tmp\napp")).toThrow("directory.path.absolue.bad.segments");
37
- });
38
- test("rejects dot segment", () => {
39
- expect(() => v.parse(DirectoryPathAbsoluteSchema, "/tmp/../etc")).toThrow("directory.path.absolue.bad.segments");
40
- });
41
- test("rejects double-dot segment", () => {
42
- expect(() => v.parse(DirectoryPathAbsoluteSchema, "/tmp/./users")).toThrow("directory.path.absolue.bad.segments");
43
- });
44
- test("rejects invalid segment", () => {
45
- expect(() => v.parse(DirectoryPathAbsoluteSchema, "/tmp/app/invalid segment")).toThrow("directory.path.absolue.bad.segments");
46
- });
47
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,44 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
- import * as v from "valibot";
3
- import { DirectoryPathRelativeSchema } from "../src/directory-path-relative.vo";
4
- describe("DirectoryPathRelativeSchema", () => {
5
- test("happy path", () => {
6
- const valid = ["users/avatars", "users"];
7
- for (const value of valid) {
8
- expect(v.safeParse(DirectoryPathRelativeSchema, value)).toMatchObject({ success: true, output: value });
9
- }
10
- });
11
- test("rejects non-string - null", () => {
12
- expect(() => v.parse(DirectoryPathRelativeSchema, null)).toThrow("directory.path.relative.type");
13
- });
14
- test("rejects non-string - number", () => {
15
- expect(() => v.parse(DirectoryPathRelativeSchema, 123)).toThrow("directory.path.relative.type");
16
- });
17
- test("rejects empty", () => {
18
- expect(() => v.parse(DirectoryPathRelativeSchema, "")).toThrow("directory.path.relative.empty");
19
- });
20
- test("rejects too long", () => {
21
- expect(() => v.parse(DirectoryPathRelativeSchema, "a".repeat(513))).toThrow("directory.path.absolue.too.long");
22
- });
23
- test("rejects empty segment", () => {
24
- expect(() => v.parse(DirectoryPathRelativeSchema, "tmp//app///users")).toThrow("directory.path.relative.bad.segments");
25
- });
26
- test("rejects leading slash", () => {
27
- expect(() => v.parse(DirectoryPathRelativeSchema, "/users/avatars")).toThrow("directory.path.relative.leading.slash");
28
- });
29
- test("rejects trailing slash", () => {
30
- expect(() => v.parse(DirectoryPathRelativeSchema, "tmp/app/")).toThrow("directory.path.absolue.trailing.slash");
31
- });
32
- test("rejects backslash", () => {
33
- expect(() => v.parse(DirectoryPathRelativeSchema, "users\\avatars")).toThrow("directory.path.relative.bad.segments");
34
- });
35
- test("rejects control chars", () => {
36
- expect(() => v.parse(DirectoryPathRelativeSchema, "users\navatars")).toThrow("directory.path.relative.bad.segments");
37
- });
38
- test("rejects dot segment", () => {
39
- expect(() => v.parse(DirectoryPathRelativeSchema, "users/./avatars")).toThrow("directory.path.relative.bad.segments");
40
- });
41
- test("rejects double dot segment", () => {
42
- expect(() => v.parse(DirectoryPathRelativeSchema, "users/../avatars")).toThrow("directory.path.relative.bad.segments");
43
- });
44
- });
@@ -1 +0,0 @@
1
- export {};