@design-edito/tools 0.3.8 → 0.3.10

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 (327) hide show
  1. package/agnostic/arrays/index.d.ts +2 -2
  2. package/agnostic/arrays/index.js +2 -2
  3. package/agnostic/arrays/is-array-of/index.d.ts +1 -1
  4. package/agnostic/arrays/is-array-of/index.js +2 -2
  5. package/agnostic/booleans/is-falsy/index.d.ts +1 -1
  6. package/agnostic/colors/channels/index.d.ts +1 -1
  7. package/agnostic/colors/contrast/index.d.ts +1 -1
  8. package/agnostic/colors/convert/index.d.ts +1 -1
  9. package/agnostic/colors/convert/index.js +14 -17
  10. package/agnostic/colors/cssColorsMap.d.ts +9 -0
  11. package/agnostic/colors/distance/index.d.ts +1 -1
  12. package/agnostic/colors/index.d.ts +5 -5
  13. package/agnostic/colors/index.js +5 -5
  14. package/agnostic/colors/invert/index.d.ts +1 -1
  15. package/agnostic/colors/luminance/index.d.ts +1 -1
  16. package/agnostic/colors/palette/index.js +2 -0
  17. package/agnostic/colors/tidy/index.js +2 -1
  18. package/agnostic/colors/typechecks/index.d.ts +1 -1
  19. package/agnostic/colors/typechecks/index.js +1 -3
  20. package/agnostic/colors/types.d.ts +0 -7
  21. package/agnostic/colors/types.js +0 -154
  22. package/agnostic/css/bem/index.d.ts +3 -3
  23. package/agnostic/css/bem/index.js +6 -5
  24. package/agnostic/css/clss/index.d.ts +2 -1
  25. package/agnostic/css/clss/index.js +2 -2
  26. package/agnostic/css/generate-nice-color/index.js +1 -0
  27. package/agnostic/css/index.d.ts +3 -3
  28. package/agnostic/css/index.js +3 -3
  29. package/agnostic/css/styles-set/index.d.ts +4 -4
  30. package/agnostic/css/styles-set/index.js +1 -1
  31. package/agnostic/errors/register/index.js +4 -2
  32. package/agnostic/html/get-node-ancestors/index.js +1 -1
  33. package/agnostic/html/get-position-inside-parent/index.js +1 -1
  34. package/agnostic/html/hyper-json/cast/index.d.ts +1 -1
  35. package/agnostic/html/hyper-json/method/index.d.ts +2 -2
  36. package/agnostic/html/hyper-json/serialize/index.d.ts +1 -1
  37. package/agnostic/html/hyper-json/serialize/index.js +1 -1
  38. package/agnostic/html/hyper-json/smart-tags/coalesced/and/index.d.ts +1 -1
  39. package/agnostic/html/hyper-json/smart-tags/coalesced/append/index.d.ts +1 -1
  40. package/agnostic/html/hyper-json/smart-tags/coalesced/at/index.d.ts +1 -1
  41. package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.d.ts +1 -1
  42. package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.js +1 -1
  43. package/agnostic/html/hyper-json/smart-tags/coalesced/clone/index.d.ts +1 -1
  44. package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.d.ts +1 -1
  45. package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.js +5 -2
  46. package/agnostic/html/hyper-json/smart-tags/coalesced/equals/index.d.ts +1 -1
  47. package/agnostic/html/hyper-json/smart-tags/coalesced/getproperties/index.d.ts +1 -1
  48. package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.d.ts +1 -1
  49. package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.js +5 -2
  50. package/agnostic/html/hyper-json/smart-tags/coalesced/hjparse/index.d.ts +1 -1
  51. package/agnostic/html/hyper-json/smart-tags/coalesced/hjstringify/index.d.ts +1 -1
  52. package/agnostic/html/hyper-json/smart-tags/coalesced/if/index.d.ts +1 -1
  53. package/agnostic/html/hyper-json/smart-tags/coalesced/index.d.ts +21 -21
  54. package/agnostic/html/hyper-json/smart-tags/coalesced/index.js +21 -21
  55. package/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.d.ts +1 -1
  56. package/agnostic/html/hyper-json/smart-tags/coalesced/join/index.d.ts +1 -1
  57. package/agnostic/html/hyper-json/smart-tags/coalesced/length/index.d.ts +1 -1
  58. package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.d.ts +2 -2
  59. package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.js +1 -1
  60. package/agnostic/html/hyper-json/smart-tags/coalesced/or/index.d.ts +1 -1
  61. package/agnostic/html/hyper-json/smart-tags/coalesced/pickrandom/index.d.ts +1 -1
  62. package/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.d.ts +1 -1
  63. package/agnostic/html/hyper-json/smart-tags/coalesced/print/index.d.ts +1 -1
  64. package/agnostic/html/hyper-json/smart-tags/coalesced/push/index.d.ts +1 -1
  65. package/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.d.ts +2 -2
  66. package/agnostic/html/hyper-json/smart-tags/coalesced/recordtoarray/index.d.ts +1 -1
  67. package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.d.ts +2 -2
  68. package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.js +7 -4
  69. package/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.d.ts +1 -1
  70. package/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.d.ts +1 -1
  71. package/agnostic/html/hyper-json/smart-tags/coalesced/set/index.d.ts +1 -1
  72. package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.d.ts +2 -2
  73. package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.js +7 -4
  74. package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.d.ts +1 -1
  75. package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.js +9 -9
  76. package/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.d.ts +2 -2
  77. package/agnostic/html/hyper-json/smart-tags/coalesced/spread/index.d.ts +1 -1
  78. package/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.d.ts +1 -1
  79. package/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.d.ts +1 -1
  80. package/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.d.ts +1 -1
  81. package/agnostic/html/hyper-json/smart-tags/coalesced/tonodelist/index.d.ts +1 -1
  82. package/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.d.ts +1 -1
  83. package/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.d.ts +1 -1
  84. package/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.d.ts +1 -1
  85. package/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.d.ts +1 -1
  86. package/agnostic/html/hyper-json/smart-tags/coalesced/tostring/index.d.ts +1 -1
  87. package/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.d.ts +1 -1
  88. package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.d.ts +1 -1
  89. package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.js +0 -1
  90. package/agnostic/html/hyper-json/smart-tags/coalesced/trim/index.js +1 -1
  91. package/agnostic/html/hyper-json/smart-tags/index.d.ts +1 -1
  92. package/agnostic/html/hyper-json/smart-tags/isolated/any/index.d.ts +1 -1
  93. package/agnostic/html/hyper-json/smart-tags/isolated/array/index.d.ts +1 -1
  94. package/agnostic/html/hyper-json/smart-tags/isolated/get/index.d.ts +1 -1
  95. package/agnostic/html/hyper-json/smart-tags/isolated/global/index.d.ts +1 -1
  96. package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.d.ts +1 -1
  97. package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.js +1 -1
  98. package/agnostic/html/hyper-json/smart-tags/isolated/index.d.ts +5 -5
  99. package/agnostic/html/hyper-json/smart-tags/isolated/index.js +5 -5
  100. package/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.d.ts +1 -1
  101. package/agnostic/html/hyper-json/smart-tags/isolated/null/index.d.ts +1 -1
  102. package/agnostic/html/hyper-json/smart-tags/isolated/record/index.d.ts +1 -1
  103. package/agnostic/html/hyper-json/smart-tags/isolated/ref/index.d.ts +1 -1
  104. package/agnostic/html/hyper-json/smart-tags/isolated/text/index.js +3 -1
  105. package/agnostic/html/hyper-json/transformer/index.d.ts +2 -2
  106. package/agnostic/html/hyper-json/transformer/index.js +6 -9
  107. package/agnostic/html/hyper-json/tree/index.d.ts +1 -1
  108. package/agnostic/html/hyper-json/tree/index.js +14 -10
  109. package/agnostic/html/hyper-json/types/index.d.ts +9 -13
  110. package/agnostic/html/hyper-json/utils/index.d.ts +7 -7
  111. package/agnostic/html/hyper-json/utils/index.js +1 -1
  112. package/agnostic/html/index.d.ts +2 -2
  113. package/agnostic/html/index.js +2 -2
  114. package/agnostic/html/placeholders/index.d.ts +1 -1
  115. package/agnostic/html/selector-to-element/index.js +1 -1
  116. package/agnostic/index.d.ts +7 -7
  117. package/agnostic/index.js +7 -7
  118. package/agnostic/misc/assert/index.d.ts +2 -2
  119. package/agnostic/misc/assert/index.js +4 -4
  120. package/agnostic/misc/cast/index.d.ts +1 -1
  121. package/agnostic/misc/connection/index.js +0 -1
  122. package/agnostic/misc/crawler/index.d.ts +2 -2
  123. package/agnostic/misc/crossenv/detect-runtime/index.js +4 -4
  124. package/agnostic/misc/crossenv/window/index.d.ts +1 -1
  125. package/agnostic/misc/crossenv/window/index.js +2 -2
  126. package/agnostic/misc/data-size/index.js +2 -2
  127. package/agnostic/misc/index.d.ts +4 -4
  128. package/agnostic/misc/index.js +4 -4
  129. package/agnostic/misc/is-constructor-function/index.d.ts +1 -1
  130. package/agnostic/misc/logs/index.d.ts +1 -1
  131. package/agnostic/misc/logs/index.js +1 -1
  132. package/agnostic/misc/logs/logger/index.d.ts +3 -3
  133. package/agnostic/misc/outcome/index.d.ts +7 -7
  134. package/agnostic/numbers/approximate-rational/index.js +4 -2
  135. package/agnostic/numbers/index.d.ts +3 -3
  136. package/agnostic/numbers/index.js +3 -3
  137. package/agnostic/objects/deep-get-property/index.js +2 -2
  138. package/agnostic/objects/flatten-getters/index.js +2 -1
  139. package/agnostic/objects/index.d.ts +5 -4
  140. package/agnostic/objects/index.js +5 -4
  141. package/agnostic/objects/record-format/index.js +1 -0
  142. package/agnostic/objects/sort-keys/index.d.ts +11 -0
  143. package/agnostic/objects/sort-keys/index.js +12 -0
  144. package/agnostic/objects/sort-keys/index.test.d.ts +1 -0
  145. package/agnostic/optim/index.d.ts +1 -1
  146. package/agnostic/optim/index.js +1 -1
  147. package/agnostic/optim/memoize/index.js +1 -1
  148. package/agnostic/optim/throttle-debounce/index.d.ts +12 -10
  149. package/agnostic/optim/throttle-debounce/index.js +2 -2
  150. package/agnostic/optim/throttle-debounce/types.d.ts +1 -1
  151. package/agnostic/random/index.d.ts +2 -2
  152. package/agnostic/random/index.js +2 -2
  153. package/agnostic/random/random/index.js +1 -1
  154. package/agnostic/sanitization/html/index.js +7 -7
  155. package/agnostic/sanitization/index.d.ts +2 -2
  156. package/agnostic/sanitization/index.js +2 -2
  157. package/agnostic/sanitization/types.d.ts +2 -6
  158. package/agnostic/strings/char-codes/index.d.ts +5 -5
  159. package/agnostic/strings/char-codes/index.js +2 -2
  160. package/agnostic/strings/matches/index.d.ts +2 -2
  161. package/agnostic/time/dates/format-date/index.js +23 -9
  162. package/agnostic/time/duration/index.d.ts +23 -2
  163. package/agnostic/time/duration/index.js +36 -4
  164. package/agnostic/time/index.d.ts +2 -2
  165. package/agnostic/time/index.js +2 -2
  166. package/agnostic/time/timeout/index.js +2 -2
  167. package/agnostic/time/wait/index.d.ts +2 -2
  168. package/agnostic/time/wait/index.js +1 -1
  169. package/components/EventListener/index.d.ts +10 -0
  170. package/components/EventListener/index.js +47 -0
  171. package/components/EventListener/styles.module.css +0 -0
  172. package/components/Input/index.d.ts +7 -0
  173. package/components/Input/index.js +29 -0
  174. package/components/Input/styles.module.css +0 -0
  175. package/components/IntersectionObserver/index.d.ts +20 -0
  176. package/components/IntersectionObserver/index.js +79 -0
  177. package/components/IntersectionObserver/styles.module.css +0 -0
  178. package/components/index.d.ts +3 -1
  179. package/components/index.js +3 -1
  180. package/components/public-classnames.d.ts +3 -0
  181. package/index.d.ts +2 -2
  182. package/index.js +2 -2
  183. package/node/@aws-s3/storage/directory/copy-dir/index.d.ts +2 -2
  184. package/node/@aws-s3/storage/directory/copy-dir/index.js +3 -3
  185. package/node/@aws-s3/storage/directory/index.d.ts +1 -1
  186. package/node/@aws-s3/storage/directory/index.js +1 -1
  187. package/node/@aws-s3/storage/directory/list/index.d.ts +2 -2
  188. package/node/@aws-s3/storage/directory/list/index.js +1 -1
  189. package/node/@aws-s3/storage/directory/move-dir/index.d.ts +3 -3
  190. package/node/@aws-s3/storage/directory/move-dir/index.js +3 -3
  191. package/node/@aws-s3/storage/directory/remove-dir/index.d.ts +2 -2
  192. package/node/@aws-s3/storage/directory/remove-dir/index.js +4 -4
  193. package/node/@aws-s3/storage/file/copy/index.d.ts +1 -1
  194. package/node/@aws-s3/storage/file/download/index.d.ts +3 -3
  195. package/node/@aws-s3/storage/file/exists/index.d.ts +2 -2
  196. package/node/@aws-s3/storage/file/exists/index.js +1 -2
  197. package/node/@aws-s3/storage/file/index.d.ts +2 -2
  198. package/node/@aws-s3/storage/file/index.js +2 -2
  199. package/node/@aws-s3/storage/file/move/index.d.ts +2 -2
  200. package/node/@aws-s3/storage/file/remove/index.d.ts +1 -1
  201. package/node/@aws-s3/storage/file/stat/index.d.ts +1 -1
  202. package/node/@aws-s3/storage/file/upload/index.d.ts +2 -2
  203. package/node/@express/@multer/index.d.ts +1 -1
  204. package/node/@google-cloud/storage/bucket/get-metadata/index.d.ts +1 -1
  205. package/node/@google-cloud/storage/directory/copy-dir/index.d.ts +1 -1
  206. package/node/@google-cloud/storage/directory/index.d.ts +1 -1
  207. package/node/@google-cloud/storage/directory/index.js +1 -1
  208. package/node/@google-cloud/storage/directory/list/index.d.ts +1 -1
  209. package/node/@google-cloud/storage/directory/move-dir/index.d.ts +1 -1
  210. package/node/@google-cloud/storage/directory/remove-dir/index.d.ts +1 -1
  211. package/node/@google-cloud/storage/file/copy/index.d.ts +2 -2
  212. package/node/@google-cloud/storage/file/download/index.d.ts +2 -2
  213. package/node/@google-cloud/storage/file/exists/index.d.ts +1 -1
  214. package/node/@google-cloud/storage/file/generate-signed-url/index.d.ts +1 -1
  215. package/node/@google-cloud/storage/file/get-metadata/index.d.ts +1 -1
  216. package/node/@google-cloud/storage/file/get-permissions/index.d.ts +1 -1
  217. package/node/@google-cloud/storage/file/index.d.ts +4 -4
  218. package/node/@google-cloud/storage/file/index.js +4 -4
  219. package/node/@google-cloud/storage/file/move/index.d.ts +1 -1
  220. package/node/@google-cloud/storage/file/remove/index.d.ts +1 -1
  221. package/node/@google-cloud/storage/file/revoke-signed-urls/index.d.ts +4 -4
  222. package/node/@google-cloud/storage/file/stat/index.d.ts +1 -1
  223. package/node/@google-cloud/storage/file/stat/index.js +2 -2
  224. package/node/@google-cloud/storage/file/update-metadata/index.d.ts +1 -1
  225. package/node/@google-cloud/storage/file/upload/index.d.ts +2 -2
  226. package/node/@google-cloud/storage/index.d.ts +1 -1
  227. package/node/@google-cloud/storage/index.js +1 -1
  228. package/node/cloud-storage/operations/copy-dir/index.d.ts +8 -8
  229. package/node/cloud-storage/operations/copy-dir/index.js +4 -4
  230. package/node/cloud-storage/operations/copy-file/index.d.ts +8 -8
  231. package/node/cloud-storage/operations/copy-file/index.js +4 -4
  232. package/node/cloud-storage/operations/download-file/index.d.ts +9 -9
  233. package/node/cloud-storage/operations/download-file/index.js +4 -4
  234. package/node/cloud-storage/operations/exists-file/index.d.ts +6 -6
  235. package/node/cloud-storage/operations/exists-file/index.js +4 -4
  236. package/node/cloud-storage/operations/index.d.ts +4 -4
  237. package/node/cloud-storage/operations/index.js +4 -4
  238. package/node/cloud-storage/operations/list-dir/index.d.ts +6 -6
  239. package/node/cloud-storage/operations/list-dir/index.js +4 -4
  240. package/node/cloud-storage/operations/move-dir/index.d.ts +8 -8
  241. package/node/cloud-storage/operations/move-dir/index.js +4 -4
  242. package/node/cloud-storage/operations/move-file/index.d.ts +8 -8
  243. package/node/cloud-storage/operations/move-file/index.js +4 -4
  244. package/node/cloud-storage/operations/remove-dir/index.d.ts +8 -8
  245. package/node/cloud-storage/operations/remove-dir/index.js +4 -4
  246. package/node/cloud-storage/operations/remove-file/index.d.ts +8 -8
  247. package/node/cloud-storage/operations/remove-file/index.js +4 -4
  248. package/node/cloud-storage/operations/stat-file/index.d.ts +8 -8
  249. package/node/cloud-storage/operations/stat-file/index.js +4 -4
  250. package/node/cloud-storage/operations/upload-file/index.d.ts +9 -9
  251. package/node/cloud-storage/operations/upload-file/index.js +4 -4
  252. package/node/files/read-write/index.js +1 -1
  253. package/node/files/subpaths/index.d.ts +3 -3
  254. package/node/files/subpaths/index.js +6 -6
  255. package/node/ftps/directory/copy-dir/index.d.ts +1 -1
  256. package/node/ftps/directory/copy-dir/index.js +1 -1
  257. package/node/ftps/directory/list/index.d.ts +1 -1
  258. package/node/ftps/directory/move-dir/index.d.ts +1 -1
  259. package/node/ftps/directory/move-dir/index.js +1 -3
  260. package/node/ftps/directory/remove-dir/index.d.ts +2 -2
  261. package/node/ftps/file/copy/index.d.ts +1 -1
  262. package/node/ftps/file/copy/index.js +1 -1
  263. package/node/ftps/file/download/index.d.ts +2 -2
  264. package/node/ftps/file/exists/index.d.ts +2 -2
  265. package/node/ftps/file/exists/index.js +1 -1
  266. package/node/ftps/file/index.d.ts +3 -3
  267. package/node/ftps/file/index.js +3 -3
  268. package/node/ftps/file/move/index.d.ts +3 -3
  269. package/node/ftps/file/move/index.js +1 -1
  270. package/node/ftps/file/remove/index.d.ts +1 -1
  271. package/node/ftps/file/stat/index.d.ts +1 -1
  272. package/node/ftps/file/stat/index.js +2 -2
  273. package/node/ftps/file/upload/index.d.ts +2 -2
  274. package/node/images/format/index.d.ts +1 -1
  275. package/node/images/format/index.js +9 -9
  276. package/node/images/index.d.ts +2 -2
  277. package/node/images/index.js +2 -2
  278. package/node/images/metadata/index.d.ts +1 -1
  279. package/node/images/metadata/index.js +1 -1
  280. package/node/images/transform/index.d.ts +2 -2
  281. package/node/images/transform/index.js +26 -21
  282. package/node/images/transform/operations/blur/index.d.ts +1 -1
  283. package/node/images/transform/operations/brighten/index.d.ts +1 -1
  284. package/node/images/transform/operations/extend/index.d.ts +1 -1
  285. package/node/images/transform/operations/extract/index.d.ts +1 -1
  286. package/node/images/transform/operations/flatten/index.d.ts +1 -1
  287. package/node/images/transform/operations/flatten/index.js +1 -1
  288. package/node/images/transform/operations/flip/index.d.ts +1 -1
  289. package/node/images/transform/operations/flop/index.d.ts +1 -1
  290. package/node/images/transform/operations/hue/index.d.ts +1 -1
  291. package/node/images/transform/operations/index.d.ts +5 -5
  292. package/node/images/transform/operations/index.js +5 -5
  293. package/node/images/transform/operations/level/index.d.ts +1 -1
  294. package/node/images/transform/operations/lighten/index.d.ts +1 -1
  295. package/node/images/transform/operations/normalize/index.d.ts +1 -1
  296. package/node/images/transform/operations/overlay/index.js +1 -1
  297. package/node/images/transform/operations/resize/index.d.ts +1 -1
  298. package/node/images/transform/operations/rotate/index.d.ts +1 -1
  299. package/node/images/transform/operations/saturate/index.d.ts +1 -1
  300. package/node/index.d.ts +5 -5
  301. package/node/index.js +5 -5
  302. package/node/process/prompt-continue/index.js +1 -1
  303. package/node/process/spawner/index.d.ts +1 -9
  304. package/node/process/spawner/index.js +10 -8
  305. package/node/sftp/directory/copy-dir/index.d.ts +2 -1
  306. package/node/sftp/directory/copy-dir/index.js +2 -2
  307. package/node/sftp/directory/list/index.d.ts +1 -1
  308. package/node/sftp/directory/move-dir/index.d.ts +1 -1
  309. package/node/sftp/directory/move-dir/index.js +2 -4
  310. package/node/sftp/directory/remove-dir/index.d.ts +2 -2
  311. package/node/sftp/file/copy/index.d.ts +2 -1
  312. package/node/sftp/file/copy/index.js +2 -2
  313. package/node/sftp/file/download/index.d.ts +3 -3
  314. package/node/sftp/file/exists/index.d.ts +1 -1
  315. package/node/sftp/file/index.d.ts +3 -3
  316. package/node/sftp/file/index.js +3 -3
  317. package/node/sftp/file/move/index.d.ts +3 -3
  318. package/node/sftp/file/move/index.js +3 -5
  319. package/node/sftp/file/remove/index.d.ts +1 -1
  320. package/node/sftp/file/remove/index.js +1 -1
  321. package/node/sftp/file/stat/index.d.ts +1 -1
  322. package/node/sftp/file/stat/index.js +1 -1
  323. package/node/sftp/file/upload/index.d.ts +3 -2
  324. package/node/sftp/file/upload/index.js +1 -1
  325. package/package.json +1260 -26
  326. package/components/Comp/index.d.ts +0 -1
  327. package/components/Comp/index.js +0 -8
@@ -1,4 +1,4 @@
1
- import { MinimalWindow } from '../types.js';
1
+ import { type MinimalWindow } from '../types.js';
2
2
  /**
3
3
  * Checks whether a `window` object exists in the current environment.
4
4
  *
@@ -2,14 +2,14 @@
2
2
  function exists() {
3
3
  return typeof globalThis !== "undefined" && "window" in globalThis;
4
4
  }
5
- var _window = exists() ? globalThis["window"] ?? null : null;
5
+ var _window = exists() ? globalThis.window ?? null : null;
6
6
  function set(customWindow) {
7
7
  _window = customWindow;
8
8
  return customWindow;
9
9
  }
10
10
  function unset() {
11
11
  if (exists()) {
12
- _window = globalThis["window"];
12
+ _window = globalThis.window;
13
13
  } else {
14
14
  _window = null;
15
15
  }
@@ -67,7 +67,7 @@ var DataSize = class {
67
67
  if (this.unit === "exbibyte") return this.value * 8 * Math.pow(1024, 6);
68
68
  return this.value;
69
69
  }
70
- /* * * * * * * * * * * * * * * * * *
70
+ /* * * * * * * * * * * * * * * * * *
71
71
  * Decimal unit converters
72
72
  * * * * * * * * * * * * * * * * * */
73
73
  toBytes() {
@@ -98,7 +98,7 @@ var DataSize = class {
98
98
  return this.toBytes() / 1e18;
99
99
  }
100
100
  toEB = this.toExabytes.bind(this);
101
- /* * * * * * * * * * * * * * * * * *
101
+ /* * * * * * * * * * * * * * * * * *
102
102
  * Binary unit converters
103
103
  * * * * * * * * * * * * * * * * * */
104
104
  toKibibytes() {
@@ -1,12 +1,12 @@
1
1
  export * as assert from './assert/index.js'
2
+ export * as cast from './cast/index.js'
2
3
  export * as connection from './connection/index.js'
3
- export * as crossenv from './crossenv/index.js'
4
+ export * as crawler from './crawler/index.js'
4
5
  export * as dataSize from './data-size/index.js'
5
6
  export * as isConstructorFunction from './is-constructor-function/index.js'
6
- export * as cast from './cast/index.js'
7
+ export * as crossenv from './crossenv/index.js'
7
8
  export * as isNullish from './is-nullish/index.js'
8
9
  export * as logs from './logs/index.js'
10
+ export * as outcome from './outcome/index.js'
9
11
  export * as loremIpsum from './lorem-ipsum/index.js'
10
12
  export * as normalizeExtension from './normalize-extension/index.js'
11
- export * as crawler from './crawler/index.js'
12
- export * as outcome from './outcome/index.js'
@@ -1,12 +1,12 @@
1
1
  export * as assert from './assert/index.js'
2
+ export * as cast from './cast/index.js'
2
3
  export * as connection from './connection/index.js'
3
- export * as crossenv from './crossenv/index.js'
4
+ export * as crawler from './crawler/index.js'
4
5
  export * as dataSize from './data-size/index.js'
5
6
  export * as isConstructorFunction from './is-constructor-function/index.js'
6
- export * as cast from './cast/index.js'
7
+ export * as crossenv from './crossenv/index.js'
7
8
  export * as isNullish from './is-nullish/index.js'
8
9
  export * as logs from './logs/index.js'
10
+ export * as outcome from './outcome/index.js'
9
11
  export * as loremIpsum from './lorem-ipsum/index.js'
10
12
  export * as normalizeExtension from './normalize-extension/index.js'
11
- export * as crawler from './crawler/index.js'
12
- export * as outcome from './outcome/index.js'
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @template T - The type of object constructed by the function.
5
5
  */
6
- export type ConstructorFunction<T extends any = any> = new (...args: any[]) => T;
6
+ export type ConstructorFunction<T = any> = new (...args: any[]) => T;
7
7
  /**
8
8
  * Checks whether a given value is a constructor function (i.e., a class or function with a prototype).
9
9
  *
@@ -1,3 +1,3 @@
1
1
  export * as logger from './logger/index.js'
2
- export * as makeTextBlock from './make-text-block/index.js'
3
2
  export * as styles from './styles/index.js'
3
+ export * as makeTextBlock from './make-text-block/index.js'
@@ -1,3 +1,3 @@
1
1
  export * as logger from './logger/index.js'
2
- export * as makeTextBlock from './make-text-block/index.js'
3
2
  export * as styles from './styles/index.js'
3
+ export * as makeTextBlock from './make-text-block/index.js'
@@ -29,14 +29,14 @@ declare class Log<T extends ConsoleMethod = ConsoleMethod> {
29
29
  get displayStack(): string;
30
30
  }
31
31
  export declare class Logger {
32
- _private_threads: Map<string, Log[]>;
32
+ _private_threads: Map<string, Log<ConsoleMethod>[]>;
33
33
  constructor();
34
- dir(thread: string | undefined, ...args: ConsoleMethodsParams['dir']): void;
34
+ dir(thread?: string, ...args: ConsoleMethodsParams['dir']): void;
35
35
  error(thread?: string, ...args: ConsoleMethodsParams['error']): void;
36
36
  group(thread?: string, ...args: ConsoleMethodsParams['group']): void;
37
37
  groupEnd(thread?: string, ...args: ConsoleMethodsParams['groupEnd']): void;
38
38
  log(thread?: string, ...args: ConsoleMethodsParams['log']): void;
39
- table(thread: string | undefined, ...args: ConsoleMethodsParams['table']): void;
39
+ table(thread?: string, ...args: ConsoleMethodsParams['table']): void;
40
40
  warn(thread?: string, ...args: ConsoleMethodsParams['warn']): void;
41
41
  setLog<T extends ConsoleMethod>(threadName: string, type: T, data: ConsoleMethodsParams[T]): this;
42
42
  print(this: Logger, threadFilter?: string, withStack?: boolean): void;
@@ -5,7 +5,7 @@
5
5
  * @property {true} success - Always `true`.
6
6
  * @property {Payload} payload - The success value.
7
7
  */
8
- export type Success<Payload extends any = any> = {
8
+ export type Success<Payload = any> = {
9
9
  success: true;
10
10
  payload: Payload;
11
11
  };
@@ -16,7 +16,7 @@ export type Success<Payload extends any = any> = {
16
16
  * @property {false} success - Always `false`.
17
17
  * @property {Error} error - The error value.
18
18
  */
19
- export type Failure<Error extends any = any> = {
19
+ export type Failure<Error = any> = {
20
20
  success: false;
21
21
  error: Error;
22
22
  };
@@ -26,7 +26,7 @@ export type Failure<Error extends any = any> = {
26
26
  * @template Payload - Type of success payload.
27
27
  * @template Error - Type of error.
28
28
  */
29
- export type Either<Payload extends any = any, Error extends any = any> = Success<Payload> | Failure<Error>;
29
+ export type Either<Payload = any, Error = any> = Success<Payload> | Failure<Error>;
30
30
  /**
31
31
  * Creates a success outcome with the given payload.
32
32
  *
@@ -34,7 +34,7 @@ export type Either<Payload extends any = any, Error extends any = any> = Success
34
34
  * @param {Payload} payload - The success value.
35
35
  * @returns {Success<Payload>} A success outcome object.
36
36
  */
37
- export declare function makeSuccess<Payload extends any>(payload: Payload): Success<Payload>;
37
+ export declare function makeSuccess<Payload>(payload: Payload): Success<Payload>;
38
38
  /**
39
39
  * Creates a failure outcome with the given error.
40
40
  *
@@ -42,7 +42,7 @@ export declare function makeSuccess<Payload extends any>(payload: Payload): Succ
42
42
  * @param {Error} error - The error value.
43
43
  * @returns {Failure<Error>} A failure outcome object.
44
44
  */
45
- export declare function makeFailure<Error extends any>(error: Error): Failure<Error>;
45
+ export declare function makeFailure<Error>(error: Error): Failure<Error>;
46
46
  /**
47
47
  * Creates either a success or failure outcome based on a boolean flag.
48
48
  *
@@ -52,5 +52,5 @@ export declare function makeFailure<Error extends any>(error: Error): Failure<Er
52
52
  * @param {Payload | Error} payloadOrError - The payload if success, or the error if failure.
53
53
  * @returns {Either<Payload, Error>} The resulting outcome.
54
54
  */
55
- export declare function make<Payload extends any>(success: true, payload: Payload): Success<Payload>;
56
- export declare function make<Error extends any>(success: false, error: Error): Failure<Error>;
55
+ export declare function make<Payload>(success: true, payload: Payload): Success<Payload>;
56
+ export declare function make<Error>(success: false, error: Error): Failure<Error>;
@@ -44,8 +44,10 @@ function approximateRationalDumb(target, maxRounds) {
44
44
  function approximateRational(target, maxDenominator = 1e3) {
45
45
  const sign = target < 0 ? -1 : 1;
46
46
  const absTarget = Math.abs(target);
47
- let h1 = 1, h2 = 0;
48
- let k1 = 0, k2 = 1;
47
+ let h1 = 1;
48
+ let h2 = 0;
49
+ let k1 = 0;
50
+ let k2 = 1;
49
51
  let b = absTarget;
50
52
  do {
51
53
  const a = Math.floor(b);
@@ -1,6 +1,6 @@
1
- export * as absoluteModulo from './absolute-modulo/index.js'
2
1
  export * as approximateRational from './approximate-rational/index.js'
3
- export * as geometricProgressions from './geometric-progressions/index.js'
2
+ export * as clamp from './clamp/index.js'
3
+ export * as absoluteModulo from './absolute-modulo/index.js'
4
4
  export * as interpolate from './interpolate/index.js'
5
+ export * as geometricProgressions from './geometric-progressions/index.js'
5
6
  export * as round from './round/index.js'
6
- export * as clamp from './clamp/index.js'
@@ -1,6 +1,6 @@
1
- export * as absoluteModulo from './absolute-modulo/index.js'
2
1
  export * as approximateRational from './approximate-rational/index.js'
3
- export * as geometricProgressions from './geometric-progressions/index.js'
2
+ export * as clamp from './clamp/index.js'
3
+ export * as absoluteModulo from './absolute-modulo/index.js'
4
4
  export * as interpolate from './interpolate/index.js'
5
+ export * as geometricProgressions from './geometric-progressions/index.js'
5
6
  export * as round from './round/index.js'
6
- export * as clamp from './clamp/index.js'
@@ -6,14 +6,14 @@ function deepGetProperty(anythingThatHasProperties, pathString) {
6
6
  let returned = currentObject;
7
7
  pathChunks.forEach((chunk, pos) => {
8
8
  const isLast = pos === pathChunks.length - 1;
9
- if (!isRecord(currentObject)) throw "PROPERTY_UNREACHABLE";
9
+ if (!isRecord(currentObject)) throw new Error("PROPERTY_UNREACHABLE");
10
10
  if (isLast) {
11
11
  const val = currentObject[chunk];
12
12
  returned = val;
13
13
  } else {
14
14
  const found = currentObject[chunk];
15
15
  if (isRecord(found)) currentObject = found;
16
- else throw "PROPERTY_UNREACHABLE";
16
+ else throw new Error("PROPERTY_UNREACHABLE");
17
17
  }
18
18
  });
19
19
  return returned;
@@ -5,7 +5,8 @@ function flattenGetters(obj) {
5
5
  ).filter(([_, desc]) => typeof desc.get === "function").map(([key]) => key);
6
6
  const returned = { ...obj };
7
7
  getters.forEach((getter) => {
8
- returned[getter] = obj[getter];
8
+ const key = getter;
9
+ returned[getter] = obj[key];
9
10
  });
10
11
  return returned;
11
12
  }
@@ -1,8 +1,9 @@
1
- export * as deepGetProperty from './deep-get-property/index.js'
2
- export * as isObject from './is-object/index.js'
3
1
  export * as enums from './enums/index.js'
4
- export * as isRecord from './is-record/index.js'
5
2
  export * as flattenGetters from './flatten-getters/index.js'
3
+ export * as isObject from './is-object/index.js'
4
+ export * as isRecord from './is-record/index.js'
5
+ export * as deepGetProperty from './deep-get-property/index.js'
6
+ export * as recordMap from './record-map/index.js'
7
+ export * as sortKeys from './sort-keys/index.js'
6
8
  export * as recordFormat from './record-format/index.js'
7
9
  export * as validation from './validation/index.js'
8
- export * as recordMap from './record-map/index.js'
@@ -1,8 +1,9 @@
1
- export * as deepGetProperty from './deep-get-property/index.js'
2
- export * as isObject from './is-object/index.js'
3
1
  export * as enums from './enums/index.js'
4
- export * as isRecord from './is-record/index.js'
5
2
  export * as flattenGetters from './flatten-getters/index.js'
3
+ export * as isObject from './is-object/index.js'
4
+ export * as isRecord from './is-record/index.js'
5
+ export * as deepGetProperty from './deep-get-property/index.js'
6
+ export * as recordMap from './record-map/index.js'
7
+ export * as sortKeys from './sort-keys/index.js'
6
8
  export * as recordFormat from './record-format/index.js'
7
9
  export * as validation from './validation/index.js'
8
- export * as recordMap from './record-map/index.js'
@@ -3,6 +3,7 @@ async function recordFormat(input, format) {
3
3
  const result = {};
4
4
  for (const key in format) {
5
5
  const formatter = format[key];
6
+ if (formatter === void 0) continue;
6
7
  result[key] = await formatter(input[key]);
7
8
  }
8
9
  return result;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Returns a new object with the keys sorted according to the provided sorter.
3
+ *
4
+ * @template T - The type of the input object.
5
+ * @param {T} obj - The object whose keys should be sorted.
6
+ * @param {(a: keyof T, b: keyof T) => number} [sorter] - Optional function used to compare keys for sorting. Defaults to alphabetical order.
7
+ * @returns {{ [K in keyof T]: T[K] }} A new object with the same keys and values as the input, but sorted by key.
8
+ */
9
+ export declare function sortKeys<T extends Record<string, unknown>>(obj: T, sorter?: (a: keyof T, b: keyof T) => number): {
10
+ [K in keyof T]: T[K];
11
+ };
@@ -0,0 +1,12 @@
1
+ // src/agnostic/objects/sort-keys/index.ts
2
+ function sortKeys(obj, sorter = (a, b) => String(a).localeCompare(String(b))) {
3
+ const out = {};
4
+ const keys = Object.keys(obj);
5
+ for (const key of keys.sort(sorter)) {
6
+ out[key] = obj[key];
7
+ }
8
+ return out;
9
+ }
10
+ export {
11
+ sortKeys
12
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,2 @@
1
- export * as throttleDebounce from './throttle-debounce/index.js'
2
1
  export * as memoize from './memoize/index.js'
2
+ export * as throttleDebounce from './throttle-debounce/index.js'
@@ -1,2 +1,2 @@
1
- export * as throttleDebounce from './throttle-debounce/index.js'
2
1
  export * as memoize from './memoize/index.js'
2
+ export * as throttleDebounce from './throttle-debounce/index.js'
@@ -3,7 +3,7 @@ function memoize(toMemoizeFunc) {
3
3
  let cachedArgs;
4
4
  let cachedResult;
5
5
  const memoizedFunc = (...args) => {
6
- const argsMatch = cachedArgs !== void 0 && args.length === cachedArgs.length && args.every((arg, i) => arg === cachedArgs[i]);
6
+ const argsMatch = cachedArgs !== void 0 && args.length === cachedArgs.length && args.every((arg, i) => arg === cachedArgs?.[i]);
7
7
  if (argsMatch && cachedResult !== void 0) return cachedResult.value;
8
8
  const result = toMemoizeFunc(...args);
9
9
  cachedArgs = args;
@@ -1,10 +1,5 @@
1
1
  type BasicFunction = (...args: any[]) => any;
2
- /**
3
- * Returns a throttled version of the function passed as an argument
4
- * @param toThrottleFunc - The function that has to be throttled
5
- * @param delayMs - The throttle delay in ms
6
- */
7
- export declare function throttle<T extends BasicFunction = BasicFunction>(toThrottleFunc: T, delayMs: number): {
2
+ type ThrottledResult<T extends BasicFunction> = {
8
3
  throttled: (...args: any[]) => {
9
4
  returnValue: ReturnType<T> | undefined;
10
5
  lastExecutedOn: number;
@@ -14,11 +9,12 @@ export declare function throttle<T extends BasicFunction = BasicFunction>(toThro
14
9
  setDelay: (delayMs: number) => void;
15
10
  };
16
11
  /**
17
- * Returns a debounced version of the function passed as an argument
18
- * @param toDebounceFunc - The function that has to be debounced
19
- * @param delayMs - The debounce delay in ms
12
+ * Returns a throttled version of the function passed as an argument
13
+ * @param toThrottleFunc - The function that has to be throttled
14
+ * @param delayMs - The throttle delay in ms
20
15
  */
21
- export declare function debounce<T extends BasicFunction = BasicFunction>(toDebounceFunc: T, delayMs: number): {
16
+ export declare function throttle<T extends BasicFunction = BasicFunction>(toThrottleFunc: T, delayMs: number): ThrottledResult<T>;
17
+ type DebounceResult<T extends BasicFunction> = {
22
18
  debounced: (...args: any[]) => {
23
19
  returnValue: ReturnType<T> | undefined;
24
20
  lastExecutedOn: number;
@@ -27,4 +23,10 @@ export declare function debounce<T extends BasicFunction = BasicFunction>(toDebo
27
23
  };
28
24
  setDelay: (delayMs: number) => void;
29
25
  };
26
+ /**
27
+ * Returns a debounced version of the function passed as an argument
28
+ * @param toDebounceFunc - The function that has to be debounced
29
+ * @param delayMs - The debounce delay in ms
30
+ */
31
+ export declare function debounce<T extends BasicFunction = BasicFunction>(toDebounceFunc: T, delayMs: number): DebounceResult<T>;
30
32
  export {};
@@ -3,7 +3,7 @@ function throttle(toThrottleFunc, delayMs) {
3
3
  let currentDelayMs = delayMs;
4
4
  let lastArgs = [];
5
5
  let lastExecutedOn = 0;
6
- let lastReturnValue = void 0;
6
+ let lastReturnValue;
7
7
  let nextExecutionTimeout = null;
8
8
  function scheduleNextCall() {
9
9
  if (nextExecutionTimeout !== null) {
@@ -56,7 +56,7 @@ function debounce(toDebounceFunc, delayMs) {
56
56
  let lastArgs = [];
57
57
  let lastCalledOn = 0;
58
58
  let lastExecutedOn = 0;
59
- let lastReturnValue = void 0;
59
+ let lastReturnValue;
60
60
  let nextExecutionTimeout = null;
61
61
  function scheduleNextCall() {
62
62
  if (nextExecutionTimeout !== null) {
@@ -1,2 +1,2 @@
1
- import { setTimeout } from 'node:timers';
1
+ import { type setTimeout } from 'node:timers';
2
2
  export type NodeTimeout = ReturnType<typeof setTimeout>;
@@ -1,3 +1,3 @@
1
- export * as uuid from './uuid/index.js'
2
- export * as random from './random/index.js'
3
1
  export * as hexChar from './hex-char/index.js'
2
+ export * as random from './random/index.js'
3
+ export * as uuid from './uuid/index.js'
@@ -1,3 +1,3 @@
1
- export * as uuid from './uuid/index.js'
2
- export * as random from './random/index.js'
3
1
  export * as hexChar from './hex-char/index.js'
2
+ export * as random from './random/index.js'
3
+ export * as uuid from './uuid/index.js'
@@ -1,7 +1,7 @@
1
1
  // src/agnostic/random/random/index.ts
2
2
  function random(bound1 = 1, bound2) {
3
3
  const min = bound2 === void 0 ? 0 : bound1;
4
- const max = bound2 === void 0 ? bound1 : bound2;
4
+ const max = bound2 ?? bound1;
5
5
  if (min === max || min > max) return void 0;
6
6
  const range = max - min;
7
7
  return Math.random() * range + min;
@@ -27,12 +27,12 @@ function sanitizeElement(element, options = defaultOptions) {
27
27
  const normalizedTagName = tagName.toLowerCase().trim();
28
28
  const tagIsInForbidden = forbiddenTags.includes("*") || forbiddenTags.includes(normalizedTagName);
29
29
  if (tagIsInForbidden) {
30
- if (verbose === true) console.warn(tagName, "tag is forbidden");
30
+ if (verbose) console.warn(tagName, "tag is forbidden");
31
31
  return null;
32
32
  }
33
33
  const tagIsInAllowed = allowedTags.includes("*") || allowedTags.includes(normalizedTagName);
34
34
  if (!tagIsInAllowed) {
35
- if (verbose === true) console.warn(tagName, "tag is not allowed");
35
+ if (verbose) console.warn(tagName, "tag is not allowed");
36
36
  return null;
37
37
  }
38
38
  const returnedElement = Window.get().document.createElement(tagName);
@@ -47,20 +47,20 @@ function sanitizeElement(element, options = defaultOptions) {
47
47
  if (typeof nameTester === "string" && nameTester !== "*" && attributeName !== nameTester) return false;
48
48
  if (typeof nameTester !== "string" && !nameTester.test(attributeName)) return false;
49
49
  if (valTesters === void 0) {
50
- if (verbose === true) console.warn(attributeName, "attribute on", tagName, "tag is forbidden");
50
+ if (verbose) console.warn(attributeName, "attribute on", tagName, "tag is forbidden");
51
51
  return true;
52
52
  }
53
53
  if (valTesters.includes("*")) {
54
- if (verbose === true) console.warn(attributeName, "attribute on", tagName, "tag is forbidden");
54
+ if (verbose) console.warn(attributeName, "attribute on", tagName, "tag is forbidden");
55
55
  return true;
56
56
  }
57
57
  return valTesters.some((valTester) => {
58
58
  if (typeof valTester === "string" && attributeValue === valTester) {
59
- if (verbose === true) console.warn(attributeValue, "value for", attributeName, "attribute on", tagName, "tag is forbidden. Rule:", valTester);
59
+ if (verbose) console.warn(attributeValue, "value for", attributeName, "attribute on", tagName, "tag is forbidden. Rule:", valTester);
60
60
  return true;
61
61
  }
62
62
  if (typeof valTester !== "string" && valTester.test(attributeValue)) {
63
- if (verbose === true) console.warn(attributeValue, "value for", attributeName, "attribute on", tagName, "tag is forbidden. Rule:", valTester);
63
+ if (verbose) console.warn(attributeValue, "value for", attributeName, "attribute on", tagName, "tag is forbidden. Rule:", valTester);
64
64
  return true;
65
65
  }
66
66
  return false;
@@ -93,7 +93,7 @@ function sanitizeElement(element, options = defaultOptions) {
93
93
  });
94
94
  });
95
95
  if (!isInAllowed) {
96
- if (verbose === true) console.warn(...latestNotAllowedReason);
96
+ if (verbose) console.warn(...latestNotAllowedReason);
97
97
  return false;
98
98
  }
99
99
  return true;
@@ -1,4 +1,4 @@
1
- export * as fileName from './file-name/index.js'
2
1
  export * as path from './path/index.js'
3
- export * as userInput from './user-input/index.js'
4
2
  export * as html from './html/index.js'
3
+ export * as fileName from './file-name/index.js'
4
+ export * as userInput from './user-input/index.js'
@@ -1,4 +1,4 @@
1
- export * as fileName from './file-name/index.js'
2
1
  export * as path from './path/index.js'
3
- export * as userInput from './user-input/index.js'
4
2
  export * as html from './html/index.js'
3
+ export * as fileName from './file-name/index.js'
4
+ export * as userInput from './user-input/index.js'
@@ -26,12 +26,8 @@ export type SanitizeHtmlOptions = {
26
26
  keepComments?: boolean;
27
27
  allowedTags?: string[];
28
28
  forbiddenTags?: string[];
29
- allowedAttributes?: {
30
- [tagName: string]: AttributeNameValPair[];
31
- };
32
- forbiddenAttributes?: {
33
- [tagName: string]: AttributeNameValPair[];
34
- };
29
+ allowedAttributes?: Record<string, AttributeNameValPair[]>;
30
+ forbiddenAttributes?: Record<string, AttributeNameValPair[]>;
35
31
  depth?: number;
36
32
  verbose?: boolean;
37
33
  };
@@ -43,25 +43,25 @@ export declare function charFromB36CharCode(b36CharCode: B36CharCode): string;
43
43
  * @param string - Input string.
44
44
  * @returns Array of character codes.
45
45
  */
46
- export declare function toCharCodes(string: string): Array<CharCode>;
46
+ export declare function toCharCodes(string: string): CharCode[];
47
47
  /**
48
48
  * Converts a string into an array of base-36 encoded character codes.
49
49
  * @param string - Input string.
50
50
  * @returns Array of base-36 character codes.
51
51
  */
52
- export declare function toB36CharCodes(string: string): Array<B36CharCode>;
52
+ export declare function toB36CharCodes(string: string): B36CharCode[];
53
53
  /**
54
54
  * Converts an array of Unicode character codes back to a string.
55
55
  * @param charCodes - Array of character codes.
56
56
  * @returns Reconstructed string.
57
57
  */
58
- export declare function fromCharCodes(charCodes: Array<CharCode>): string;
58
+ export declare function fromCharCodes(charCodes: CharCode[]): string;
59
59
  /**
60
60
  * Converts an array of base-36 encoded character codes back to a string.
61
61
  * @param b36CharCodes - Array of base-36 character codes.
62
62
  * @returns Reconstructed string.
63
63
  */
64
- export declare function fromB36CharCodes(b36CharCodes: Array<B36CharCode>): string;
64
+ export declare function fromB36CharCodes(b36CharCodes: B36CharCode[]): string;
65
65
  /**
66
66
  * Serializes an array of character codes (Unicode or base-36) into a string.
67
67
  * @param charCodes - Array of character codes to serialize.
@@ -73,7 +73,7 @@ export declare function serialize(charCodes: Array<CharCode | B36CharCode>): str
73
73
  * @param serializedCharCodes - Serialized string.
74
74
  * @returns Array of Unicode character codes.
75
75
  */
76
- export declare function deserialize(serializedCharCodes: string): Array<CharCode>;
76
+ export declare function deserialize(serializedCharCodes: string): CharCode[];
77
77
  /**
78
78
  * Deserializes a string of base-36 character codes and reconstructs the original string.
79
79
  * @param serializedCharCodes - Serialized string.
@@ -35,10 +35,10 @@ function toB36CharCodes(string) {
35
35
  return chars.map(charToB36CharCode);
36
36
  }
37
37
  function fromCharCodes(charCodes) {
38
- return charCodes.map(charFromCharCode).map((char) => char === null ? "\0" : char).join("");
38
+ return charCodes.map(charFromCharCode).map((char) => char ?? "\0").join("");
39
39
  }
40
40
  function fromB36CharCodes(b36CharCodes) {
41
- return b36CharCodes.map(charFromB36CharCode).map((char) => char === null ? "\0" : char).join("");
41
+ return b36CharCodes.map(charFromB36CharCode).map((char) => char ?? "\0").join("");
42
42
  }
43
43
  function serialize(charCodes) {
44
44
  return charCodes.map((c) => typeof c === "string" ? c : charCodeToB36(c)).join(",");
@@ -17,7 +17,7 @@ export declare function matches(input: string, matcher: Matcher): boolean;
17
17
  * @param matchers - A matcher or array of matchers.
18
18
  * @returns `true` if the input matches at least one matcher, otherwise `false`.
19
19
  */
20
- export declare function matchesSome(input: string, matchers: Matcher | Array<Matcher>): boolean;
20
+ export declare function matchesSome(input: string, matchers: Matcher | Matcher[]): boolean;
21
21
  /**
22
22
  * Checks whether a string matches every matcher in a list (or a single matcher).
23
23
  *
@@ -25,4 +25,4 @@ export declare function matchesSome(input: string, matchers: Matcher | Array<Mat
25
25
  * @param matchers - A matcher or array of matchers.
26
26
  * @returns `true` if the input matches all matchers, otherwise `false`.
27
27
  */
28
- export declare function matchesEvery(input: string, matchers: Matcher | Array<Matcher>): boolean;
28
+ export declare function matchesEvery(input: string, matchers: Matcher | Matcher[]): boolean;
@@ -1,8 +1,6 @@
1
1
  // src/agnostic/time/dates/format-date/index.ts
2
2
  function formatDate(date, format, locale = "en") {
3
- try {
4
- new Intl.DateTimeFormat(locale);
5
- } catch {
3
+ if (Intl.DateTimeFormat.supportedLocalesOf(locale).length === 0) {
6
4
  locale = "en";
7
5
  }
8
6
  const day = date.getDate();
@@ -13,23 +11,39 @@ function formatDate(date, format, locale = "en") {
13
11
  const minutes = date.getMinutes();
14
12
  const seconds = date.getSeconds();
15
13
  const isPM = hours >= 12;
16
- const shortDateNames = [...Array(7)].map((_, i) => new Intl.DateTimeFormat(locale, { weekday: "short" }).format(new Date(2023, 0, i + 1)));
17
- const dateNames = [...Array(7)].map((_, i) => new Intl.DateTimeFormat(locale, { weekday: "long" }).format(new Date(2023, 0, i + 1)));
18
- const shortMonthNames = [...Array(12)].map((_, i) => new Intl.DateTimeFormat(locale, { month: "short" }).format(new Date(2023, i, 1)));
19
- const monthNames = [...Array(12)].map((_, i) => new Intl.DateTimeFormat(locale, { month: "long" }).format(new Date(2023, i, 1)));
14
+ const shortDateNames = [...Array(7)].map((_, i) => new Intl.DateTimeFormat(
15
+ locale,
16
+ { weekday: "short" }
17
+ ).format(new Date(2023, 0, i + 1)));
18
+ const dateNames = [...Array(7)].map((_, i) => new Intl.DateTimeFormat(
19
+ locale,
20
+ { weekday: "long" }
21
+ ).format(new Date(2023, 0, i + 1)));
22
+ const shortMonthNames = [...Array(12)].map((_, i) => new Intl.DateTimeFormat(
23
+ locale,
24
+ { month: "short" }
25
+ ).format(new Date(2023, i, 1)));
26
+ const monthNames = [...Array(12)].map((_, i) => new Intl.DateTimeFormat(
27
+ locale,
28
+ { month: "long" }
29
+ ).format(new Date(2023, i, 1)));
20
30
  const replacements = {
21
31
  "DD": () => String(day).padStart(2, "0"),
22
32
  "D": () => String(day),
33
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
23
34
  "dd": () => dateNames[dayOfWeek],
35
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
24
36
  "d": () => shortDateNames[dayOfWeek],
25
37
  "MM": () => String(month + 1).padStart(2, "0"),
26
38
  "M": () => String(month + 1),
39
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
27
40
  "MMMM": () => monthNames[month],
41
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
28
42
  "MMM": () => shortMonthNames[month],
29
43
  "YYYY": () => String(year),
30
44
  "YY": () => String(year).slice(-2),
31
- "hh": () => String(hours % 12 || 12).padStart(2, "0"),
32
- "h": () => String(hours % 12 || 12),
45
+ "hh": () => String(hours % 12 !== 0 ? hours % 12 : 12).padStart(2, "0"),
46
+ "h": () => String(hours % 12 !== 0 ? hours % 12 : 12),
33
47
  "HH": () => String(hours).padStart(2, "0"),
34
48
  "H": () => String(hours),
35
49
  "mm": () => String(minutes).padStart(2, "0"),