@design-edito/tools 0.4.22 → 0.5.0

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 (505) hide show
  1. package/agnostic/arrays/find-duplicates/index.d.ts +1 -1
  2. package/agnostic/arrays/find-duplicates/index.js +3 -2
  3. package/agnostic/arrays/is-array-of/index.d.ts +1 -1
  4. package/agnostic/arrays/is-array-of/index.js +3 -1
  5. package/agnostic/arrays/make/index.d.ts +1 -1
  6. package/agnostic/arrays/random-pick/index.js +2 -1
  7. package/agnostic/arrays/shuffle/index.js +1 -1
  8. package/agnostic/booleans/is-falsy/index.d.ts +3 -3
  9. package/agnostic/booleans/is-falsy/index.js +2 -3
  10. package/agnostic/colors/channels/index.d.ts +16 -16
  11. package/agnostic/colors/channels/index.js +15 -15
  12. package/agnostic/colors/contrast/index.d.ts +6 -6
  13. package/agnostic/colors/contrast/index.js +6 -8
  14. package/agnostic/colors/contrast/index.test.js +1 -1
  15. package/agnostic/colors/convert/index.d.ts +43 -43
  16. package/agnostic/colors/convert/index.js +60 -55
  17. package/agnostic/colors/distance/index.d.ts +5 -5
  18. package/agnostic/colors/distance/index.js +5 -4
  19. package/agnostic/colors/grayscale/index.d.ts +3 -3
  20. package/agnostic/colors/grayscale/index.js +3 -3
  21. package/agnostic/colors/index.d.ts +1 -1
  22. package/agnostic/colors/index.js +1 -1
  23. package/agnostic/colors/invert/index.d.ts +4 -4
  24. package/agnostic/colors/invert/index.js +3 -3
  25. package/agnostic/colors/lerp/index.d.ts +6 -7
  26. package/agnostic/colors/lerp/index.js +5 -6
  27. package/agnostic/colors/luminance/index.d.ts +4 -4
  28. package/agnostic/colors/luminance/index.js +3 -3
  29. package/agnostic/colors/palette/index.d.ts +3 -3
  30. package/agnostic/colors/palette/index.js +4 -3
  31. package/agnostic/colors/rotate/index.d.ts +4 -4
  32. package/agnostic/colors/rotate/index.js +4 -4
  33. package/agnostic/colors/tidy/index.d.ts +2 -2
  34. package/agnostic/colors/tidy/index.js +2 -2
  35. package/agnostic/colors/typechecks/index.d.ts +21 -21
  36. package/agnostic/colors/typechecks/index.js +22 -21
  37. package/agnostic/colors/types.d.ts +33 -33
  38. package/agnostic/css/bem/index.d.ts +11 -11
  39. package/agnostic/css/bem/index.js +9 -8
  40. package/agnostic/css/clss/index.d.ts +1 -1
  41. package/agnostic/css/clss/index.js +1 -1
  42. package/agnostic/css/index.d.ts +1 -1
  43. package/agnostic/css/index.js +1 -1
  44. package/agnostic/css/is-valid-css-class-name/index.d.ts +2 -2
  45. package/agnostic/css/is-valid-css-class-name/index.js +3 -3
  46. package/agnostic/css/scale/index.d.ts +18 -18
  47. package/agnostic/css/scale/index.js +18 -18
  48. package/agnostic/css/styles-set/index.d.ts +1 -1
  49. package/agnostic/css/styles-set/index.js +0 -2
  50. package/agnostic/errors/register/index.d.ts +1 -1
  51. package/agnostic/errors/register/index.js +3 -0
  52. package/agnostic/errors/unknown-to-string/index.d.ts +2 -2
  53. package/agnostic/errors/unknown-to-string/index.js +2 -3
  54. package/agnostic/html/deep-select/index.d.ts +3 -3
  55. package/agnostic/html/deep-select/index.js +11 -7
  56. package/agnostic/html/get-node-ancestors/index.d.ts +3 -3
  57. package/agnostic/html/get-node-ancestors/index.js +3 -3
  58. package/agnostic/html/get-position-inside-parent/index.d.ts +2 -2
  59. package/agnostic/html/get-position-inside-parent/index.js +2 -2
  60. package/agnostic/html/hyper-json/cast/index.d.ts +1 -1
  61. package/agnostic/html/hyper-json/cast/index.js +6 -5
  62. package/agnostic/html/hyper-json/method/index.d.ts +2 -2
  63. package/agnostic/html/hyper-json/serialize/index.d.ts +1 -1
  64. package/agnostic/html/hyper-json/serialize/index.js +9 -5
  65. package/agnostic/html/hyper-json/smart-tags/coalesced/addclass/index.js +1 -0
  66. package/agnostic/html/hyper-json/smart-tags/coalesced/and/index.d.ts +1 -1
  67. package/agnostic/html/hyper-json/smart-tags/coalesced/append/index.d.ts +1 -1
  68. package/agnostic/html/hyper-json/smart-tags/coalesced/append/index.js +1 -0
  69. package/agnostic/html/hyper-json/smart-tags/coalesced/at/index.d.ts +1 -1
  70. package/agnostic/html/hyper-json/smart-tags/coalesced/at/index.js +1 -0
  71. package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.d.ts +1 -1
  72. package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.js +1 -1
  73. package/agnostic/html/hyper-json/smart-tags/coalesced/clone/index.d.ts +1 -1
  74. package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.d.ts +1 -1
  75. package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.js +0 -1
  76. package/agnostic/html/hyper-json/smart-tags/coalesced/equals/index.d.ts +1 -1
  77. package/agnostic/html/hyper-json/smart-tags/coalesced/getattribute/index.js +1 -0
  78. package/agnostic/html/hyper-json/smart-tags/coalesced/getproperties/index.d.ts +1 -1
  79. package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.d.ts +1 -1
  80. package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.js +1 -2
  81. package/agnostic/html/hyper-json/smart-tags/coalesced/hjparse/index.d.ts +1 -1
  82. package/agnostic/html/hyper-json/smart-tags/coalesced/hjstringify/index.d.ts +1 -1
  83. package/agnostic/html/hyper-json/smart-tags/coalesced/hjstringify/index.js +4 -0
  84. package/agnostic/html/hyper-json/smart-tags/coalesced/if/index.d.ts +1 -1
  85. package/agnostic/html/hyper-json/smart-tags/coalesced/if/index.js +1 -0
  86. package/agnostic/html/hyper-json/smart-tags/coalesced/index.d.ts +11 -11
  87. package/agnostic/html/hyper-json/smart-tags/coalesced/index.js +11 -11
  88. package/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.d.ts +1 -1
  89. package/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.js +1 -0
  90. package/agnostic/html/hyper-json/smart-tags/coalesced/join/index.d.ts +1 -1
  91. package/agnostic/html/hyper-json/smart-tags/coalesced/length/index.d.ts +1 -1
  92. package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.d.ts +1 -1
  93. package/agnostic/html/hyper-json/smart-tags/coalesced/or/index.d.ts +1 -1
  94. package/agnostic/html/hyper-json/smart-tags/coalesced/pickrandom/index.d.ts +1 -1
  95. package/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.d.ts +1 -1
  96. package/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.js +1 -0
  97. package/agnostic/html/hyper-json/smart-tags/coalesced/print/index.d.ts +1 -1
  98. package/agnostic/html/hyper-json/smart-tags/coalesced/print/index.js +2 -0
  99. package/agnostic/html/hyper-json/smart-tags/coalesced/push/index.d.ts +1 -1
  100. package/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.d.ts +1 -1
  101. package/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.js +1 -0
  102. package/agnostic/html/hyper-json/smart-tags/coalesced/recordtoarray/index.d.ts +1 -1
  103. package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.js +3 -0
  104. package/agnostic/html/hyper-json/smart-tags/coalesced/removeclass/index.js +1 -0
  105. package/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.d.ts +1 -1
  106. package/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.js +1 -0
  107. package/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.d.ts +1 -1
  108. package/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.js +1 -0
  109. package/agnostic/html/hyper-json/smart-tags/coalesced/select/index.js +1 -0
  110. package/agnostic/html/hyper-json/smart-tags/coalesced/set/index.d.ts +1 -1
  111. package/agnostic/html/hyper-json/smart-tags/coalesced/set/index.js +1 -0
  112. package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.js +3 -0
  113. package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.d.ts +1 -1
  114. package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.js +4 -2
  115. package/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.d.ts +1 -1
  116. package/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.js +5 -0
  117. package/agnostic/html/hyper-json/smart-tags/coalesced/spread/index.d.ts +1 -1
  118. package/agnostic/html/hyper-json/smart-tags/coalesced/spread/index.js +1 -0
  119. package/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.d.ts +1 -1
  120. package/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.d.ts +1 -1
  121. package/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.d.ts +1 -1
  122. package/agnostic/html/hyper-json/smart-tags/coalesced/toggleclass/index.js +3 -2
  123. package/agnostic/html/hyper-json/smart-tags/coalesced/tonodelist/index.d.ts +1 -1
  124. package/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.d.ts +1 -1
  125. package/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.d.ts +1 -1
  126. package/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.d.ts +1 -1
  127. package/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.d.ts +1 -1
  128. package/agnostic/html/hyper-json/smart-tags/coalesced/tostring/index.d.ts +1 -1
  129. package/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.d.ts +1 -1
  130. package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.d.ts +1 -1
  131. package/agnostic/html/hyper-json/smart-tags/coalesced/trim/index.js +1 -1
  132. package/agnostic/html/hyper-json/smart-tags/index.d.ts +1 -1
  133. package/agnostic/html/hyper-json/smart-tags/isolated/any/index.d.ts +1 -1
  134. package/agnostic/html/hyper-json/smart-tags/isolated/array/index.d.ts +1 -1
  135. package/agnostic/html/hyper-json/smart-tags/isolated/get/index.d.ts +1 -1
  136. package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.d.ts +1 -1
  137. package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.js +3 -1
  138. package/agnostic/html/hyper-json/smart-tags/isolated/index.d.ts +1 -1
  139. package/agnostic/html/hyper-json/smart-tags/isolated/index.js +1 -1
  140. package/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.d.ts +1 -1
  141. package/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.js +1 -0
  142. package/agnostic/html/hyper-json/smart-tags/isolated/null/index.d.ts +1 -1
  143. package/agnostic/html/hyper-json/smart-tags/isolated/record/index.d.ts +1 -1
  144. package/agnostic/html/hyper-json/smart-tags/isolated/ref/index.d.ts +1 -1
  145. package/agnostic/html/hyper-json/smart-tags/isolated/ref/index.js +3 -1
  146. package/agnostic/html/hyper-json/smart-tags/isolated/text/index.js +2 -2
  147. package/agnostic/html/hyper-json/transformer/index.d.ts +5 -5
  148. package/agnostic/html/hyper-json/tree/index.d.ts +1 -1
  149. package/agnostic/html/hyper-json/tree/index.js +14 -8
  150. package/agnostic/html/hyper-json/types/index.d.ts +11 -11
  151. package/agnostic/html/hyper-json/utils/index.d.ts +3 -3
  152. package/agnostic/html/hyper-json/utils/index.js +8 -3
  153. package/agnostic/html/index.d.ts +1 -1
  154. package/agnostic/html/index.js +1 -1
  155. package/agnostic/html/insert-node/index.d.ts +4 -4
  156. package/agnostic/html/insert-node/index.js +4 -4
  157. package/agnostic/html/replace-in-element/index.d.ts +3 -3
  158. package/agnostic/html/replace-in-element/index.js +4 -4
  159. package/agnostic/html/selector-to-element/index.d.ts +2 -2
  160. package/agnostic/html/selector-to-element/index.js +11 -11
  161. package/agnostic/html/string-to-nodes/index.d.ts +3 -3
  162. package/agnostic/html/string-to-nodes/index.js +3 -3
  163. package/agnostic/html/watch-selection/index.d.ts +4 -5
  164. package/agnostic/html/watch-selection/index.js +5 -6
  165. package/agnostic/misc/assert/index.js +3 -1
  166. package/agnostic/misc/cast/index.d.ts +16 -16
  167. package/agnostic/misc/cast/index.js +18 -18
  168. package/agnostic/misc/connection/index.d.ts +5 -5
  169. package/agnostic/misc/connection/index.js +4 -2
  170. package/agnostic/misc/crawler/index.d.ts +18 -18
  171. package/agnostic/misc/crawler/index.js +10 -9
  172. package/agnostic/misc/crawler/index.test.js +2 -2
  173. package/agnostic/misc/crossenv/detect-runtime/index.d.ts +1 -1
  174. package/agnostic/misc/crossenv/detect-runtime/index.js +10 -11
  175. package/agnostic/misc/crossenv/window/index.d.ts +6 -6
  176. package/agnostic/misc/crossenv/window/index.js +6 -5
  177. package/agnostic/misc/data-size/index.js +2 -0
  178. package/agnostic/misc/index.d.ts +3 -3
  179. package/agnostic/misc/index.js +3 -3
  180. package/agnostic/misc/is-constructor-function/index.d.ts +2 -2
  181. package/agnostic/misc/is-constructor-function/index.js +3 -2
  182. package/agnostic/misc/is-constructor-function/index.test.js +2 -2
  183. package/agnostic/misc/is-nullish/index.d.ts +5 -5
  184. package/agnostic/misc/is-nullish/index.js +5 -4
  185. package/agnostic/misc/logs/index.d.ts +1 -1
  186. package/agnostic/misc/logs/index.js +1 -1
  187. package/agnostic/misc/logs/logger/index.js +2 -2
  188. package/agnostic/misc/lorem-ipsum/index.js +4 -4
  189. package/agnostic/misc/normalize-extension/index.d.ts +3 -3
  190. package/agnostic/misc/normalize-extension/index.js +4 -4
  191. package/agnostic/misc/outcome/index.d.ts +14 -14
  192. package/agnostic/misc/outcome/index.js +6 -4
  193. package/agnostic/numbers/absolute-modulo/index.d.ts +3 -3
  194. package/agnostic/numbers/absolute-modulo/index.js +3 -3
  195. package/agnostic/numbers/approximate-rational/index.d.ts +6 -6
  196. package/agnostic/numbers/approximate-rational/index.js +9 -9
  197. package/agnostic/numbers/clamp/index.d.ts +4 -4
  198. package/agnostic/numbers/clamp/index.js +4 -4
  199. package/agnostic/numbers/geometric-progressions/index.d.ts +5 -5
  200. package/agnostic/numbers/geometric-progressions/index.js +7 -5
  201. package/agnostic/numbers/geometric-progressions/index.test.js +2 -2
  202. package/agnostic/numbers/index.d.ts +1 -1
  203. package/agnostic/numbers/index.js +1 -1
  204. package/agnostic/numbers/interpolate/index.d.ts +8 -8
  205. package/agnostic/numbers/interpolate/index.js +8 -8
  206. package/agnostic/numbers/round/index.d.ts +9 -9
  207. package/agnostic/numbers/round/index.js +9 -9
  208. package/agnostic/objects/deep-get-property/index.d.ts +4 -4
  209. package/agnostic/objects/deep-get-property/index.js +3 -3
  210. package/agnostic/objects/enums/is-in-enum/index.d.ts +3 -3
  211. package/agnostic/objects/enums/is-in-enum/index.js +3 -3
  212. package/agnostic/objects/flatten-getters/index.d.ts +2 -2
  213. package/agnostic/objects/flatten-getters/index.js +3 -2
  214. package/agnostic/objects/index.d.ts +1 -1
  215. package/agnostic/objects/index.js +1 -1
  216. package/agnostic/objects/is-object/index.d.ts +4 -4
  217. package/agnostic/objects/is-object/index.js +4 -4
  218. package/agnostic/objects/is-record/index.d.ts +2 -2
  219. package/agnostic/objects/is-record/index.js +2 -2
  220. package/agnostic/objects/record-format/index.d.ts +9 -9
  221. package/agnostic/objects/record-format/index.js +8 -3
  222. package/agnostic/objects/record-map/index.d.ts +4 -4
  223. package/agnostic/objects/record-map/index.js +5 -3
  224. package/agnostic/objects/sort-keys/index.d.ts +3 -3
  225. package/agnostic/objects/sort-keys/index.js +4 -3
  226. package/agnostic/objects/validation/index.d.ts +3 -3
  227. package/agnostic/objects/validation/index.js +4 -3
  228. package/agnostic/optim/memoize/index.d.ts +2 -2
  229. package/agnostic/optim/memoize/index.js +4 -2
  230. package/agnostic/optim/throttle-debounce/index.d.ts +2 -2
  231. package/agnostic/optim/throttle-debounce/index.js +7 -6
  232. package/agnostic/optim/throttle-debounce/types.d.ts +2 -1
  233. package/agnostic/random/random/index.d.ts +7 -8
  234. package/agnostic/random/random/index.js +3 -3
  235. package/agnostic/random/uuid/index.d.ts +6 -6
  236. package/agnostic/random/uuid/index.js +6 -6
  237. package/agnostic/regexps/index.d.ts +30 -60
  238. package/agnostic/regexps/index.js +27 -26
  239. package/agnostic/sanitization/file-name/index.d.ts +3 -3
  240. package/agnostic/sanitization/file-name/index.js +10 -10
  241. package/agnostic/sanitization/html/index.d.ts +6 -6
  242. package/agnostic/sanitization/html/index.js +9 -6
  243. package/agnostic/sanitization/path/index.d.ts +2 -2
  244. package/agnostic/sanitization/path/index.js +2 -2
  245. package/agnostic/sanitization/user-input/index.js +1 -0
  246. package/agnostic/strings/char-codes/index.js +2 -6
  247. package/agnostic/strings/index.d.ts +1 -1
  248. package/agnostic/strings/index.js +1 -1
  249. package/agnostic/strings/normalize-indent/index.js +2 -2
  250. package/agnostic/strings/parse-table/index.d.ts +13 -13
  251. package/agnostic/strings/parse-table/index.js +31 -16
  252. package/agnostic/strings/replace-all/index.d.ts +1 -1
  253. package/agnostic/strings/replace-all/index.js +1 -0
  254. package/agnostic/strings/to-alphanum/index.js +2 -2
  255. package/agnostic/strings/trim/index.js +2 -2
  256. package/agnostic/time/dates/format-date/index.js +3 -1
  257. package/agnostic/time/dates/index.d.ts +1 -0
  258. package/agnostic/time/dates/index.js +1 -0
  259. package/agnostic/time/dates/to-french-republican/index.d.ts +16 -0
  260. package/agnostic/time/dates/to-french-republican/index.js +82 -0
  261. package/agnostic/time/dates/to-french-republican/index.test.d.ts +1 -0
  262. package/agnostic/time/dates/to-french-republican/index.test.js +112 -0
  263. package/agnostic/time/dates/to-french-republican/types.d.ts +91 -0
  264. package/agnostic/time/dates/to-french-republican/types.js +47 -0
  265. package/agnostic/time/dates/to-french-republican/utils.d.ts +32 -0
  266. package/agnostic/time/dates/to-french-republican/utils.js +155 -0
  267. package/agnostic/time/duration/index.js +2 -0
  268. package/agnostic/time/index.d.ts +2 -2
  269. package/agnostic/time/index.js +2 -2
  270. package/agnostic/time/timeout/index.js +9 -9
  271. package/agnostic/time/transitions/index.js +8 -7
  272. package/components/BeforeAfter/index.controlled.js +1 -0
  273. package/components/BeforeAfter/index.js +4 -0
  274. package/components/Button/index.d.ts +2 -7
  275. package/components/Button/index.js +2 -2
  276. package/components/Clippable/index.js +1 -0
  277. package/components/Drawer/index.js +1 -1
  278. package/components/Gallery/index.js +2 -1
  279. package/components/Gallery/utils.js +5 -1
  280. package/components/Iframe/index.d.ts +16 -34
  281. package/components/Iframe/index.js +70 -27
  282. package/components/Image/index.js +2 -0
  283. package/components/Input/index.controlled.d.ts +42 -0
  284. package/components/Input/index.controlled.js +54 -0
  285. package/components/Input/index.d.ts +21 -17
  286. package/components/Input/index.js +27 -18
  287. package/components/IntersectionObserver/index.js +5 -2
  288. package/components/JsonEditor/index.js +1 -1
  289. package/components/Overlayer/index.d.ts +1 -1
  290. package/components/ScrollListener/utils.d.ts +29 -0
  291. package/components/Select/index.controlled.d.ts +43 -0
  292. package/components/Select/index.controlled.js +54 -0
  293. package/components/Select/index.d.ts +22 -18
  294. package/components/Select/index.js +27 -18
  295. package/components/Sequencer/index.controlled.js +1 -1
  296. package/components/Subtitles/index.js +3 -1
  297. package/components/Subtitles/types.d.ts +14 -0
  298. package/components/Subtitles/utils.d.ts +19 -15
  299. package/components/Subtitles/utils.js +29 -24
  300. package/components/Textarea/index.controlled.d.ts +50 -0
  301. package/components/Textarea/index.controlled.js +75 -0
  302. package/components/Textarea/index.d.ts +22 -17
  303. package/components/Textarea/index.js +27 -18
  304. package/components/UIModule/index.js +3 -1
  305. package/components/Video/index.controlled.d.ts +1 -1
  306. package/components/Video/index.controlled.js +11 -10
  307. package/components/Video/index.js +27 -20
  308. package/components/Video/utils.d.ts +1 -1
  309. package/components/Video/utils.js +11 -2
  310. package/components/index.d.ts +1 -1
  311. package/components/index.js +1 -1
  312. package/components/utils/types.d.ts +5 -0
  313. package/node/@aws-s3/storage/directory/copy-dir/index.d.ts +9 -9
  314. package/node/@aws-s3/storage/directory/copy-dir/index.js +15 -12
  315. package/node/@aws-s3/storage/directory/index.d.ts +1 -1
  316. package/node/@aws-s3/storage/directory/index.js +1 -1
  317. package/node/@aws-s3/storage/directory/list/index.d.ts +5 -5
  318. package/node/@aws-s3/storage/directory/list/index.js +5 -5
  319. package/node/@aws-s3/storage/directory/move-dir/index.d.ts +6 -6
  320. package/node/@aws-s3/storage/directory/move-dir/index.js +11 -7
  321. package/node/@aws-s3/storage/directory/remove-dir/index.d.ts +5 -5
  322. package/node/@aws-s3/storage/directory/remove-dir/index.js +5 -5
  323. package/node/@aws-s3/storage/file/copy/index.d.ts +8 -8
  324. package/node/@aws-s3/storage/file/copy/index.js +12 -9
  325. package/node/@aws-s3/storage/file/download/index.d.ts +6 -6
  326. package/node/@aws-s3/storage/file/download/index.js +6 -5
  327. package/node/@aws-s3/storage/file/exists/index.d.ts +6 -6
  328. package/node/@aws-s3/storage/file/exists/index.js +15 -12
  329. package/node/@aws-s3/storage/file/index.d.ts +1 -1
  330. package/node/@aws-s3/storage/file/index.js +1 -1
  331. package/node/@aws-s3/storage/file/move/index.d.ts +9 -9
  332. package/node/@aws-s3/storage/file/move/index.js +18 -15
  333. package/node/@aws-s3/storage/file/remove/index.d.ts +5 -5
  334. package/node/@aws-s3/storage/file/remove/index.js +16 -11
  335. package/node/@aws-s3/storage/file/stat/index.d.ts +5 -5
  336. package/node/@aws-s3/storage/file/stat/index.js +10 -7
  337. package/node/@aws-s3/storage/file/upload/index.d.ts +7 -7
  338. package/node/@aws-s3/storage/file/upload/index.js +11 -9
  339. package/node/@express/@multer/index.d.ts +12 -12
  340. package/node/@express/@multer/index.js +27 -25
  341. package/node/@google-cloud/storage/bucket/get-metadata/index.d.ts +4 -4
  342. package/node/@google-cloud/storage/bucket/get-metadata/index.js +3 -3
  343. package/node/@google-cloud/storage/directory/copy-dir/index.d.ts +7 -7
  344. package/node/@google-cloud/storage/directory/copy-dir/index.js +6 -6
  345. package/node/@google-cloud/storage/directory/index.d.ts +1 -1
  346. package/node/@google-cloud/storage/directory/index.js +1 -1
  347. package/node/@google-cloud/storage/directory/list/index.d.ts +6 -6
  348. package/node/@google-cloud/storage/directory/list/index.js +5 -5
  349. package/node/@google-cloud/storage/directory/move-dir/index.d.ts +6 -6
  350. package/node/@google-cloud/storage/directory/move-dir/index.js +5 -5
  351. package/node/@google-cloud/storage/directory/remove-dir/index.d.ts +7 -7
  352. package/node/@google-cloud/storage/directory/remove-dir/index.js +6 -6
  353. package/node/@google-cloud/storage/file/copy/index.d.ts +9 -9
  354. package/node/@google-cloud/storage/file/copy/index.js +8 -8
  355. package/node/@google-cloud/storage/file/download/index.d.ts +7 -7
  356. package/node/@google-cloud/storage/file/download/index.js +5 -5
  357. package/node/@google-cloud/storage/file/exists/index.d.ts +7 -7
  358. package/node/@google-cloud/storage/file/exists/index.js +6 -6
  359. package/node/@google-cloud/storage/file/generate-signed-url/index.d.ts +7 -7
  360. package/node/@google-cloud/storage/file/generate-signed-url/index.js +6 -6
  361. package/node/@google-cloud/storage/file/get-metadata/index.d.ts +5 -5
  362. package/node/@google-cloud/storage/file/get-metadata/index.js +4 -4
  363. package/node/@google-cloud/storage/file/get-permissions/index.d.ts +6 -6
  364. package/node/@google-cloud/storage/file/get-permissions/index.js +4 -4
  365. package/node/@google-cloud/storage/file/index.d.ts +1 -1
  366. package/node/@google-cloud/storage/file/index.js +1 -1
  367. package/node/@google-cloud/storage/file/move/index.d.ts +10 -10
  368. package/node/@google-cloud/storage/file/move/index.js +9 -9
  369. package/node/@google-cloud/storage/file/remove/index.d.ts +5 -5
  370. package/node/@google-cloud/storage/file/remove/index.js +4 -4
  371. package/node/@google-cloud/storage/file/revoke-signed-urls/index.d.ts +5 -5
  372. package/node/@google-cloud/storage/file/revoke-signed-urls/index.js +5 -5
  373. package/node/@google-cloud/storage/file/stat/index.d.ts +5 -5
  374. package/node/@google-cloud/storage/file/stat/index.js +4 -4
  375. package/node/@google-cloud/storage/file/update-metadata/index.d.ts +7 -7
  376. package/node/@google-cloud/storage/file/update-metadata/index.js +5 -5
  377. package/node/@google-cloud/storage/file/upload/index.d.ts +7 -7
  378. package/node/@google-cloud/storage/file/upload/index.js +5 -5
  379. package/node/@google-cloud/storage/index.d.ts +1 -1
  380. package/node/@google-cloud/storage/index.js +1 -1
  381. package/node/cloud-storage/clients/index.d.ts +8 -8
  382. package/node/cloud-storage/clients/index.js +8 -8
  383. package/node/cloud-storage/operations/copy-dir/index.d.ts +22 -22
  384. package/node/cloud-storage/operations/copy-dir/index.js +5 -5
  385. package/node/cloud-storage/operations/copy-file/index.d.ts +22 -22
  386. package/node/cloud-storage/operations/copy-file/index.js +5 -5
  387. package/node/cloud-storage/operations/download-file/index.d.ts +19 -19
  388. package/node/cloud-storage/operations/download-file/index.js +6 -6
  389. package/node/cloud-storage/operations/exists-file/index.d.ts +15 -26
  390. package/node/cloud-storage/operations/exists-file/index.js +4 -4
  391. package/node/cloud-storage/operations/index.d.ts +1 -1
  392. package/node/cloud-storage/operations/index.js +1 -1
  393. package/node/cloud-storage/operations/list-dir/index.d.ts +15 -25
  394. package/node/cloud-storage/operations/list-dir/index.js +4 -4
  395. package/node/cloud-storage/operations/move-dir/index.d.ts +22 -22
  396. package/node/cloud-storage/operations/move-dir/index.js +5 -5
  397. package/node/cloud-storage/operations/move-file/index.d.ts +22 -22
  398. package/node/cloud-storage/operations/move-file/index.js +5 -5
  399. package/node/cloud-storage/operations/remove-dir/index.d.ts +18 -18
  400. package/node/cloud-storage/operations/remove-dir/index.js +4 -4
  401. package/node/cloud-storage/operations/remove-file/index.d.ts +18 -18
  402. package/node/cloud-storage/operations/remove-file/index.js +4 -4
  403. package/node/cloud-storage/operations/stat-file/index.d.ts +16 -16
  404. package/node/cloud-storage/operations/stat-file/index.js +4 -4
  405. package/node/cloud-storage/operations/upload-file/index.d.ts +23 -23
  406. package/node/cloud-storage/operations/upload-file/index.js +5 -5
  407. package/node/encryption/@aes-256-gcm/buffer/index.d.ts +6 -6
  408. package/node/encryption/@aes-256-gcm/buffer/index.js +6 -6
  409. package/node/encryption/@aes-256-gcm/uint8-array/index.d.ts +8 -8
  410. package/node/encryption/@aes-256-gcm/uint8-array/index.js +8 -8
  411. package/node/encryption/key/index.d.ts +6 -6
  412. package/node/encryption/key/index.js +6 -6
  413. package/node/files/read-write/index.d.ts +16 -16
  414. package/node/files/subpaths/index.d.ts +8 -8
  415. package/node/files/subpaths/index.js +11 -13
  416. package/node/ftps/directory/copy-dir/index.d.ts +6 -6
  417. package/node/ftps/directory/copy-dir/index.js +6 -6
  418. package/node/ftps/directory/list/index.d.ts +4 -4
  419. package/node/ftps/directory/list/index.js +3 -3
  420. package/node/ftps/directory/move-dir/index.d.ts +6 -6
  421. package/node/ftps/directory/move-dir/index.js +5 -5
  422. package/node/ftps/directory/remove-dir/index.d.ts +6 -6
  423. package/node/ftps/directory/remove-dir/index.js +8 -7
  424. package/node/ftps/file/copy/index.d.ts +6 -6
  425. package/node/ftps/file/copy/index.js +5 -5
  426. package/node/ftps/file/download/index.d.ts +6 -6
  427. package/node/ftps/file/download/index.js +5 -5
  428. package/node/ftps/file/exists/index.d.ts +3 -3
  429. package/node/ftps/file/exists/index.js +3 -3
  430. package/node/ftps/file/move/index.d.ts +8 -8
  431. package/node/ftps/file/move/index.js +11 -9
  432. package/node/ftps/file/remove/index.d.ts +5 -5
  433. package/node/ftps/file/remove/index.js +4 -4
  434. package/node/ftps/file/stat/index.d.ts +4 -4
  435. package/node/ftps/file/stat/index.js +4 -4
  436. package/node/ftps/file/upload/index.d.ts +7 -7
  437. package/node/ftps/file/upload/index.js +5 -5
  438. package/node/images/create/index.d.ts +2 -2
  439. package/node/images/create/index.js +1 -1
  440. package/node/images/format/index.d.ts +8 -8
  441. package/node/images/metadata/index.d.ts +2 -2
  442. package/node/images/transform/index.d.ts +2 -2
  443. package/node/images/transform/index.js +12 -2
  444. package/node/images/transform/operations/blur/index.d.ts +2 -2
  445. package/node/images/transform/operations/blur/index.js +1 -0
  446. package/node/images/transform/operations/brighten/index.d.ts +2 -2
  447. package/node/images/transform/operations/brighten/index.js +1 -0
  448. package/node/images/transform/operations/extend/index.d.ts +2 -2
  449. package/node/images/transform/operations/extend/index.js +1 -0
  450. package/node/images/transform/operations/extract/index.d.ts +2 -2
  451. package/node/images/transform/operations/extract/index.js +1 -0
  452. package/node/images/transform/operations/flatten/index.d.ts +2 -2
  453. package/node/images/transform/operations/flatten/index.js +1 -0
  454. package/node/images/transform/operations/flip/index.d.ts +2 -2
  455. package/node/images/transform/operations/flip/index.js +1 -0
  456. package/node/images/transform/operations/flop/index.d.ts +2 -2
  457. package/node/images/transform/operations/flop/index.js +1 -0
  458. package/node/images/transform/operations/hue/index.d.ts +2 -2
  459. package/node/images/transform/operations/hue/index.js +1 -0
  460. package/node/images/transform/operations/index.d.ts +1 -1
  461. package/node/images/transform/operations/index.js +1 -1
  462. package/node/images/transform/operations/level/index.d.ts +2 -2
  463. package/node/images/transform/operations/level/index.js +1 -0
  464. package/node/images/transform/operations/lighten/index.d.ts +2 -2
  465. package/node/images/transform/operations/lighten/index.js +1 -0
  466. package/node/images/transform/operations/normalize/index.d.ts +2 -2
  467. package/node/images/transform/operations/normalize/index.js +1 -0
  468. package/node/images/transform/operations/overlay/index.d.ts +2 -2
  469. package/node/images/transform/operations/resize/index.d.ts +2 -2
  470. package/node/images/transform/operations/resize/index.js +1 -0
  471. package/node/images/transform/operations/rotate/index.d.ts +2 -2
  472. package/node/images/transform/operations/rotate/index.js +1 -0
  473. package/node/images/transform/operations/saturate/index.d.ts +2 -2
  474. package/node/images/transform/operations/saturate/index.js +1 -0
  475. package/node/images/types.d.ts +41 -2
  476. package/node/images/utils/index.d.ts +10 -5
  477. package/node/index.d.ts +1 -1
  478. package/node/index.js +1 -1
  479. package/node/process/on-exit/index.js +2 -4
  480. package/node/process/prompt-continue/index.d.ts +3 -3
  481. package/node/process/prompt-continue/index.js +4 -3
  482. package/node/process/spawner/index.js +7 -6
  483. package/node/sftp/directory/copy-dir/index.d.ts +6 -6
  484. package/node/sftp/directory/copy-dir/index.js +6 -6
  485. package/node/sftp/directory/list/index.d.ts +3 -3
  486. package/node/sftp/directory/list/index.js +4 -4
  487. package/node/sftp/directory/move-dir/index.d.ts +7 -7
  488. package/node/sftp/directory/move-dir/index.js +7 -7
  489. package/node/sftp/directory/remove-dir/index.d.ts +5 -5
  490. package/node/sftp/directory/remove-dir/index.js +8 -7
  491. package/node/sftp/file/copy/index.d.ts +6 -6
  492. package/node/sftp/file/copy/index.js +5 -5
  493. package/node/sftp/file/download/index.d.ts +7 -7
  494. package/node/sftp/file/download/index.js +5 -5
  495. package/node/sftp/file/exists/index.d.ts +3 -3
  496. package/node/sftp/file/exists/index.js +3 -3
  497. package/node/sftp/file/move/index.d.ts +7 -7
  498. package/node/sftp/file/move/index.js +7 -7
  499. package/node/sftp/file/remove/index.d.ts +4 -4
  500. package/node/sftp/file/remove/index.js +4 -4
  501. package/node/sftp/file/stat/index.d.ts +3 -3
  502. package/node/sftp/file/stat/index.js +6 -5
  503. package/node/sftp/file/upload/index.d.ts +6 -6
  504. package/node/sftp/file/upload/index.js +5 -5
  505. package/package.json +40 -39
@@ -2,29 +2,29 @@
2
2
  * Function that fetches content from a URL asynchronously.
3
3
  *
4
4
  * @template T - The type of content returned by the fetcher.
5
- * @param {string} url - The URL to fetch.
6
- * @returns {Promise<T>} A promise resolving to the fetched content.
5
+ * @param url - The URL to fetch.
6
+ * @returns A promise resolving to the fetched content.
7
7
  */
8
8
  export type Fetcher<T> = (url: string) => Promise<T>;
9
9
  /**
10
10
  * Function that processes fetched content for a given URL.
11
11
  *
12
12
  * @template T - The type of content provided by the fetcher.
13
- * @param {string} url - The URL of the content being processed.
14
- * @param {T} content - The content fetched from the URL.
15
- * @param {object} hooks - Hooks for accessing crawler state and controlling the crawl.
16
- * @param {(...urls: string[]) => void} hooks.push - Enqueue one or more URLs to be crawled.
17
- * @param {() => void} hooks.flush - Clear the waitlist of pending URLs.
18
- * @param {Set<string>} hooks.processed - Read-only snapshot of URLs already processed.
19
- * @param {string[]} hooks.waitlist - Read-only snapshot of the current waitlist of URLs.
20
- * @returns {any} The result of processing (ignored by the crawler).
13
+ * @param url - The URL of the content being processed.
14
+ * @param content - The content fetched from the URL.
15
+ * @param hooks - Hooks for accessing crawler state and controlling the crawl.
16
+ * @param hooks.push - Enqueue one or more URLs to be crawled.
17
+ * @param hooks.flush - Clear the waitlist of pending URLs.
18
+ * @param hooks.processed - Read-only snapshot of URLs already processed.
19
+ * @param hooks.waitlist - Read-only snapshot of the current waitlist of URLs.
20
+ * @returns The result of processing (ignored by the crawler).
21
21
  */
22
22
  export type Processor<T> = (url: string, content: T, hooks: {
23
23
  push: (...urls: string[]) => void;
24
24
  flush: () => void;
25
25
  processed: Set<string>;
26
26
  waitlist: string[];
27
- }) => any;
27
+ }) => unknown;
28
28
  /**
29
29
  * Configuration options for the crawler.
30
30
  *
@@ -61,13 +61,13 @@ export type Crawler = {
61
61
  * Creates a sequential crawler with optional delay.
62
62
  *
63
63
  * @template T - The type of content returned by the fetcher.
64
- * @param {Options<T>} options - Crawler configuration options.
65
- * @param {number} options.limit - Maximum number of URLs to process.
66
- * @param {number | (() => number)} [options.delayMs] - Optional delay between processing URLs, in milliseconds, or a function returning the delay.
67
- * @param {boolean} [options.allowDuplicates] - Optional, allows fetching and processing a URL that has already been seen.
68
- * @param {Fetcher<T>} options.fetcher - Function that fetches content for each URL.
69
- * @param {Processor<T>} options.processor - Function that processes fetched content.
70
- * @returns {Crawler} An object with methods to start crawling, enqueue URLs, flush the waitlist, and access crawler state.
64
+ * @param options - Crawler configuration options.
65
+ * @param options.limit - Maximum number of URLs to process.
66
+ * @param [options.delayMs] - Optional delay between processing URLs, in milliseconds, or a function returning the delay.
67
+ * @param [options.allowDuplicates] - Optional, allows fetching and processing a URL that has already been seen.
68
+ * @param options.fetcher - Function that fetches content for each URL.
69
+ * @param options.processor - Function that processes fetched content.
70
+ * @returns An object with methods to start crawling, enqueue URLs, flush the waitlist, and access crawler state.
71
71
  *
72
72
  * @example
73
73
  * ```typescript
@@ -3,13 +3,13 @@ import { wait } from '../../time/wait/index.js';
3
3
  * Creates a sequential crawler with optional delay.
4
4
  *
5
5
  * @template T - The type of content returned by the fetcher.
6
- * @param {Options<T>} options - Crawler configuration options.
7
- * @param {number} options.limit - Maximum number of URLs to process.
8
- * @param {number | (() => number)} [options.delayMs] - Optional delay between processing URLs, in milliseconds, or a function returning the delay.
9
- * @param {boolean} [options.allowDuplicates] - Optional, allows fetching and processing a URL that has already been seen.
10
- * @param {Fetcher<T>} options.fetcher - Function that fetches content for each URL.
11
- * @param {Processor<T>} options.processor - Function that processes fetched content.
12
- * @returns {Crawler} An object with methods to start crawling, enqueue URLs, flush the waitlist, and access crawler state.
6
+ * @param options - Crawler configuration options.
7
+ * @param options.limit - Maximum number of URLs to process.
8
+ * @param [options.delayMs] - Optional delay between processing URLs, in milliseconds, or a function returning the delay.
9
+ * @param [options.allowDuplicates] - Optional, allows fetching and processing a URL that has already been seen.
10
+ * @param options.fetcher - Function that fetches content for each URL.
11
+ * @param options.processor - Function that processes fetched content.
12
+ * @returns An object with methods to start crawling, enqueue URLs, flush the waitlist, and access crawler state.
13
13
  *
14
14
  * @example
15
15
  * ```typescript
@@ -31,13 +31,14 @@ import { wait } from '../../time/wait/index.js';
31
31
  export function create(options) {
32
32
  let ops = 0;
33
33
  const waitlist = [];
34
- const push = (...urls) => waitlist.push(...urls);
34
+ const push = (...urls) => { waitlist.push(...urls); };
35
35
  const flush = () => { waitlist.length = 0; };
36
36
  const processed = new Set();
37
37
  const crawl = async (startUrl) => {
38
38
  push(startUrl);
39
39
  while (waitlist.length > 0 && ops < options.limit) {
40
- ops++;
40
+ ops = ops + 1;
41
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- waitlist.length > 0 is guaranteed by the while condition above
41
42
  const currentUrl = waitlist[0];
42
43
  if (!processed.has(currentUrl) || options.allowDuplicates === true) {
43
44
  const content = await options.fetcher(currentUrl);
@@ -5,7 +5,7 @@ describe('create', () => {
5
5
  const crawler = create({
6
6
  limit: 10,
7
7
  fetcher: async () => 'content',
8
- processor: async () => { }
8
+ processor: async () => undefined
9
9
  });
10
10
  expect(crawler).toHaveProperty('crawl');
11
11
  expect(crawler).toHaveProperty('push');
@@ -36,7 +36,7 @@ describe('create', () => {
36
36
  });
37
37
  it('respects delay when provided', async () => {
38
38
  const fetcher = vi.fn(async (url) => `content-${url}`);
39
- const processor = vi.fn(async () => { });
39
+ const processor = vi.fn(async () => undefined);
40
40
  const startTime = Date.now();
41
41
  const crawler = create({ limit: 2, delayMs: 20, fetcher, processor });
42
42
  await crawler.crawl('url1');
@@ -5,7 +5,7 @@ import { RuntimeName } from '../types.js';
5
5
  * Checks for Node.js, Browser, Deno, React Native, Electron,
6
6
  * Cloudflare Workers, and AWS Lambda.
7
7
  *
8
- * @returns {RuntimeName | null}
8
+ * @returns
9
9
  * - The detected runtime as a `RuntimeName` enum value.
10
10
  * - `null` if the runtime cannot be determined.
11
11
  */
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-unnecessary-condition */
1
2
  import { RuntimeName } from '../types.js';
2
3
  /**
3
4
  * Detects the current JavaScript runtime environment.
@@ -5,37 +6,35 @@ import { RuntimeName } from '../types.js';
5
6
  * Checks for Node.js, Browser, Deno, React Native, Electron,
6
7
  * Cloudflare Workers, and AWS Lambda.
7
8
  *
8
- * @returns {RuntimeName | null}
9
+ * @returns
9
10
  * - The detected runtime as a `RuntimeName` enum value.
10
11
  * - `null` if the runtime cannot be determined.
11
12
  */
12
13
  export function detectRuntime() {
13
14
  /* Node.js */
14
- if (typeof process?.versions?.node !== 'undefined')
15
+ if (process?.versions?.node !== undefined)
15
16
  return RuntimeName.NODE;
16
17
  /* Browser */
17
- if (typeof window?.document !== 'undefined')
18
+ if (window?.document !== undefined)
18
19
  return RuntimeName.BROWSER;
19
20
  /* Deno */
20
- if (typeof Deno !== 'undefined')
21
+ if (Deno !== undefined)
21
22
  return RuntimeName.DENO;
22
23
  /* React Native */
23
- if (typeof process !== 'undefined'
24
+ if (process !== undefined
24
25
  && typeof navigator.userAgent === 'string'
25
26
  && navigator.userAgent.includes('ReactNative'))
26
27
  return RuntimeName.REACT_NATIVE;
27
28
  /* Electron */
28
- if (typeof process?.versions !== 'undefined'
29
- && typeof process.version.electron !== 'undefined')
29
+ if (process?.versions?.electron !== undefined)
30
30
  return RuntimeName.ELECTRON;
31
31
  /* Cloudflare Workers */
32
- if (typeof self !== 'undefined'
32
+ if (self !== undefined
33
33
  && typeof self.addEventListener === 'function'
34
- && typeof Headers !== 'undefined')
34
+ && Headers !== undefined)
35
35
  return RuntimeName.CLOUDFLARE;
36
36
  /* AWS Lambda */
37
- if (typeof AWS !== 'undefined'
38
- && typeof AWS.Lambda !== 'undefined')
37
+ if (AWS !== undefined)
39
38
  return RuntimeName.AWS_LAMBDA;
40
39
  /* Other */
41
40
  return null;
@@ -1,28 +1,28 @@
1
- import { type 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
  *
5
- * @returns {boolean} `true` if `window` is present, `false` otherwise.
5
+ * @returns `true` if `window` is present, `false` otherwise.
6
6
  */
7
7
  export declare function exists(): boolean;
8
8
  /**
9
9
  * Sets a custom `window` object to be used internally.
10
10
  *
11
- * @param {MinimalWindow | null} customWindow - The window object to set, or `null` to unset.
12
- * @returns {MinimalWindow | null} The window object that was set.
11
+ * @param customWindow - The window object to set, or `null` to unset.
12
+ * @returns The window object that was set.
13
13
  */
14
14
  export declare function set(customWindow: MinimalWindow | null): MinimalWindow | null;
15
15
  /**
16
16
  * Resets the internal window reference to the global `window` if it exists,
17
17
  * or `null` if no global `window` is available.
18
18
  *
19
- * @returns {MinimalWindow | null} The current internal window object after reset.
19
+ * @returns The current internal window object after reset.
20
20
  */
21
21
  export declare function unset(): MinimalWindow | null;
22
22
  /**
23
23
  * Retrieves the currently set `window` object.
24
24
  *
25
- * @returns {MinimalWindow} The internal window object.
25
+ * @returns The internal window object.
26
26
  * @throws Will throw an error if no window has been set and none exists globally.
27
27
  */
28
28
  export declare function get(): MinimalWindow;
@@ -1,20 +1,21 @@
1
1
  /**
2
2
  * Checks whether a `window` object exists in the current environment.
3
3
  *
4
- * @returns {boolean} `true` if `window` is present, `false` otherwise.
4
+ * @returns `true` if `window` is present, `false` otherwise.
5
5
  */
6
6
  export function exists() {
7
7
  return typeof globalThis !== 'undefined'
8
8
  && 'window' in globalThis;
9
9
  }
10
10
  let _window = exists()
11
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
11
12
  ? (globalThis.window ?? null)
12
13
  : null;
13
14
  /**
14
15
  * Sets a custom `window` object to be used internally.
15
16
  *
16
- * @param {MinimalWindow | null} customWindow - The window object to set, or `null` to unset.
17
- * @returns {MinimalWindow | null} The window object that was set.
17
+ * @param customWindow - The window object to set, or `null` to unset.
18
+ * @returns The window object that was set.
18
19
  */
19
20
  export function set(customWindow) {
20
21
  _window = customWindow;
@@ -24,7 +25,7 @@ export function set(customWindow) {
24
25
  * Resets the internal window reference to the global `window` if it exists,
25
26
  * or `null` if no global `window` is available.
26
27
  *
27
- * @returns {MinimalWindow | null} The current internal window object after reset.
28
+ * @returns The current internal window object after reset.
28
29
  */
29
30
  export function unset() {
30
31
  if (exists()) {
@@ -38,7 +39,7 @@ export function unset() {
38
39
  /**
39
40
  * Retrieves the currently set `window` object.
40
41
  *
41
- * @returns {MinimalWindow} The internal window object.
42
+ * @returns The internal window object.
42
43
  * @throws Will throw an error if no window has been set and none exists globally.
43
44
  */
44
45
  export function get() {
@@ -42,6 +42,7 @@ export class DataSize {
42
42
  else if (unit === 'PiB' || unit === 'pebibyte') {
43
43
  this.unit = 'pebibyte';
44
44
  }
45
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
45
46
  else if (unit === 'EiB' || unit === 'exbibyte') {
46
47
  this.unit = 'exbibyte';
47
48
  }
@@ -90,6 +91,7 @@ export class DataSize {
90
91
  return this.value * 8 * Math.pow(1024, 4);
91
92
  if (this.unit === 'pebibyte')
92
93
  return this.value * 8 * Math.pow(1024, 5);
94
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
93
95
  if (this.unit === 'exbibyte')
94
96
  return this.value * 8 * Math.pow(1024, 6);
95
97
  return this.value; // defaults to bits
@@ -1,12 +1,12 @@
1
1
  export * as assert from './assert/index.js'
2
2
  export * as cast from './cast/index.js'
3
+ export * as connection from './connection/index.js'
3
4
  export * as crawler from './crawler/index.js'
4
5
  export * as crossenv from './crossenv/index.js'
6
+ export * as dataSize from './data-size/index.js'
5
7
  export * as isConstructorFunction from './is-constructor-function/index.js'
6
8
  export * as isNullish from './is-nullish/index.js'
7
9
  export * as logs from './logs/index.js'
8
10
  export * as loremIpsum from './lorem-ipsum/index.js'
9
- export * as connection from './connection/index.js'
10
- export * as dataSize from './data-size/index.js'
11
- export * as outcome from './outcome/index.js'
12
11
  export * as normalizeExtension from './normalize-extension/index.js'
12
+ export * as outcome from './outcome/index.js'
@@ -1,12 +1,12 @@
1
1
  export * as assert from './assert/index.js'
2
2
  export * as cast from './cast/index.js'
3
+ export * as connection from './connection/index.js'
3
4
  export * as crawler from './crawler/index.js'
4
5
  export * as crossenv from './crossenv/index.js'
6
+ export * as dataSize from './data-size/index.js'
5
7
  export * as isConstructorFunction from './is-constructor-function/index.js'
6
8
  export * as isNullish from './is-nullish/index.js'
7
9
  export * as logs from './logs/index.js'
8
10
  export * as loremIpsum from './lorem-ipsum/index.js'
9
- export * as connection from './connection/index.js'
10
- export * as dataSize from './data-size/index.js'
11
- export * as outcome from './outcome/index.js'
12
11
  export * as normalizeExtension from './normalize-extension/index.js'
12
+ export * as outcome from './outcome/index.js'
@@ -7,7 +7,7 @@ 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
  *
10
- * @param {unknown} input - The value to check.
11
- * @returns {input is ConstructorFunction} `true` if the input is a constructor function, otherwise `false`.
10
+ * @param input - The value to check.
11
+ * @returns `true` if the input is a constructor function, otherwise `false`.
12
12
  */
13
13
  export declare function isConstructorFunction(input: unknown): input is ConstructorFunction;
@@ -1,8 +1,9 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access */
1
2
  /**
2
3
  * Checks whether a given value is a constructor function (i.e., a class or function with a prototype).
3
4
  *
4
- * @param {unknown} input - The value to check.
5
- * @returns {input is ConstructorFunction} `true` if the input is a constructor function, otherwise `false`.
5
+ * @param input - The value to check.
6
+ * @returns `true` if the input is a constructor function, otherwise `false`.
6
7
  */
7
8
  export function isConstructorFunction(input) {
8
9
  return typeof input === 'function'
@@ -14,11 +14,11 @@ describe('isConstructorFunction', () => {
14
14
  expect(isConstructorFunction(MyClass)).toBe(true);
15
15
  });
16
16
  it('returns true for regular functions', () => {
17
- function regularFunction() { }
17
+ const regularFunction = function () { return undefined; };
18
18
  expect(isConstructorFunction(regularFunction)).toBe(true);
19
19
  });
20
20
  it('returns false for arrow functions', () => {
21
- const arrowFunction = () => { };
21
+ const arrowFunction = () => undefined;
22
22
  expect(isConstructorFunction(arrowFunction)).toBe(false);
23
23
  });
24
24
  it('returns false for non-functions', () => {
@@ -12,15 +12,15 @@ export type Nullish = null | undefined;
12
12
  * Checks whether a value is nullish (`null` or `undefined`).
13
13
  *
14
14
  * @template T
15
- * @param {T | Nullish} val - The value to check.
16
- * @returns {val is Nullish} `true` if the value is nullish, otherwise `false`.
15
+ * @param val - The value to check.
16
+ * @returns `true` if the value is nullish, otherwise `false`.
17
17
  */
18
- export declare function isNullish<T>(val: T | Nullish): val is Nullish;
18
+ export declare function isNullish(val: unknown): val is Nullish;
19
19
  /**
20
20
  * Checks whether a value is not nullish (`null` or `undefined`).
21
21
  *
22
22
  * @template T
23
- * @param {T} val - The value to check.
24
- * @returns {val is Exclude<T, Nullish>} `true` if the value is not nullish, otherwise `false`.
23
+ * @param val - The value to check.
24
+ * @returns `true` if the value is not nullish, otherwise `false`.
25
25
  */
26
26
  export declare function isNotNullish<T>(val: T): val is Exclude<T, Nullish>;
@@ -8,18 +8,19 @@ export const nullishValues = [null, undefined];
8
8
  * Checks whether a value is nullish (`null` or `undefined`).
9
9
  *
10
10
  * @template T
11
- * @param {T | Nullish} val - The value to check.
12
- * @returns {val is Nullish} `true` if the value is nullish, otherwise `false`.
11
+ * @param val - The value to check.
12
+ * @returns `true` if the value is nullish, otherwise `false`.
13
13
  */
14
14
  export function isNullish(val) {
15
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Array.includes() does a strict equality check regardless of this cast; safe for any T
15
16
  return nullishValues.includes(val);
16
17
  }
17
18
  /**
18
19
  * Checks whether a value is not nullish (`null` or `undefined`).
19
20
  *
20
21
  * @template T
21
- * @param {T} val - The value to check.
22
- * @returns {val is Exclude<T, Nullish>} `true` if the value is not nullish, otherwise `false`.
22
+ * @param val - The value to check.
23
+ * @returns `true` if the value is not nullish, otherwise `false`.
23
24
  */
24
25
  export function isNotNullish(val) {
25
26
  return !isNullish(val);
@@ -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'
@@ -12,7 +12,7 @@ class Log {
12
12
  this.stack = (new Error().stack ?? '');
13
13
  }
14
14
  get displayTime() {
15
- return this.time.toLocaleDateString('en-US', {
15
+ return `${this.time.toLocaleDateString('en-US', {
16
16
  year: 'numeric',
17
17
  month: 'short',
18
18
  day: 'numeric',
@@ -20,7 +20,7 @@ class Log {
20
20
  hour: 'numeric',
21
21
  minute: 'numeric',
22
22
  second: 'numeric'
23
- }) + `:${this.time.getMilliseconds()}`;
23
+ })}:${this.time.getMilliseconds()}`;
24
24
  }
25
25
  get elapsedTimeMs() {
26
26
  return (this.time.getTime() - logsTimeOrigin.getTime()) / 1000;
@@ -26,7 +26,7 @@ export const words = [
26
26
  export const generateSentence = (wordCount) => {
27
27
  const resultArr = [];
28
28
  let currentWordCound = wordCount;
29
- for (let i = 0; i < currentWordCound; i++) {
29
+ for (let i = 0; i < currentWordCound; i = i + 1) {
30
30
  const picked = randomPick(words);
31
31
  if (typeof picked === 'string')
32
32
  resultArr.push(picked);
@@ -37,8 +37,8 @@ export const generateSentence = (wordCount) => {
37
37
  const [firstWord, ...otherWords] = resultArr;
38
38
  if (firstWord === undefined)
39
39
  return '';
40
- const capFirstLetter = firstWord?.charAt(0).toUpperCase();
41
- const restOfFirstWord = firstWord?.slice(1);
40
+ const capFirstLetter = firstWord.charAt(0).toUpperCase();
41
+ const restOfFirstWord = firstWord.slice(1);
42
42
  const sentence = [
43
43
  `${capFirstLetter}${restOfFirstWord}`,
44
44
  ...otherWords
@@ -47,7 +47,7 @@ export const generateSentence = (wordCount) => {
47
47
  };
48
48
  export const generateSentences = (sentencesCount, maxSentenceLength = 12, minSentenceLength = 4) => {
49
49
  const sentences = [];
50
- for (let i = 0; i < sentencesCount; i++) {
50
+ for (let i = 0; i < sentencesCount; i = i + 1) {
51
51
  const length = randomInt(maxSentenceLength, minSentenceLength) ?? 8;
52
52
  sentences.push(generateSentence(length));
53
53
  }
@@ -4,8 +4,8 @@
4
4
  * Converts the extension to lowercase, removes a leading dot if present,
5
5
  * and applies alias mapping if defined.
6
6
  *
7
- * @param {string} extWithoutDot - File extension to normalize (may include or omit leading dot).
8
- * @param {Record<string, string>} [aliasesWithoutDot=defaultAliases] - Optional mapping of aliases to canonical extensions.
9
- * @returns {string} The normalized file extension, without leading dot.
7
+ * @param extWithoutDot - File extension to normalize (may include or omit leading dot).
8
+ * @param [aliasesWithoutDot=defaultAliases] - Optional mapping of aliases to canonical extensions.
9
+ * @returns The normalized file extension, without leading dot.
10
10
  */
11
11
  export declare function normalizeExtension(extWithoutDot: string, aliasesWithoutDot?: Record<string, string>): string;
@@ -91,11 +91,11 @@ const defaultAliases = {
91
91
  * Converts the extension to lowercase, removes a leading dot if present,
92
92
  * and applies alias mapping if defined.
93
93
  *
94
- * @param {string} extWithoutDot - File extension to normalize (may include or omit leading dot).
95
- * @param {Record<string, string>} [aliasesWithoutDot=defaultAliases] - Optional mapping of aliases to canonical extensions.
96
- * @returns {string} The normalized file extension, without leading dot.
94
+ * @param extWithoutDot - File extension to normalize (may include or omit leading dot).
95
+ * @param [aliasesWithoutDot=defaultAliases] - Optional mapping of aliases to canonical extensions.
96
+ * @returns The normalized file extension, without leading dot.
97
97
  */
98
98
  export function normalizeExtension(extWithoutDot, aliasesWithoutDot = defaultAliases) {
99
- const cleaned = extWithoutDot.toLowerCase().replace(/^\./, '');
99
+ const cleaned = extWithoutDot.toLowerCase().replace(/^\./v, '');
100
100
  return aliasesWithoutDot[cleaned] ?? cleaned;
101
101
  }
@@ -2,10 +2,10 @@
2
2
  * Represents a successful outcome.
3
3
  *
4
4
  * @template Payload - The type of the success payload.
5
- * @property {true} success - Always `true`.
6
- * @property {Payload} payload - The success value.
5
+ * @property success - Always `true`.
6
+ * @property payload - The success value.
7
7
  */
8
- export type Success<Payload = any> = {
8
+ export type Success<Payload = unknown> = {
9
9
  success: true;
10
10
  payload: Payload;
11
11
  };
@@ -13,10 +13,10 @@ export type Success<Payload = any> = {
13
13
  * Represents a failed outcome.
14
14
  *
15
15
  * @template Error - The type of the error.
16
- * @property {false} success - Always `false`.
17
- * @property {Error} error - The error value.
16
+ * @property success - Always `false`.
17
+ * @property error - The error value.
18
18
  */
19
- export type Failure<Error = any> = {
19
+ export type Failure<Error = unknown> = {
20
20
  success: false;
21
21
  error: Error;
22
22
  };
@@ -26,21 +26,21 @@ export type Failure<Error = any> = {
26
26
  * @template Payload - Type of success payload.
27
27
  * @template Error - Type of error.
28
28
  */
29
- export type Either<Payload = any, Error = any> = Success<Payload> | Failure<Error>;
29
+ export type Either<Payload = unknown, Error = unknown> = Success<Payload> | Failure<Error>;
30
30
  /**
31
31
  * Creates a success outcome with the given payload.
32
32
  *
33
33
  * @template Payload
34
- * @param {Payload} payload - The success value.
35
- * @returns {Success<Payload>} A success outcome object.
34
+ * @param payload - The success value.
35
+ * @returns A success outcome object.
36
36
  */
37
37
  export declare function makeSuccess<Payload>(payload: Payload): Success<Payload>;
38
38
  /**
39
39
  * Creates a failure outcome with the given error.
40
40
  *
41
41
  * @template Error
42
- * @param {Error} error - The error value.
43
- * @returns {Failure<Error>} A failure outcome object.
42
+ * @param error - The error value.
43
+ * @returns A failure outcome object.
44
44
  */
45
45
  export declare function makeFailure<Error>(error: Error): Failure<Error>;
46
46
  /**
@@ -48,9 +48,9 @@ export declare function makeFailure<Error>(error: Error): Failure<Error>;
48
48
  *
49
49
  * @template Payload
50
50
  * @template Error
51
- * @param {boolean} success - `true` to create a success, `false` to create a failure.
52
- * @param {Payload | Error} payloadOrError - The payload if success, or the error if failure.
53
- * @returns {Either<Payload, Error>} The resulting outcome.
51
+ * @param success - `true` to create a success, `false` to create a failure.
52
+ * @param payloadOrError - The payload if success, or the error if failure.
53
+ * @returns The resulting outcome.
54
54
  */
55
55
  export declare function make<Payload>(success: true, payload: Payload): Success<Payload>;
56
56
  export declare function make<Error>(success: false, error: Error): Failure<Error>;
@@ -2,20 +2,22 @@
2
2
  * Creates a success outcome with the given payload.
3
3
  *
4
4
  * @template Payload
5
- * @param {Payload} payload - The success value.
6
- * @returns {Success<Payload>} A success outcome object.
5
+ * @param payload - The success value.
6
+ * @returns A success outcome object.
7
7
  */
8
8
  export function makeSuccess(payload) { return { success: true, payload }; }
9
9
  /**
10
10
  * Creates a failure outcome with the given error.
11
11
  *
12
12
  * @template Error
13
- * @param {Error} error - The error value.
14
- * @returns {Failure<Error>} A failure outcome object.
13
+ * @param error - The error value.
14
+ * @returns A failure outcome object.
15
15
  */
16
16
  export function makeFailure(error) { return { success: false, error }; }
17
17
  export function make(success, payloadOrError) {
18
18
  return success
19
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- guaranteed by the overload signatures above; the implementation signature can't express that link
19
20
  ? makeSuccess(payloadOrError)
21
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- guaranteed by the overload signatures above; the implementation signature can't express that link
20
22
  : makeFailure(payloadOrError);
21
23
  }
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Computes the modulo of a number, always returning a non-negative result.
3
3
  *
4
- * @param {number} nbr - The number to modulo.
5
- * @param {number} modulo - The modulus.
6
- * @returns {number} The non-negative remainder of `nbr` modulo `modulo`.
4
+ * @param nbr - The number to modulo.
5
+ * @param modulo - The modulus.
6
+ * @returns The non-negative remainder of `nbr` modulo `modulo`.
7
7
  */
8
8
  export declare function absoluteModulo(nbr: number, modulo: number): number;
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * Computes the modulo of a number, always returning a non-negative result.
3
3
  *
4
- * @param {number} nbr - The number to modulo.
5
- * @param {number} modulo - The modulus.
6
- * @returns {number} The non-negative remainder of `nbr` modulo `modulo`.
4
+ * @param nbr - The number to modulo.
5
+ * @param modulo - The modulus.
6
+ * @returns The non-negative remainder of `nbr` modulo `modulo`.
7
7
  */
8
8
  export function absoluteModulo(nbr, modulo) {
9
9
  return ((nbr % modulo) + modulo) % modulo;
@@ -4,9 +4,9 @@
4
4
  * Uses a naive algorithm that increments the numerator or denominator each round
5
5
  * to find the closest approximation. Stops early if an exact match is found.
6
6
  *
7
- * @param {number} target - The decimal number to approximate.
8
- * @param {number} maxRounds - The maximum number of iterations to perform.
9
- * @returns {[number, number]} A tuple `[numerator, denominator]` representing the rational approximation.
7
+ * @param target - The decimal number to approximate.
8
+ * @param maxRounds - The maximum number of iterations to perform.
9
+ * @returns A tuple `[numerator, denominator]` representing the rational approximation.
10
10
  */
11
11
  export declare function approximateRationalDumb(target: number, maxRounds: number): [number, number];
12
12
  /**
@@ -15,8 +15,8 @@ export declare function approximateRationalDumb(target: number, maxRounds: numbe
15
15
  * Uses the continued fractions algorithm to find the best rational approximation
16
16
  * of a decimal number within the specified maximum denominator limit.
17
17
  *
18
- * @param {number} target - The decimal number to approximate.
19
- * @param {number} [maxDenominator=1000] - The maximum allowed denominator value.
20
- * @returns {[number, number]} A tuple `[numerator, denominator]` representing the rational approximation.
18
+ * @param target - The decimal number to approximate.
19
+ * @param [maxDenominator=1000] - The maximum allowed denominator value.
20
+ * @returns A tuple `[numerator, denominator]` representing the rational approximation.
21
21
  */
22
22
  export declare function approximateRational(target: number, maxDenominator?: number): [number, number];