ts-data-forge 8.0.0 → 9.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (429) hide show
  1. package/dist/array/impl/array-utils-creation.d.mts.map +1 -1
  2. package/dist/array/impl/array-utils-creation.mjs +17 -112
  3. package/dist/array/impl/array-utils-creation.mjs.map +1 -1
  4. package/dist/array/impl/array-utils-element-access.d.mts.map +1 -1
  5. package/dist/array/impl/array-utils-element-access.mjs +22 -61
  6. package/dist/array/impl/array-utils-element-access.mjs.map +1 -1
  7. package/dist/array/impl/array-utils-iterators.d.mts.map +1 -1
  8. package/dist/array/impl/array-utils-iterators.mjs +9 -63
  9. package/dist/array/impl/array-utils-iterators.mjs.map +1 -1
  10. package/dist/array/impl/array-utils-modification.mjs +78 -78
  11. package/dist/array/impl/array-utils-modification.mjs.map +1 -1
  12. package/dist/array/impl/array-utils-reducing-value.mjs +95 -89
  13. package/dist/array/impl/array-utils-reducing-value.mjs.map +1 -1
  14. package/dist/array/impl/array-utils-search.mjs +100 -92
  15. package/dist/array/impl/array-utils-search.mjs.map +1 -1
  16. package/dist/array/impl/array-utils-set-op.d.mts.map +1 -1
  17. package/dist/array/impl/array-utils-set-op.mjs +31 -141
  18. package/dist/array/impl/array-utils-set-op.mjs.map +1 -1
  19. package/dist/array/impl/array-utils-size.d.mts.map +1 -1
  20. package/dist/array/impl/array-utils-size.mjs +4 -8
  21. package/dist/array/impl/array-utils-size.mjs.map +1 -1
  22. package/dist/array/impl/array-utils-slice-clamped.mjs +11 -12
  23. package/dist/array/impl/array-utils-slice-clamped.mjs.map +1 -1
  24. package/dist/array/impl/array-utils-slicing.d.mts.map +1 -1
  25. package/dist/array/impl/array-utils-slicing.mjs +44 -96
  26. package/dist/array/impl/array-utils-slicing.mjs.map +1 -1
  27. package/dist/array/impl/array-utils-transformation.d.mts +1 -1
  28. package/dist/array/impl/array-utils-transformation.d.mts.map +1 -1
  29. package/dist/array/impl/array-utils-transformation.mjs +150 -292
  30. package/dist/array/impl/array-utils-transformation.mjs.map +1 -1
  31. package/dist/array/impl/array-utils-validation.d.mts.map +1 -1
  32. package/dist/array/impl/array-utils-validation.mjs +18 -169
  33. package/dist/array/impl/array-utils-validation.mjs.map +1 -1
  34. package/dist/collections/imap-mapped.d.mts.map +1 -1
  35. package/dist/collections/imap-mapped.mjs +243 -330
  36. package/dist/collections/imap-mapped.mjs.map +1 -1
  37. package/dist/collections/imap.d.mts.map +1 -1
  38. package/dist/collections/imap.mjs +190 -275
  39. package/dist/collections/imap.mjs.map +1 -1
  40. package/dist/collections/iset-mapped.d.mts +1 -1
  41. package/dist/collections/iset-mapped.d.mts.map +1 -1
  42. package/dist/collections/iset-mapped.mjs +222 -444
  43. package/dist/collections/iset-mapped.mjs.map +1 -1
  44. package/dist/collections/iset.d.mts +1 -1
  45. package/dist/collections/iset.d.mts.map +1 -1
  46. package/dist/collections/iset.mjs +158 -324
  47. package/dist/collections/iset.mjs.map +1 -1
  48. package/dist/collections/queue.d.mts.map +1 -1
  49. package/dist/collections/queue.mjs +106 -178
  50. package/dist/collections/queue.mjs.map +1 -1
  51. package/dist/collections/stack.d.mts.map +1 -1
  52. package/dist/collections/stack.mjs +95 -165
  53. package/dist/collections/stack.mjs.map +1 -1
  54. package/dist/entry-point.mjs +1 -0
  55. package/dist/entry-point.mjs.map +1 -1
  56. package/dist/expect-type.d.mts +1 -1
  57. package/dist/expect-type.d.mts.map +1 -1
  58. package/dist/expect-type.mjs +1 -69
  59. package/dist/expect-type.mjs.map +1 -1
  60. package/dist/functional/match.mjs +9 -9
  61. package/dist/functional/match.mjs.map +1 -1
  62. package/dist/functional/optional/impl/optional-expect-to-be.mjs +13 -14
  63. package/dist/functional/optional/impl/optional-expect-to-be.mjs.map +1 -1
  64. package/dist/functional/optional/impl/optional-filter.mjs +14 -15
  65. package/dist/functional/optional/impl/optional-filter.mjs.map +1 -1
  66. package/dist/functional/optional/impl/optional-flat-map.mjs +10 -11
  67. package/dist/functional/optional/impl/optional-flat-map.mjs.map +1 -1
  68. package/dist/functional/optional/impl/optional-from-nullable.d.mts.map +1 -1
  69. package/dist/functional/optional/impl/optional-from-nullable.mjs +1 -25
  70. package/dist/functional/optional/impl/optional-from-nullable.mjs.map +1 -1
  71. package/dist/functional/optional/impl/optional-is-none.d.mts.map +1 -1
  72. package/dist/functional/optional/impl/optional-is-none.mjs +0 -19
  73. package/dist/functional/optional/impl/optional-is-none.mjs.map +1 -1
  74. package/dist/functional/optional/impl/optional-is-optional.d.mts.map +1 -1
  75. package/dist/functional/optional/impl/optional-is-optional.mjs +1 -23
  76. package/dist/functional/optional/impl/optional-is-optional.mjs.map +1 -1
  77. package/dist/functional/optional/impl/optional-is-some.d.mts.map +1 -1
  78. package/dist/functional/optional/impl/optional-is-some.mjs +0 -20
  79. package/dist/functional/optional/impl/optional-is-some.mjs.map +1 -1
  80. package/dist/functional/optional/impl/optional-map.mjs +13 -14
  81. package/dist/functional/optional/impl/optional-map.mjs.map +1 -1
  82. package/dist/functional/optional/impl/optional-none.mjs +0 -16
  83. package/dist/functional/optional/impl/optional-none.mjs.map +1 -1
  84. package/dist/functional/optional/impl/optional-or-else.mjs +10 -11
  85. package/dist/functional/optional/impl/optional-or-else.mjs.map +1 -1
  86. package/dist/functional/optional/impl/optional-some.d.mts.map +1 -1
  87. package/dist/functional/optional/impl/optional-some.mjs +2 -21
  88. package/dist/functional/optional/impl/optional-some.mjs.map +1 -1
  89. package/dist/functional/optional/impl/optional-to-nullable.d.mts.map +1 -1
  90. package/dist/functional/optional/impl/optional-to-nullable.mjs +1 -27
  91. package/dist/functional/optional/impl/optional-to-nullable.mjs.map +1 -1
  92. package/dist/functional/optional/impl/optional-unwrap-or.mjs +9 -10
  93. package/dist/functional/optional/impl/optional-unwrap-or.mjs.map +1 -1
  94. package/dist/functional/optional/impl/optional-unwrap-throw.d.mts.map +1 -1
  95. package/dist/functional/optional/impl/optional-unwrap-throw.mjs +4 -32
  96. package/dist/functional/optional/impl/optional-unwrap-throw.mjs.map +1 -1
  97. package/dist/functional/optional/impl/optional-unwrap.mjs +4 -4
  98. package/dist/functional/optional/impl/optional-unwrap.mjs.map +1 -1
  99. package/dist/functional/optional/impl/optional-zip.d.mts.map +1 -1
  100. package/dist/functional/optional/impl/optional-zip.mjs +1 -35
  101. package/dist/functional/optional/impl/optional-zip.mjs.map +1 -1
  102. package/dist/functional/optional/impl/tag.mjs +2 -3
  103. package/dist/functional/optional/impl/tag.mjs.map +1 -1
  104. package/dist/functional/pipe.d.mts.map +1 -1
  105. package/dist/functional/pipe.mjs +9 -34
  106. package/dist/functional/pipe.mjs.map +1 -1
  107. package/dist/functional/result/impl/result-err.d.mts.map +1 -1
  108. package/dist/functional/result/impl/result-err.mjs +2 -27
  109. package/dist/functional/result/impl/result-err.mjs.map +1 -1
  110. package/dist/functional/result/impl/result-expect-to-be.mjs +13 -15
  111. package/dist/functional/result/impl/result-expect-to-be.mjs.map +1 -1
  112. package/dist/functional/result/impl/result-flat-map.mjs +16 -16
  113. package/dist/functional/result/impl/result-flat-map.mjs.map +1 -1
  114. package/dist/functional/result/impl/result-fold.mjs +16 -16
  115. package/dist/functional/result/impl/result-fold.mjs.map +1 -1
  116. package/dist/functional/result/impl/result-from-promise.d.mts.map +1 -1
  117. package/dist/functional/result/impl/result-from-promise.mjs +4 -31
  118. package/dist/functional/result/impl/result-from-promise.mjs.map +1 -1
  119. package/dist/functional/result/impl/result-from-throwable.d.mts.map +1 -1
  120. package/dist/functional/result/impl/result-from-throwable.mjs +8 -38
  121. package/dist/functional/result/impl/result-from-throwable.mjs.map +1 -1
  122. package/dist/functional/result/impl/result-is-err.d.mts.map +1 -1
  123. package/dist/functional/result/impl/result-is-err.mjs +0 -19
  124. package/dist/functional/result/impl/result-is-err.mjs.map +1 -1
  125. package/dist/functional/result/impl/result-is-ok.d.mts.map +1 -1
  126. package/dist/functional/result/impl/result-is-ok.mjs +0 -19
  127. package/dist/functional/result/impl/result-is-ok.mjs.map +1 -1
  128. package/dist/functional/result/impl/result-is-result.d.mts.map +1 -1
  129. package/dist/functional/result/impl/result-is-result.mjs +1 -23
  130. package/dist/functional/result/impl/result-is-result.mjs.map +1 -1
  131. package/dist/functional/result/impl/result-map-err.mjs +16 -16
  132. package/dist/functional/result/impl/result-map-err.mjs.map +1 -1
  133. package/dist/functional/result/impl/result-map.mjs +16 -16
  134. package/dist/functional/result/impl/result-map.mjs.map +1 -1
  135. package/dist/functional/result/impl/result-ok.d.mts.map +1 -1
  136. package/dist/functional/result/impl/result-ok.mjs +2 -27
  137. package/dist/functional/result/impl/result-ok.mjs.map +1 -1
  138. package/dist/functional/result/impl/result-or-else.mjs +10 -12
  139. package/dist/functional/result/impl/result-or-else.mjs.map +1 -1
  140. package/dist/functional/result/impl/result-swap.d.mts.map +1 -1
  141. package/dist/functional/result/impl/result-swap.mjs +4 -22
  142. package/dist/functional/result/impl/result-swap.mjs.map +1 -1
  143. package/dist/functional/result/impl/result-to-optional.d.mts.map +1 -1
  144. package/dist/functional/result/impl/result-to-optional.mjs +0 -27
  145. package/dist/functional/result/impl/result-to-optional.mjs.map +1 -1
  146. package/dist/functional/result/impl/result-unwrap-err-or.mjs +9 -11
  147. package/dist/functional/result/impl/result-unwrap-err-or.mjs.map +1 -1
  148. package/dist/functional/result/impl/result-unwrap-err-throw.d.mts.map +1 -1
  149. package/dist/functional/result/impl/result-unwrap-err-throw.mjs +13 -40
  150. package/dist/functional/result/impl/result-unwrap-err-throw.mjs.map +1 -1
  151. package/dist/functional/result/impl/result-unwrap-err.d.mts.map +1 -1
  152. package/dist/functional/result/impl/result-unwrap-err.mjs +4 -32
  153. package/dist/functional/result/impl/result-unwrap-err.mjs.map +1 -1
  154. package/dist/functional/result/impl/result-unwrap-ok-or.mjs +9 -11
  155. package/dist/functional/result/impl/result-unwrap-ok-or.mjs.map +1 -1
  156. package/dist/functional/result/impl/result-unwrap-ok.mjs +4 -4
  157. package/dist/functional/result/impl/result-unwrap-ok.mjs.map +1 -1
  158. package/dist/functional/result/impl/result-unwrap-throw.d.mts.map +1 -1
  159. package/dist/functional/result/impl/result-unwrap-throw.mjs +4 -35
  160. package/dist/functional/result/impl/result-unwrap-throw.mjs.map +1 -1
  161. package/dist/functional/result/impl/result-zip.d.mts.map +1 -1
  162. package/dist/functional/result/impl/result-zip.mjs +1 -34
  163. package/dist/functional/result/impl/result-zip.mjs.map +1 -1
  164. package/dist/functional/result/impl/tag.mjs +2 -3
  165. package/dist/functional/result/impl/tag.mjs.map +1 -1
  166. package/dist/functional/ternary-result/impl/tag.mjs +3 -5
  167. package/dist/functional/ternary-result/impl/tag.mjs.map +1 -1
  168. package/dist/functional/ternary-result/impl/ternary-result-err.d.mts.map +1 -1
  169. package/dist/functional/ternary-result/impl/ternary-result-err.mjs +2 -15
  170. package/dist/functional/ternary-result/impl/ternary-result-err.mjs.map +1 -1
  171. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.mjs +13 -13
  172. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.mjs.map +1 -1
  173. package/dist/functional/ternary-result/impl/ternary-result-flat-map.mjs +27 -26
  174. package/dist/functional/ternary-result/impl/ternary-result-flat-map.mjs.map +1 -1
  175. package/dist/functional/ternary-result/impl/ternary-result-fold.mjs +21 -22
  176. package/dist/functional/ternary-result/impl/ternary-result-fold.mjs.map +1 -1
  177. package/dist/functional/ternary-result/impl/ternary-result-from-promise.d.mts.map +1 -1
  178. package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs +4 -20
  179. package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs.map +1 -1
  180. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts.map +1 -1
  181. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs +7 -25
  182. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs.map +1 -1
  183. package/dist/functional/ternary-result/impl/ternary-result-is-err.d.mts.map +1 -1
  184. package/dist/functional/ternary-result/impl/ternary-result-is-err.mjs +0 -17
  185. package/dist/functional/ternary-result/impl/ternary-result-is-err.mjs.map +1 -1
  186. package/dist/functional/ternary-result/impl/ternary-result-is-ok.d.mts.map +1 -1
  187. package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs +0 -19
  188. package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs.map +1 -1
  189. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts.map +1 -1
  190. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs +1 -25
  191. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs.map +1 -1
  192. package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts.map +1 -1
  193. package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs +0 -18
  194. package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs.map +1 -1
  195. package/dist/functional/ternary-result/impl/ternary-result-map-err.mjs +13 -15
  196. package/dist/functional/ternary-result/impl/ternary-result-map-err.mjs.map +1 -1
  197. package/dist/functional/ternary-result/impl/ternary-result-map-warn.mjs +18 -18
  198. package/dist/functional/ternary-result/impl/ternary-result-map-warn.mjs.map +1 -1
  199. package/dist/functional/ternary-result/impl/ternary-result-map.mjs +21 -22
  200. package/dist/functional/ternary-result/impl/ternary-result-map.mjs.map +1 -1
  201. package/dist/functional/ternary-result/impl/ternary-result-ok.d.mts.map +1 -1
  202. package/dist/functional/ternary-result/impl/ternary-result-ok.mjs +2 -16
  203. package/dist/functional/ternary-result/impl/ternary-result-ok.mjs.map +1 -1
  204. package/dist/functional/ternary-result/impl/ternary-result-or-else.mjs +9 -9
  205. package/dist/functional/ternary-result/impl/ternary-result-or-else.mjs.map +1 -1
  206. package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts.map +1 -1
  207. package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs +4 -22
  208. package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs.map +1 -1
  209. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.mjs +9 -9
  210. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.mjs.map +1 -1
  211. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.d.mts.map +1 -1
  212. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs +12 -27
  213. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs.map +1 -1
  214. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.d.mts.map +1 -1
  215. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs +4 -19
  216. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs.map +1 -1
  217. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mjs +9 -9
  218. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mjs.map +1 -1
  219. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.mjs +4 -5
  220. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.mjs.map +1 -1
  221. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.d.mts.map +1 -1
  222. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs +15 -27
  223. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs.map +1 -1
  224. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mjs +9 -9
  225. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mjs.map +1 -1
  226. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.d.mts.map +1 -1
  227. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs +10 -24
  228. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs.map +1 -1
  229. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.d.mts.map +1 -1
  230. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs +4 -19
  231. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs.map +1 -1
  232. package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts.map +1 -1
  233. package/dist/functional/ternary-result/impl/ternary-result-warn.mjs +3 -19
  234. package/dist/functional/ternary-result/impl/ternary-result-warn.mjs.map +1 -1
  235. package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts.map +1 -1
  236. package/dist/functional/ternary-result/impl/ternary-result-zip.mjs +14 -45
  237. package/dist/functional/ternary-result/impl/ternary-result-zip.mjs.map +1 -1
  238. package/dist/functional/ternary-result/impl/variant-name.d.mts +1 -1
  239. package/dist/functional/ternary-result/impl/variant-name.d.mts.map +1 -1
  240. package/dist/functional/ternary-result/impl/variant-name.mjs +8 -9
  241. package/dist/functional/ternary-result/impl/variant-name.mjs.map +1 -1
  242. package/dist/functional/ternary-result/ternary-result.d.mts.map +1 -1
  243. package/dist/guard/has-key.d.mts.map +1 -1
  244. package/dist/guard/has-key.mjs +0 -41
  245. package/dist/guard/has-key.mjs.map +1 -1
  246. package/dist/guard/index.d.mts +1 -0
  247. package/dist/guard/index.d.mts.map +1 -1
  248. package/dist/guard/index.mjs +1 -0
  249. package/dist/guard/index.mjs.map +1 -1
  250. package/dist/guard/is-length-bounded-string.d.mts +164 -0
  251. package/dist/guard/is-length-bounded-string.d.mts.map +1 -0
  252. package/dist/guard/is-length-bounded-string.mjs +7 -0
  253. package/dist/guard/is-length-bounded-string.mjs.map +1 -0
  254. package/dist/guard/is-non-empty-string.d.mts +1 -1
  255. package/dist/guard/is-non-empty-string.d.mts.map +1 -1
  256. package/dist/guard/is-non-empty-string.mjs +1 -38
  257. package/dist/guard/is-non-empty-string.mjs.map +1 -1
  258. package/dist/guard/is-non-null-object.d.mts.map +1 -1
  259. package/dist/guard/is-non-null-object.mjs +1 -35
  260. package/dist/guard/is-non-null-object.mjs.map +1 -1
  261. package/dist/guard/is-primitive.d.mts.map +1 -1
  262. package/dist/guard/is-primitive.mjs +12 -43
  263. package/dist/guard/is-primitive.mjs.map +1 -1
  264. package/dist/guard/is-record.d.mts.map +1 -1
  265. package/dist/guard/is-record.mjs +0 -86
  266. package/dist/guard/is-record.mjs.map +1 -1
  267. package/dist/guard/is-type.d.mts.map +1 -1
  268. package/dist/guard/is-type.mjs +12 -399
  269. package/dist/guard/is-type.mjs.map +1 -1
  270. package/dist/guard/key-is-in.d.mts.map +1 -1
  271. package/dist/guard/key-is-in.mjs +0 -40
  272. package/dist/guard/key-is-in.mjs.map +1 -1
  273. package/dist/index.mjs +1 -0
  274. package/dist/index.mjs.map +1 -1
  275. package/dist/iterator/range.mjs +16 -16
  276. package/dist/iterator/range.mjs.map +1 -1
  277. package/dist/json/json.d.mts.map +1 -1
  278. package/dist/json/json.mjs +52 -340
  279. package/dist/json/json.mjs.map +1 -1
  280. package/dist/number/branded-types/finite-number.d.mts +3 -3
  281. package/dist/number/branded-types/finite-number.mjs +135 -154
  282. package/dist/number/branded-types/finite-number.mjs.map +1 -1
  283. package/dist/number/branded-types/int.d.mts +4 -4
  284. package/dist/number/branded-types/int.mjs +205 -245
  285. package/dist/number/branded-types/int.mjs.map +1 -1
  286. package/dist/number/branded-types/int16.d.mts +15 -15
  287. package/dist/number/branded-types/int16.mjs +116 -123
  288. package/dist/number/branded-types/int16.mjs.map +1 -1
  289. package/dist/number/branded-types/int32.d.mts +11 -11
  290. package/dist/number/branded-types/int32.mjs +116 -123
  291. package/dist/number/branded-types/int32.mjs.map +1 -1
  292. package/dist/number/branded-types/negative-finite-number.d.mts +4 -4
  293. package/dist/number/branded-types/negative-finite-number.mjs +129 -144
  294. package/dist/number/branded-types/negative-finite-number.mjs.map +1 -1
  295. package/dist/number/branded-types/negative-int.d.mts +5 -5
  296. package/dist/number/branded-types/negative-int.mjs +94 -113
  297. package/dist/number/branded-types/negative-int.mjs.map +1 -1
  298. package/dist/number/branded-types/negative-safe-int.d.mts +5 -5
  299. package/dist/number/branded-types/negative-safe-int.mjs +103 -124
  300. package/dist/number/branded-types/negative-safe-int.mjs.map +1 -1
  301. package/dist/number/branded-types/non-negative-finite-number.d.mts +5 -5
  302. package/dist/number/branded-types/non-negative-finite-number.mjs +136 -142
  303. package/dist/number/branded-types/non-negative-finite-number.mjs.map +1 -1
  304. package/dist/number/branded-types/non-negative-int16.d.mts +16 -16
  305. package/dist/number/branded-types/non-negative-int16.mjs +109 -118
  306. package/dist/number/branded-types/non-negative-int16.mjs.map +1 -1
  307. package/dist/number/branded-types/non-negative-int32.d.mts +12 -12
  308. package/dist/number/branded-types/non-negative-int32.mjs +110 -119
  309. package/dist/number/branded-types/non-negative-int32.mjs.map +1 -1
  310. package/dist/number/branded-types/non-positive-finite-number.d.mts +3 -3
  311. package/dist/number/branded-types/non-positive-finite-number.mjs +120 -124
  312. package/dist/number/branded-types/non-positive-finite-number.mjs.map +1 -1
  313. package/dist/number/branded-types/non-positive-int.d.mts +4 -4
  314. package/dist/number/branded-types/non-positive-int.mjs +167 -212
  315. package/dist/number/branded-types/non-positive-int.mjs.map +1 -1
  316. package/dist/number/branded-types/non-positive-safe-int.d.mts +4 -4
  317. package/dist/number/branded-types/non-positive-safe-int.mjs +95 -106
  318. package/dist/number/branded-types/non-positive-safe-int.mjs.map +1 -1
  319. package/dist/number/branded-types/non-zero-finite-number.d.mts +4 -4
  320. package/dist/number/branded-types/non-zero-finite-number.mjs +114 -123
  321. package/dist/number/branded-types/non-zero-finite-number.mjs.map +1 -1
  322. package/dist/number/branded-types/non-zero-int.d.mts +2 -2
  323. package/dist/number/branded-types/non-zero-int.mjs +72 -83
  324. package/dist/number/branded-types/non-zero-int.mjs.map +1 -1
  325. package/dist/number/branded-types/non-zero-int16.d.mts +7 -7
  326. package/dist/number/branded-types/non-zero-int16.mjs +96 -107
  327. package/dist/number/branded-types/non-zero-int16.mjs.map +1 -1
  328. package/dist/number/branded-types/non-zero-int32.d.mts +5 -5
  329. package/dist/number/branded-types/non-zero-int32.mjs +97 -108
  330. package/dist/number/branded-types/non-zero-int32.mjs.map +1 -1
  331. package/dist/number/branded-types/non-zero-safe-int.d.mts +2 -2
  332. package/dist/number/branded-types/non-zero-safe-int.mjs +100 -111
  333. package/dist/number/branded-types/non-zero-safe-int.mjs.map +1 -1
  334. package/dist/number/branded-types/non-zero-uint16.d.mts +8 -8
  335. package/dist/number/branded-types/non-zero-uint16.mjs +96 -107
  336. package/dist/number/branded-types/non-zero-uint16.mjs.map +1 -1
  337. package/dist/number/branded-types/non-zero-uint32.d.mts +6 -6
  338. package/dist/number/branded-types/non-zero-uint32.mjs +96 -107
  339. package/dist/number/branded-types/non-zero-uint32.mjs.map +1 -1
  340. package/dist/number/branded-types/positive-finite-number.d.mts +8 -8
  341. package/dist/number/branded-types/positive-finite-number.mjs +139 -141
  342. package/dist/number/branded-types/positive-finite-number.mjs.map +1 -1
  343. package/dist/number/branded-types/positive-int.d.mts +11 -11
  344. package/dist/number/branded-types/positive-int.mjs +228 -271
  345. package/dist/number/branded-types/positive-int.mjs.map +1 -1
  346. package/dist/number/branded-types/positive-int16.d.mts +19 -19
  347. package/dist/number/branded-types/positive-int16.mjs +109 -118
  348. package/dist/number/branded-types/positive-int16.mjs.map +1 -1
  349. package/dist/number/branded-types/positive-int32.d.mts +15 -15
  350. package/dist/number/branded-types/positive-int32.mjs +109 -118
  351. package/dist/number/branded-types/positive-int32.mjs.map +1 -1
  352. package/dist/number/branded-types/positive-safe-int.d.mts +11 -11
  353. package/dist/number/branded-types/positive-safe-int.mjs +244 -275
  354. package/dist/number/branded-types/positive-safe-int.mjs.map +1 -1
  355. package/dist/number/branded-types/positive-uint16.d.mts +17 -17
  356. package/dist/number/branded-types/positive-uint16.mjs +109 -118
  357. package/dist/number/branded-types/positive-uint16.mjs.map +1 -1
  358. package/dist/number/branded-types/positive-uint32.d.mts +13 -13
  359. package/dist/number/branded-types/positive-uint32.mjs +110 -119
  360. package/dist/number/branded-types/positive-uint32.mjs.map +1 -1
  361. package/dist/number/branded-types/safe-int.d.mts +4 -4
  362. package/dist/number/branded-types/safe-int.mjs +251 -292
  363. package/dist/number/branded-types/safe-int.mjs.map +1 -1
  364. package/dist/number/branded-types/safe-uint.d.mts +8 -8
  365. package/dist/number/branded-types/safe-uint.mjs +111 -119
  366. package/dist/number/branded-types/safe-uint.mjs.map +1 -1
  367. package/dist/number/branded-types/uint.d.mts +8 -8
  368. package/dist/number/branded-types/uint.mjs +198 -225
  369. package/dist/number/branded-types/uint.mjs.map +1 -1
  370. package/dist/number/branded-types/uint16.d.mts +14 -14
  371. package/dist/number/branded-types/uint16.mjs +109 -119
  372. package/dist/number/branded-types/uint16.mjs.map +1 -1
  373. package/dist/number/branded-types/uint32.d.mts +10 -10
  374. package/dist/number/branded-types/uint32.mjs +110 -117
  375. package/dist/number/branded-types/uint32.mjs.map +1 -1
  376. package/dist/number/enum/int8.mjs +119 -145
  377. package/dist/number/enum/int8.mjs.map +1 -1
  378. package/dist/number/enum/uint8.mjs +107 -121
  379. package/dist/number/enum/uint8.mjs.map +1 -1
  380. package/dist/number/num.d.mts +2 -2
  381. package/dist/number/num.d.mts.map +1 -1
  382. package/dist/number/num.mjs +76 -537
  383. package/dist/number/num.mjs.map +1 -1
  384. package/dist/number/refined-number-utils.d.mts +1 -1
  385. package/dist/number/refined-number-utils.d.mts.map +1 -1
  386. package/dist/number/refined-number-utils.mjs +127 -263
  387. package/dist/number/refined-number-utils.mjs.map +1 -1
  388. package/dist/object/object.d.mts.map +1 -1
  389. package/dist/object/object.mjs +107 -222
  390. package/dist/object/object.mjs.map +1 -1
  391. package/dist/others/cast-mutable.d.mts.map +1 -1
  392. package/dist/others/cast-mutable.mjs +8 -37
  393. package/dist/others/cast-mutable.mjs.map +1 -1
  394. package/dist/others/cast-readonly.d.mts.map +1 -1
  395. package/dist/others/cast-readonly.mjs +8 -36
  396. package/dist/others/cast-readonly.mjs.map +1 -1
  397. package/dist/others/debounce-function.d.mts.map +1 -1
  398. package/dist/others/debounce-function.mjs +7 -16
  399. package/dist/others/debounce-function.mjs.map +1 -1
  400. package/dist/others/fast-deep-equal.d.mts.map +1 -1
  401. package/dist/others/fast-deep-equal.mjs +43 -59
  402. package/dist/others/fast-deep-equal.mjs.map +1 -1
  403. package/dist/others/if-then.d.mts.map +1 -1
  404. package/dist/others/if-then.mjs +0 -29
  405. package/dist/others/if-then.mjs.map +1 -1
  406. package/dist/others/map-nullable.mjs +9 -9
  407. package/dist/others/map-nullable.mjs.map +1 -1
  408. package/dist/others/memoize-function.mjs +12 -12
  409. package/dist/others/memoize-function.mjs.map +1 -1
  410. package/dist/others/tuple.d.mts.map +1 -1
  411. package/dist/others/tuple.mjs +0 -50
  412. package/dist/others/tuple.mjs.map +1 -1
  413. package/dist/others/unknown-to-string.d.mts.map +1 -1
  414. package/dist/others/unknown-to-string.mjs +41 -88
  415. package/dist/others/unknown-to-string.mjs.map +1 -1
  416. package/dist/promise/promise.d.mts.map +1 -1
  417. package/dist/promise/promise.mjs +4 -49
  418. package/dist/promise/promise.mjs.map +1 -1
  419. package/package.json +17 -16
  420. package/src/array/impl/array-utils-transformation.mts +1 -2
  421. package/src/array/impl/array-utils-transformation.test.mts +3 -36
  422. package/src/array/impl/array-utils-validation.test.mts +1 -3
  423. package/src/expect-type.mts +4 -5
  424. package/src/functional/ternary-result/ternary-result.mts +2 -6
  425. package/src/guard/index.mts +1 -0
  426. package/src/guard/is-length-bounded-string.mts +199 -0
  427. package/src/guard/is-length-bounded-string.test.mts +170 -0
  428. package/src/number/refined-number-utils.mts +1 -9
  429. package/src/object/object.mts +25 -23
@@ -1,15 +1,14 @@
1
1
  import { ErrTypeTagName, WarnTypeTagName, OkTypeTagName } from './tag.mjs';
2
2
 
3
- /** @internal Returns the human readable variant label for the given tag. */
4
3
  const variantName = (tag) => {
5
- switch (tag) {
6
- case OkTypeTagName:
7
- return 'Ok';
8
- case WarnTypeTagName:
9
- return 'Warn';
10
- case ErrTypeTagName:
11
- return 'Err';
12
- }
4
+ switch (tag) {
5
+ case OkTypeTagName:
6
+ return "Ok";
7
+ case WarnTypeTagName:
8
+ return "Warn";
9
+ case ErrTypeTagName:
10
+ return "Err";
11
+ }
13
12
  };
14
13
 
15
14
  export { variantName };
@@ -1 +1 @@
1
- {"version":3,"file":"variant-name.mjs","sources":["../../../../src/functional/ternary-result/impl/variant-name.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAGA;AACO,MAAM,WAAW,GAAG,CACzB,GAAkC,KACT;IACzB,QAAQ,GAAG;AACT,QAAA,KAAK,aAAa;AAChB,YAAA,OAAO,IAAI;AAEb,QAAA,KAAK,eAAe;AAClB,YAAA,OAAO,MAAM;AAEf,QAAA,KAAK,cAAc;AACjB,YAAA,OAAO,KAAK;;AAElB;;;;"}
1
+ {"version":3,"file":"variant-name.mjs","sources":["../../../../src/functional/ternary-result/impl/variant-name.mts"],"sourcesContent":["import { type UnknownTernaryResult } from '../ternary-result.mjs';\nimport { ErrTypeTagName, OkTypeTagName, WarnTypeTagName } from './tag.mjs';\n\n/** @internal Returns the human readable variant label for the given tag. */\nexport const variantName = (\n tag: UnknownTernaryResult['$$tag'],\n): 'Ok' | 'Warn' | 'Err' => {\n switch (tag) {\n case OkTypeTagName:\n return 'Ok';\n\n case WarnTypeTagName:\n return 'Warn';\n\n case ErrTypeTagName:\n return 'Err';\n }\n};\n"],"names":[],"mappings":";;AAIO,MAAM,WAAA,GAAc,CACzB,GAAA,KAC0B;AAC1B,EAAA,QAAQ,GAAA;AAAK,IACX,KAAK,aAAA;AACH,MAAA,OAAO,IAAA;AAAA,IAET,KAAK,eAAA;AACH,MAAA,OAAO,MAAA;AAAA,IAET,KAAK,cAAA;AACH,MAAA,OAAO,KAAA;AAAA;AAEb;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ternary-result.d.mts","sourceRoot":"","sources":["../../../src/functional/ternary-result/ternary-result.mts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,QAAQ,CAAC;IAClC,yDAAyD;IACzD,KAAK,EAAE,0BAA0B,CAAC;IAElC,yBAAyB;IACzB,KAAK,EAAE,CAAC,CAAC;CACV,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,EAAE,CAAC,IAAI,QAAQ,CAAC;IACvC,2DAA2D;IAC3D,KAAK,EAAE,4BAA4B,CAAC;IAEpC,yBAAyB;IACzB,KAAK,EAAE,CAAC,CAAC;IAET,yBAAyB;IACzB,OAAO,EAAE,CAAC,CAAC;CACZ,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,QAAQ,CAAC;IACnC,0DAA0D;IAC1D,KAAK,EAAE,2BAA2B,CAAC;IAEnC,uBAAuB;IACvB,KAAK,EAAE,CAAC,CAAC;CACV,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,IACjC,SAAS,CAAC,CAAC,CAAC,GACZ,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,GACjB,UAAU,CAAC,CAAC,CAAC,CAAC;AAElB;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAC5B,SAAS,CAAC,OAAO,CAAC,GAClB,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,GAC7B,UAAU,CAAC,OAAO,CAAC,CAAC;AAExB,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"ternary-result.d.mts","sourceRoot":"","sources":["../../../src/functional/ternary-result/ternary-result.mts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,QAAQ,CAAC;IAClC,yDAAyD;IACzD,KAAK,EAAE,0BAA0B,CAAC;IAElC,yBAAyB;IACzB,KAAK,EAAE,CAAC,CAAC;CACV,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,EAAE,CAAC,IAAI,QAAQ,CAAC;IACvC,2DAA2D;IAC3D,KAAK,EAAE,4BAA4B,CAAC;IAEpC,yBAAyB;IACzB,KAAK,EAAE,CAAC,CAAC;IAET,yBAAyB;IACzB,OAAO,EAAE,CAAC,CAAC;CACZ,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,QAAQ,CAAC;IACnC,0DAA0D;IAC1D,KAAK,EAAE,2BAA2B,CAAC;IAEnC,uBAAuB;IACvB,KAAK,EAAE,CAAC,CAAC;CACV,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,IACnC,SAAS,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAC9B,SAAS,CAAC,OAAO,CAAC,GAAG,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;AAE3E,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"has-key.d.mts","sourceRoot":"","sources":["../../src/guard/has-key.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,MAAM,GACjB,KAAK,CAAC,CAAC,SAAS,aAAa,EAC7B,KAAK,CAAC,CAAC,SAAS,WAAW,EAE3B,KAAK,CAAC,EACN,KAAK,CAAC,KACL,GAAG,IAAI,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAA4B,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,CAC1B,CAAC,SAAS,aAAa,EACvB,CAAC,SAAS,WAAW,IACnB,CAAC,SAAS,CAAC,GACX,CAAC,SAAS,MAAM,CAAC,GACf,MAAM,SAAS,MAAM,CAAC,GACpB,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GACjC,MAAM,SAAS,MAAM,CAAC,GACpB,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GACjC,MAAM,SAAS,MAAM,CAAC,GACpB,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GACjC,CAAC,GACP,KAAK,GACP,KAAK,CAAC"}
1
+ {"version":3,"file":"has-key.d.mts","sourceRoot":"","sources":["../../src/guard/has-key.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,MAAM,GACjB,KAAK,CAAC,CAAC,SAAS,aAAa,EAC7B,KAAK,CAAC,CAAC,SAAS,WAAW,OAEtB,CAAC,OACD,CAAC,KACL,GAAG,IAAI,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAA4B,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,CAC1B,CAAC,SAAS,aAAa,EACvB,CAAC,SAAS,WAAW,IACnB,CAAC,SAAS,CAAC,GACX,CAAC,SAAS,MAAM,CAAC,GACf,MAAM,SAAS,MAAM,CAAC,GACpB,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GACjC,MAAM,SAAS,MAAM,CAAC,GACpB,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GACjC,MAAM,SAAS,MAAM,CAAC,GACpB,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GACjC,CAAC,GACP,KAAK,GACP,KAAK,CAAC"}
@@ -1,44 +1,3 @@
1
- /**
2
- * Type guard function that checks if an object has a specific key as its own
3
- * property.
4
- *
5
- * This function uses `Object.hasOwn()` to check if the given object has the
6
- * specified key as its own property (not inherited). It acts as a type guard
7
- * that narrows the type of the object to guarantee the key exists, enabling
8
- * type-safe property access.
9
- *
10
- * **Type Narrowing Behavior:**
11
- *
12
- * - When the guard returns `true`, TypeScript narrows the object type to include
13
- * the checked key
14
- * - For union types, only union members that contain the key are preserved
15
- * - The key's value type is preserved from the original object type when possible
16
- *
17
- * @example
18
- *
19
- * ```ts
20
- * const maybeUser: Readonly<{ id?: number; name?: string }> = {
21
- * id: 42,
22
- * } as const;
23
- *
24
- * if (hasKey(maybeUser, 'id')) {
25
- * // `maybeUser` is now known to have an `id` property.
26
- * assert.isTrue(maybeUser.id === 42);
27
- * } else {
28
- * assert.fail();
29
- * }
30
- * ```
31
- *
32
- * @template R - The type of the input object, must extend UnknownRecord
33
- * @template K - The type of the key to check for, must extend PropertyKey
34
- * (string | number | symbol)
35
- * @param obj - The object to check for the presence of the key
36
- * @param key - The key to check for in the object
37
- * @returns `true` if the object has the specified key as its own property,
38
- * `false` otherwise. When `true`, TypeScript narrows the object type to
39
- * guarantee the key exists.
40
- * @see {@link keyIsIn} - Similar function that narrows the key type instead of the object type
41
- */
42
1
  const hasKey = (obj, key) => Object.hasOwn(obj, key);
43
2
 
44
3
  export { hasKey };
@@ -1 +1 @@
1
- {"version":3,"file":"has-key.mjs","sources":["../../src/guard/has-key.mts"],"sourcesContent":[null],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCG;AACI,MAAM,MAAM,GAAG,CAIpB,GAAM,EACN,GAAM,KAC4B,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG;;;;"}
1
+ {"version":3,"file":"has-key.mjs","sources":["../../src/guard/has-key.mts"],"sourcesContent":["import { type ReadonlyRecord, type UnknownRecord } from 'ts-type-forge';\n\n/**\n * Type guard function that checks if an object has a specific key as its own\n * property.\n *\n * This function uses `Object.hasOwn()` to check if the given object has the\n * specified key as its own property (not inherited). It acts as a type guard\n * that narrows the type of the object to guarantee the key exists, enabling\n * type-safe property access.\n *\n * **Type Narrowing Behavior:**\n *\n * - When the guard returns `true`, TypeScript narrows the object type to include\n * the checked key\n * - For union types, only union members that contain the key are preserved\n * - The key's value type is preserved from the original object type when possible\n *\n * @example\n *\n * ```ts\n * const maybeUser: Readonly<{ id?: number; name?: string }> = {\n * id: 42,\n * } as const;\n *\n * if (hasKey(maybeUser, 'id')) {\n * // `maybeUser` is now known to have an `id` property.\n * assert.isTrue(maybeUser.id === 42);\n * } else {\n * assert.fail();\n * }\n * ```\n *\n * @template R - The type of the input object, must extend UnknownRecord\n * @template K - The type of the key to check for, must extend PropertyKey\n * (string | number | symbol)\n * @param obj - The object to check for the presence of the key\n * @param key - The key to check for in the object\n * @returns `true` if the object has the specified key as its own property,\n * `false` otherwise. When `true`, TypeScript narrows the object type to\n * guarantee the key exists.\n * @see {@link keyIsIn} - Similar function that narrows the key type instead of the object type\n */\nexport const hasKey = <\n const R extends UnknownRecord,\n const K extends PropertyKey,\n>(\n obj: R,\n key: K,\n): obj is HasKeyReturnType<R, K> => Object.hasOwn(obj, key);\n\n/**\n * @internal\n * When R is a union type (including the case with only one element), if any element in the union\n * contains K as a key, returns a type that narrows the union to only those elements that contain K as a key.\n * If none of the elements in the union contain K as a key, returns `ReadonlyRecord<K, unknown>`.\n * The result is made readonly.\n */\nexport type HasKeyReturnType<\n R extends UnknownRecord,\n K extends PropertyKey,\n> = R extends R // union distribution\n ? K extends keyof R\n ? string extends keyof R\n ? ReadonlyRecord<K, R[keyof R]> & R\n : number extends keyof R\n ? ReadonlyRecord<K, R[keyof R]> & R\n : symbol extends keyof R\n ? ReadonlyRecord<K, R[keyof R]> & R\n : R\n : never // omit union member that does not have key K\n : never; // dummy case for union distribution\n"],"names":[],"mappings":"AA2CO,MAAM,SAAS,CAIpB,GAAA,EACA,QACkC,MAAA,CAAO,MAAA,CAAO,KAAK,GAAG;;;;"}
@@ -1,4 +1,5 @@
1
1
  export * from './has-key.mjs';
2
+ export * from './is-length-bounded-string.mjs';
2
3
  export * from './is-non-empty-string.mjs';
3
4
  export * from './is-non-null-object.mjs';
4
5
  export * from './is-primitive.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/guard/index.mts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/guard/index.mts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export { hasKey } from './has-key.mjs';
2
+ export { isBoundedLengthString, isFixedLengthString, isMaxLengthString, isMinLengthString } from './is-length-bounded-string.mjs';
2
3
  export { isNonEmptyString } from './is-non-empty-string.mjs';
3
4
  export { isNonNullObject } from './is-non-null-object.mjs';
4
5
  export { isPrimitive } from './is-primitive.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,164 @@
1
+ import { type BoundedLengthString, type FixedLengthString, type MaxLengthString, type MinLengthString } from 'ts-type-forge';
2
+ import { type SizeType } from '../types.mjs';
3
+ /**
4
+ * Type guard that checks if a string has at least `minLength` characters.
5
+ *
6
+ * The length is measured in UTF-16 code units (the same unit as
7
+ * `String.prototype.length`), so characters outside the Basic Multilingual
8
+ * Plane (e.g. emoji) count as 2.
9
+ *
10
+ * **Type Narrowing Behavior:**
11
+ *
12
+ * - Narrows the input to `MinLengthString<MinLength>` while preserving the
13
+ * original string type (e.g. literal types) via intersection.
14
+ * - The result participates in the length-constraint subtyping relation: for
15
+ * example, a value narrowed to `MinLengthString<3>` is assignable to
16
+ * `MinLengthString<1>` (= `NonEmptyString`).
17
+ *
18
+ * @example
19
+ *
20
+ * ```ts
21
+ * const input: string = 'very-secret-password';
22
+ *
23
+ * assert.isTrue(isMinLengthString(input, 12));
24
+ *
25
+ * assert.isFalse(isMinLengthString('short', 12));
26
+ *
27
+ * if (isMinLengthString(input, 12)) {
28
+ * const password: MinLengthString<12> = input;
29
+ *
30
+ * const nonEmpty: NonEmptyString = input; // OK (12 >= 1)
31
+ * }
32
+ * ```
33
+ *
34
+ * @template S - The input string type (literal types are preserved).
35
+ * @template MinLength - The minimum number of characters (inclusive).
36
+ * @param s - The string to check.
37
+ * @param minLength - The minimum number of characters (inclusive).
38
+ * @returns `true` if `s.length >= minLength`, `false` otherwise. When `true`,
39
+ * TypeScript narrows `s` to `MinLengthString<MinLength> & S`.
40
+ */
41
+ export declare const isMinLengthString: <S extends string, MinLength extends SizeType.ArgStr>(s: S, minLength: MinLength) => s is MinLengthString<MinLength> & S;
42
+ /**
43
+ * Type guard that checks if a string has at most `maxLength` characters.
44
+ *
45
+ * The length is measured in UTF-16 code units (the same unit as
46
+ * `String.prototype.length`), so characters outside the Basic Multilingual
47
+ * Plane (e.g. emoji) count as 2.
48
+ *
49
+ * **Type Narrowing Behavior:**
50
+ *
51
+ * - Narrows the input to `MaxLengthString<MaxLength>` while preserving the
52
+ * original string type (e.g. literal types) via intersection.
53
+ * - The result participates in the length-constraint subtyping relation: for
54
+ * example, a value narrowed to `MaxLengthString<16>` is assignable to
55
+ * `MaxLengthString<32>`.
56
+ *
57
+ * @example
58
+ *
59
+ * ```ts
60
+ * const input: string = 'noshiro';
61
+ *
62
+ * assert.isTrue(isMaxLengthString(input, 32));
63
+ *
64
+ * assert.isFalse(isMaxLengthString(input, 3));
65
+ *
66
+ * if (isMaxLengthString(input, 32)) {
67
+ * const userName: MaxLengthString<32> = input;
68
+ *
69
+ * const relaxed: MaxLengthString<64> = input; // OK (32 <= 64)
70
+ * }
71
+ * ```
72
+ *
73
+ * @template S - The input string type (literal types are preserved).
74
+ * @template MaxLength - The maximum number of characters (inclusive).
75
+ * @param s - The string to check.
76
+ * @param maxLength - The maximum number of characters (inclusive).
77
+ * @returns `true` if `s.length <= maxLength`, `false` otherwise. When `true`,
78
+ * TypeScript narrows `s` to `MaxLengthString<MaxLength> & S`.
79
+ */
80
+ export declare const isMaxLengthString: <S extends string, MaxLength extends SizeType.ArgStr>(s: S, maxLength: MaxLength) => s is MaxLengthString<MaxLength> & S;
81
+ /**
82
+ * Type guard that checks if a string's length is within the inclusive range
83
+ * `[minLength, maxLength]`.
84
+ *
85
+ * The length is measured in UTF-16 code units (the same unit as
86
+ * `String.prototype.length`), so characters outside the Basic Multilingual
87
+ * Plane (e.g. emoji) count as 2.
88
+ *
89
+ * **Type Narrowing Behavior:**
90
+ *
91
+ * - Narrows the input to `BoundedLengthString<MinLength, MaxLength>` while
92
+ * preserving the original string type (e.g. literal types) via intersection.
93
+ * - Since `BoundedLengthString` is the intersection of `MinLengthString` and
94
+ * `MaxLengthString`, the narrowed value is assignable to both, and both
95
+ * bounds can be weakened independently.
96
+ *
97
+ * @example
98
+ *
99
+ * ```ts
100
+ * const input: string = 'user-12345678';
101
+ *
102
+ * assert.isTrue(isBoundedLengthString(input, 8, 16));
103
+ *
104
+ * assert.isFalse(isBoundedLengthString('user', 8, 16));
105
+ *
106
+ * if (isBoundedLengthString(input, 8, 16)) {
107
+ * const userId: BoundedLengthString<8, 16> = input;
108
+ *
109
+ * const relaxed: BoundedLengthString<1, 255> = input; // OK ([8, 16] ⊆ [1, 255])
110
+ * }
111
+ * ```
112
+ *
113
+ * @template S - The input string type (literal types are preserved).
114
+ * @template MinLength - The minimum number of characters (inclusive).
115
+ * @template MaxLength - The maximum number of characters (inclusive).
116
+ * @param s - The string to check.
117
+ * @param minLength - The minimum number of characters (inclusive).
118
+ * @param maxLength - The maximum number of characters (inclusive).
119
+ * @returns `true` if `minLength <= s.length && s.length <= maxLength`, `false`
120
+ * otherwise. When `true`, TypeScript narrows `s` to
121
+ * `BoundedLengthString<MinLength, MaxLength> & S`.
122
+ */
123
+ export declare const isBoundedLengthString: <S extends string, MinLength extends SizeType.ArgStr, MaxLength extends SizeType.ArgStr>(s: S, minLength: MinLength, maxLength: MaxLength) => s is BoundedLengthString<MinLength, MaxLength> & S;
124
+ /**
125
+ * Type guard that checks if a string has exactly `length` characters.
126
+ *
127
+ * The length is measured in UTF-16 code units (the same unit as
128
+ * `String.prototype.length`), so characters outside the Basic Multilingual
129
+ * Plane (e.g. emoji) count as 2.
130
+ *
131
+ * **Type Narrowing Behavior:**
132
+ *
133
+ * - Narrows the input to `FixedLengthString<Length>` while preserving the
134
+ * original string type (e.g. literal types) via intersection.
135
+ * - Since `FixedLengthString<Length>` is defined as
136
+ * `BoundedLengthString<Length, Length>`, the narrowed value is assignable to
137
+ * any `MinLengthString<N>` with `N <= Length` and any `MaxLengthString<N>`
138
+ * with `N >= Length`.
139
+ *
140
+ * @example
141
+ *
142
+ * ```ts
143
+ * const input: string = 'JP';
144
+ *
145
+ * assert.isTrue(isFixedLengthString(input, 2));
146
+ *
147
+ * assert.isFalse(isFixedLengthString(input, 3));
148
+ *
149
+ * if (isFixedLengthString(input, 2)) {
150
+ * const countryCode: FixedLengthString<2> = input;
151
+ *
152
+ * const atMost5: MaxLengthString<5> = input; // OK (2 <= 5)
153
+ * }
154
+ * ```
155
+ *
156
+ * @template S - The input string type (literal types are preserved).
157
+ * @template Length - The exact number of characters.
158
+ * @param s - The string to check.
159
+ * @param length - The exact number of characters.
160
+ * @returns `true` if `s.length === length`, `false` otherwise. When `true`,
161
+ * TypeScript narrows `s` to `FixedLengthString<Length> & S`.
162
+ */
163
+ export declare const isFixedLengthString: <S extends string, Length extends SizeType.ArgStr>(s: S, length: Length) => s is FixedLengthString<Length> & S;
164
+ //# sourceMappingURL=is-length-bounded-string.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-length-bounded-string.d.mts","sourceRoot":"","sources":["../../src/guard/is-length-bounded-string.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,eAAe,EACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,eAAO,MAAM,iBAAiB,GAC5B,CAAC,SAAS,MAAM,EAChB,SAAS,SAAS,QAAQ,CAAC,MAAM,KAE9B,CAAC,aACO,SAAS,KACnB,CAAC,IAAI,eAAe,CAAC,SAAS,CAAC,GAAG,CAA0B,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,eAAO,MAAM,iBAAiB,GAC5B,CAAC,SAAS,MAAM,EAChB,SAAS,SAAS,QAAQ,CAAC,MAAM,KAE9B,CAAC,aACO,SAAS,KACnB,CAAC,IAAI,eAAe,CAAC,SAAS,CAAC,GAAG,CAA0B,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,eAAO,MAAM,qBAAqB,GAChC,CAAC,SAAS,MAAM,EAChB,SAAS,SAAS,QAAQ,CAAC,MAAM,EACjC,SAAS,SAAS,QAAQ,CAAC,MAAM,KAE9B,CAAC,aACO,SAAS,aACT,SAAS,KACnB,CAAC,IAAI,mBAAmB,CAAC,SAAS,EAAE,SAAS,CAAC,GAAG,CACJ,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,mBAAmB,GAC9B,CAAC,SAAS,MAAM,EAChB,MAAM,SAAS,QAAQ,CAAC,MAAM,KAE3B,CAAC,UACI,MAAM,KACb,CAAC,IAAI,iBAAiB,CAAC,MAAM,CAAC,GAAG,CAAwB,CAAC"}
@@ -0,0 +1,7 @@
1
+ const isMinLengthString = (s, minLength) => s.length >= minLength;
2
+ const isMaxLengthString = (s, maxLength) => s.length <= maxLength;
3
+ const isBoundedLengthString = (s, minLength, maxLength) => s.length >= minLength && s.length <= maxLength;
4
+ const isFixedLengthString = (s, length) => s.length === length;
5
+
6
+ export { isBoundedLengthString, isFixedLengthString, isMaxLengthString, isMinLengthString };
7
+ //# sourceMappingURL=is-length-bounded-string.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-length-bounded-string.mjs","sources":["../../src/guard/is-length-bounded-string.mts"],"sourcesContent":["import {\n type BoundedLengthString,\n type FixedLengthString,\n type MaxLengthString,\n type MinLengthString,\n} from 'ts-type-forge';\nimport { type SizeType } from '../types.mjs';\n\n/**\n * Type guard that checks if a string has at least `minLength` characters.\n *\n * The length is measured in UTF-16 code units (the same unit as\n * `String.prototype.length`), so characters outside the Basic Multilingual\n * Plane (e.g. emoji) count as 2.\n *\n * **Type Narrowing Behavior:**\n *\n * - Narrows the input to `MinLengthString<MinLength>` while preserving the\n * original string type (e.g. literal types) via intersection.\n * - The result participates in the length-constraint subtyping relation: for\n * example, a value narrowed to `MinLengthString<3>` is assignable to\n * `MinLengthString<1>` (= `NonEmptyString`).\n *\n * @example\n *\n * ```ts\n * const input: string = 'very-secret-password';\n *\n * assert.isTrue(isMinLengthString(input, 12));\n *\n * assert.isFalse(isMinLengthString('short', 12));\n *\n * if (isMinLengthString(input, 12)) {\n * const password: MinLengthString<12> = input;\n *\n * const nonEmpty: NonEmptyString = input; // OK (12 >= 1)\n * }\n * ```\n *\n * @template S - The input string type (literal types are preserved).\n * @template MinLength - The minimum number of characters (inclusive).\n * @param s - The string to check.\n * @param minLength - The minimum number of characters (inclusive).\n * @returns `true` if `s.length >= minLength`, `false` otherwise. When `true`,\n * TypeScript narrows `s` to `MinLengthString<MinLength> & S`.\n */\nexport const isMinLengthString = <\n S extends string,\n MinLength extends SizeType.ArgStr,\n>(\n s: S,\n minLength: MinLength,\n): s is MinLengthString<MinLength> & S => s.length >= minLength;\n\n/**\n * Type guard that checks if a string has at most `maxLength` characters.\n *\n * The length is measured in UTF-16 code units (the same unit as\n * `String.prototype.length`), so characters outside the Basic Multilingual\n * Plane (e.g. emoji) count as 2.\n *\n * **Type Narrowing Behavior:**\n *\n * - Narrows the input to `MaxLengthString<MaxLength>` while preserving the\n * original string type (e.g. literal types) via intersection.\n * - The result participates in the length-constraint subtyping relation: for\n * example, a value narrowed to `MaxLengthString<16>` is assignable to\n * `MaxLengthString<32>`.\n *\n * @example\n *\n * ```ts\n * const input: string = 'noshiro';\n *\n * assert.isTrue(isMaxLengthString(input, 32));\n *\n * assert.isFalse(isMaxLengthString(input, 3));\n *\n * if (isMaxLengthString(input, 32)) {\n * const userName: MaxLengthString<32> = input;\n *\n * const relaxed: MaxLengthString<64> = input; // OK (32 <= 64)\n * }\n * ```\n *\n * @template S - The input string type (literal types are preserved).\n * @template MaxLength - The maximum number of characters (inclusive).\n * @param s - The string to check.\n * @param maxLength - The maximum number of characters (inclusive).\n * @returns `true` if `s.length <= maxLength`, `false` otherwise. When `true`,\n * TypeScript narrows `s` to `MaxLengthString<MaxLength> & S`.\n */\nexport const isMaxLengthString = <\n S extends string,\n MaxLength extends SizeType.ArgStr,\n>(\n s: S,\n maxLength: MaxLength,\n): s is MaxLengthString<MaxLength> & S => s.length <= maxLength;\n\n/**\n * Type guard that checks if a string's length is within the inclusive range\n * `[minLength, maxLength]`.\n *\n * The length is measured in UTF-16 code units (the same unit as\n * `String.prototype.length`), so characters outside the Basic Multilingual\n * Plane (e.g. emoji) count as 2.\n *\n * **Type Narrowing Behavior:**\n *\n * - Narrows the input to `BoundedLengthString<MinLength, MaxLength>` while\n * preserving the original string type (e.g. literal types) via intersection.\n * - Since `BoundedLengthString` is the intersection of `MinLengthString` and\n * `MaxLengthString`, the narrowed value is assignable to both, and both\n * bounds can be weakened independently.\n *\n * @example\n *\n * ```ts\n * const input: string = 'user-12345678';\n *\n * assert.isTrue(isBoundedLengthString(input, 8, 16));\n *\n * assert.isFalse(isBoundedLengthString('user', 8, 16));\n *\n * if (isBoundedLengthString(input, 8, 16)) {\n * const userId: BoundedLengthString<8, 16> = input;\n *\n * const relaxed: BoundedLengthString<1, 255> = input; // OK ([8, 16] ⊆ [1, 255])\n * }\n * ```\n *\n * @template S - The input string type (literal types are preserved).\n * @template MinLength - The minimum number of characters (inclusive).\n * @template MaxLength - The maximum number of characters (inclusive).\n * @param s - The string to check.\n * @param minLength - The minimum number of characters (inclusive).\n * @param maxLength - The maximum number of characters (inclusive).\n * @returns `true` if `minLength <= s.length && s.length <= maxLength`, `false`\n * otherwise. When `true`, TypeScript narrows `s` to\n * `BoundedLengthString<MinLength, MaxLength> & S`.\n */\nexport const isBoundedLengthString = <\n S extends string,\n MinLength extends SizeType.ArgStr,\n MaxLength extends SizeType.ArgStr,\n>(\n s: S,\n minLength: MinLength,\n maxLength: MaxLength,\n): s is BoundedLengthString<MinLength, MaxLength> & S =>\n s.length >= minLength && s.length <= maxLength;\n\n/**\n * Type guard that checks if a string has exactly `length` characters.\n *\n * The length is measured in UTF-16 code units (the same unit as\n * `String.prototype.length`), so characters outside the Basic Multilingual\n * Plane (e.g. emoji) count as 2.\n *\n * **Type Narrowing Behavior:**\n *\n * - Narrows the input to `FixedLengthString<Length>` while preserving the\n * original string type (e.g. literal types) via intersection.\n * - Since `FixedLengthString<Length>` is defined as\n * `BoundedLengthString<Length, Length>`, the narrowed value is assignable to\n * any `MinLengthString<N>` with `N <= Length` and any `MaxLengthString<N>`\n * with `N >= Length`.\n *\n * @example\n *\n * ```ts\n * const input: string = 'JP';\n *\n * assert.isTrue(isFixedLengthString(input, 2));\n *\n * assert.isFalse(isFixedLengthString(input, 3));\n *\n * if (isFixedLengthString(input, 2)) {\n * const countryCode: FixedLengthString<2> = input;\n *\n * const atMost5: MaxLengthString<5> = input; // OK (2 <= 5)\n * }\n * ```\n *\n * @template S - The input string type (literal types are preserved).\n * @template Length - The exact number of characters.\n * @param s - The string to check.\n * @param length - The exact number of characters.\n * @returns `true` if `s.length === length`, `false` otherwise. When `true`,\n * TypeScript narrows `s` to `FixedLengthString<Length> & S`.\n */\nexport const isFixedLengthString = <\n S extends string,\n Length extends SizeType.ArgStr,\n>(\n s: S,\n length: Length,\n): s is FixedLengthString<Length> & S => s.length === length;\n"],"names":[],"mappings":"AA8CO,MAAM,iBAAA,GAAoB,CAI/B,CAAA,EACA,SAAA,KACwC,EAAE,MAAA,IAAU;AAwC/C,MAAM,iBAAA,GAAoB,CAI/B,CAAA,EACA,SAAA,KACwC,EAAE,MAAA,IAAU;AA4C/C,MAAM,qBAAA,GAAwB,CAKnC,CAAA,EACA,SAAA,EACA,cAEA,CAAA,CAAE,MAAA,IAAU,SAAA,IAAa,CAAA,CAAE,MAAA,IAAU;AAyChC,MAAM,mBAAA,GAAsB,CAIjC,CAAA,EACA,MAAA,KACuC,EAAE,MAAA,KAAW;;;;"}
@@ -36,5 +36,5 @@ import { type NonEmptyString, type RelaxedExclude } from 'ts-type-forge';
36
36
  * `true`, TypeScript narrows the type to exclude empty strings and nullish
37
37
  * values.
38
38
  */
39
- export declare const isNonEmptyString: <S extends string | null | undefined>(s: S) => s is NonEmptyString & RelaxedExclude<NonNullable<S>, "">;
39
+ export declare const isNonEmptyString: <S extends string | null | undefined>(s: S) => s is NonEmptyString & RelaxedExclude<NonNullable<S>, ''>;
40
40
  //# sourceMappingURL=is-non-empty-string.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-non-empty-string.d.mts","sourceRoot":"","sources":["../../src/guard/is-non-empty-string.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,MAAM,GAAG,IAAI,GAAG,SAAS,EAClE,GAAG,CAAC,KACH,CAAC,IAAI,cAAc,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CACnB,CAAC"}
1
+ {"version":3,"file":"is-non-empty-string.d.mts","sourceRoot":"","sources":["../../src/guard/is-non-empty-string.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,MAAM,GAAG,IAAI,GAAG,SAAS,KAC/D,CAAC,KACH,CAAC,IAAI,cAAc,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CACnB,CAAC"}
@@ -1,41 +1,4 @@
1
- /**
2
- * Type guard that checks if a value is a non-empty string.
3
- *
4
- * This function performs both a type check (ensuring the value is a string) and
5
- * a length check (ensuring the string is not empty). It acts as a type guard
6
- * that narrows the input type to exclude `null`, `undefined`, and empty
7
- * strings.
8
- *
9
- * **Type Narrowing Behavior:**
10
- *
11
- * - Eliminates `null` and `undefined` from the type
12
- * - Excludes empty string (`""`) from the type
13
- * - Preserves literal string types when possible
14
- * - Whitespace-only strings are considered non-empty
15
- *
16
- * @example
17
- *
18
- * ```ts
19
- * const words: readonly (string | undefined)[] = [
20
- * 'Ada',
21
- * undefined,
22
- * '',
23
- * 'Lovelace',
24
- * ] as const;
25
- *
26
- * const nonEmpty = words.filter(isNonEmptyString);
27
- *
28
- * assert.deepStrictEqual(nonEmpty, ['Ada', 'Lovelace']);
29
- * ```
30
- *
31
- * @template S - The input type, which can include `string`, `null`, or
32
- * `undefined`
33
- * @param s - The value to check
34
- * @returns `true` if `s` is a string with length > 0, `false` otherwise. When
35
- * `true`, TypeScript narrows the type to exclude empty strings and nullish
36
- * values.
37
- */
38
- const isNonEmptyString = (s) => typeof s === 'string' && s.length > 0;
1
+ const isNonEmptyString = (s) => typeof s === "string" && s.length > 0;
39
2
 
40
3
  export { isNonEmptyString };
41
4
  //# sourceMappingURL=is-non-empty-string.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-non-empty-string.mjs","sources":["../../src/guard/is-non-empty-string.mts"],"sourcesContent":[null],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCG;AACI,MAAM,gBAAgB,GAAG,CAC9B,CAAI,KAEJ,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG;;;;"}
1
+ {"version":3,"file":"is-non-empty-string.mjs","sources":["../../src/guard/is-non-empty-string.mts"],"sourcesContent":["import { type NonEmptyString, type RelaxedExclude } from 'ts-type-forge';\n\n/**\n * Type guard that checks if a value is a non-empty string.\n *\n * This function performs both a type check (ensuring the value is a string) and\n * a length check (ensuring the string is not empty). It acts as a type guard\n * that narrows the input type to exclude `null`, `undefined`, and empty\n * strings.\n *\n * **Type Narrowing Behavior:**\n *\n * - Eliminates `null` and `undefined` from the type\n * - Excludes empty string (`\"\"`) from the type\n * - Preserves literal string types when possible\n * - Whitespace-only strings are considered non-empty\n *\n * @example\n *\n * ```ts\n * const words: readonly (string | undefined)[] = [\n * 'Ada',\n * undefined,\n * '',\n * 'Lovelace',\n * ] as const;\n *\n * const nonEmpty = words.filter(isNonEmptyString);\n *\n * assert.deepStrictEqual(nonEmpty, ['Ada', 'Lovelace']);\n * ```\n *\n * @template S - The input type, which can include `string`, `null`, or\n * `undefined`\n * @param s - The value to check\n * @returns `true` if `s` is a string with length > 0, `false` otherwise. When\n * `true`, TypeScript narrows the type to exclude empty strings and nullish\n * values.\n */\nexport const isNonEmptyString = <S extends string | null | undefined>(\n s: S,\n): s is NonEmptyString & RelaxedExclude<NonNullable<S>, ''> =>\n typeof s === 'string' && s.length > 0;\n"],"names":[],"mappings":"AAuCO,MAAM,mBAAmB,CAC9B,CAAA,KAEA,OAAO,CAAA,KAAM,QAAA,IAAY,EAAE,MAAA,GAAS;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"is-non-null-object.d.mts","sourceRoot":"","sources":["../../src/guard/is-non-null-object.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,eAAO,MAAM,eAAe,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,MACb,CAAC"}
1
+ {"version":3,"file":"is-non-null-object.d.mts","sourceRoot":"","sources":["../../src/guard/is-non-null-object.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,eAAO,MAAM,eAAe,MAAO,OAAO,KAAG,CAAC,IAAI,MACb,CAAC"}
@@ -1,38 +1,4 @@
1
- /**
2
- * Type guard that checks if a value is a non-null object.
3
- *
4
- * This function checks if a value has type `"object"` according to the `typeof`
5
- * operator and is not `null`. This includes all object types such as plain
6
- * objects, arrays, dates, regular expressions, and other object instances, but
7
- * excludes functions.
8
- *
9
- * **Type Narrowing Behavior:**
10
- *
11
- * - Narrows `unknown` to `object`
12
- * - Excludes `null`, `undefined`, and all primitive types
13
- * - Excludes functions (they have `typeof` === `"function"`, not `"object"`)
14
- * - Includes arrays, dates, regex, and other object instances
15
- *
16
- * **Note:** This function returns `true` for arrays. If you need
17
- * record-oriented narrowing that excludes arrays, use `isRecord()` instead.
18
- *
19
- * @example
20
- *
21
- * ```ts
22
- * const mixed: readonly unknown[] = [{ id: 1 }, null, 'Ada'] as const;
23
- *
24
- * const objects = mixed.filter(isNonNullObject);
25
- *
26
- * assert.deepStrictEqual(objects, [{ id: 1 }]);
27
- * ```
28
- *
29
- * @param u - The value to check
30
- * @returns `true` if `u` is an object and not `null`, `false` otherwise. When
31
- * `true`, TypeScript narrows the type to `object`.
32
- * @see {@link isRecord} - For record-oriented type narrowing (excludes arrays)
33
- */
34
- // eslint-disable-next-line @typescript-eslint/no-restricted-types
35
- const isNonNullObject = (u) => typeof u === 'object' && u !== null;
1
+ const isNonNullObject = (u) => typeof u === "object" && u !== null;
36
2
 
37
3
  export { isNonNullObject };
38
4
  //# sourceMappingURL=is-non-null-object.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-non-null-object.mjs","sources":["../../src/guard/is-non-null-object.mts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCG;AACH;AACO,MAAM,eAAe,GAAG,CAAC,CAAU,KACxC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK;;;;"}
1
+ {"version":3,"file":"is-non-null-object.mjs","sources":["../../src/guard/is-non-null-object.mts"],"sourcesContent":["/**\n * Type guard that checks if a value is a non-null object.\n *\n * This function checks if a value has type `\"object\"` according to the `typeof`\n * operator and is not `null`. This includes all object types such as plain\n * objects, arrays, dates, regular expressions, and other object instances, but\n * excludes functions.\n *\n * **Type Narrowing Behavior:**\n *\n * - Narrows `unknown` to `object`\n * - Excludes `null`, `undefined`, and all primitive types\n * - Excludes functions (they have `typeof` === `\"function\"`, not `\"object\"`)\n * - Includes arrays, dates, regex, and other object instances\n *\n * **Note:** This function returns `true` for arrays. If you need\n * record-oriented narrowing that excludes arrays, use `isRecord()` instead.\n *\n * @example\n *\n * ```ts\n * const mixed: readonly unknown[] = [{ id: 1 }, null, 'Ada'] as const;\n *\n * const objects = mixed.filter(isNonNullObject);\n *\n * assert.deepStrictEqual(objects, [{ id: 1 }]);\n * ```\n *\n * @param u - The value to check\n * @returns `true` if `u` is an object and not `null`, `false` otherwise. When\n * `true`, TypeScript narrows the type to `object`.\n * @see {@link isRecord} - For record-oriented type narrowing (excludes arrays)\n */\n// eslint-disable-next-line @typescript-eslint/no-restricted-types\nexport const isNonNullObject = (u: unknown): u is object =>\n typeof u === 'object' && u !== null;\n"],"names":[],"mappings":"AAkCO,MAAM,kBAAkB,CAAC,CAAA,KAC9B,OAAO,CAAA,KAAM,YAAY,CAAA,KAAM;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"is-primitive.d.mts","sourceRoot":"","sources":["../../src/guard/is-primitive.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAG/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,WAAW,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,SAa7C,CAAC"}
1
+ {"version":3,"file":"is-primitive.d.mts","sourceRoot":"","sources":["../../src/guard/is-primitive.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAG/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,WAAW,MAAO,OAAO,KAAG,CAAC,IAAI,SAa7C,CAAC"}
@@ -1,47 +1,16 @@
1
- /**
2
- * Type guard that checks if a value is a primitive type.
3
- *
4
- * This function identifies JavaScript primitive types, which are immutable data
5
- * types that are not objects. The primitive types are: `string`, `number`,
6
- * `boolean`, `undefined`, `symbol`, `bigint`, and `null`.
7
- *
8
- * **Important Note:** Although `null` has `typeof null === "object"` due to a
9
- * historical JavaScript quirk, this function correctly identifies `null` as a
10
- * primitive value.
11
- *
12
- * **Type Narrowing Behavior:**
13
- *
14
- * - Narrows the input type to `Primitive` (union of all primitive types)
15
- * - Excludes object types, arrays, functions, and other non-primitive values
16
- * - Includes `null` despite its misleading `typeof` result
17
- *
18
- * @example
19
- *
20
- * ```ts
21
- * const values: readonly unknown[] = [42, 'Ada', null, { id: 1 }] as const;
22
- *
23
- * const primitives = values.filter(isPrimitive);
24
- *
25
- * assert.deepStrictEqual(primitives, [42, 'Ada', null]);
26
- * ```
27
- *
28
- * @param u - The value to check
29
- * @returns `true` if `u` is a primitive type, `false` otherwise. When `true`,
30
- * TypeScript narrows the type to `Primitive`.
31
- */
32
1
  const isPrimitive = (u) => {
33
- switch (typeof u) {
34
- case 'string':
35
- case 'number':
36
- case 'boolean':
37
- case 'undefined':
38
- case 'symbol':
39
- case 'bigint':
40
- return true;
41
- case 'function':
42
- case 'object':
43
- return u === null;
44
- }
2
+ switch (typeof u) {
3
+ case "string":
4
+ case "number":
5
+ case "boolean":
6
+ case "undefined":
7
+ case "symbol":
8
+ case "bigint":
9
+ return true;
10
+ case "function":
11
+ case "object":
12
+ return u === null;
13
+ }
45
14
  };
46
15
 
47
16
  export { isPrimitive };
@@ -1 +1 @@
1
- {"version":3,"file":"is-primitive.mjs","sources":["../../src/guard/is-primitive.mts"],"sourcesContent":[null],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACI,MAAM,WAAW,GAAG,CAAC,CAAU,KAAoB;IACxD,QAAQ,OAAO,CAAC;AACd,QAAA,KAAK,QAAQ;AACb,QAAA,KAAK,QAAQ;AACb,QAAA,KAAK,SAAS;AACd,QAAA,KAAK,WAAW;AAChB,QAAA,KAAK,QAAQ;AACb,QAAA,KAAK,QAAQ;AACX,YAAA,OAAO,IAAI;AACb,QAAA,KAAK,UAAU;AACf,QAAA,KAAK,QAAQ;YACX,OAAO,CAAC,KAAK,IAAI;;AAEvB;;;;"}
1
+ {"version":3,"file":"is-primitive.mjs","sources":["../../src/guard/is-primitive.mts"],"sourcesContent":["import { type Primitive } from 'ts-type-forge';\nimport { expectType } from '../expect-type.mjs';\n\n/**\n * Type guard that checks if a value is a primitive type.\n *\n * This function identifies JavaScript primitive types, which are immutable data\n * types that are not objects. The primitive types are: `string`, `number`,\n * `boolean`, `undefined`, `symbol`, `bigint`, and `null`.\n *\n * **Important Note:** Although `null` has `typeof null === \"object\"` due to a\n * historical JavaScript quirk, this function correctly identifies `null` as a\n * primitive value.\n *\n * **Type Narrowing Behavior:**\n *\n * - Narrows the input type to `Primitive` (union of all primitive types)\n * - Excludes object types, arrays, functions, and other non-primitive values\n * - Includes `null` despite its misleading `typeof` result\n *\n * @example\n *\n * ```ts\n * const values: readonly unknown[] = [42, 'Ada', null, { id: 1 }] as const;\n *\n * const primitives = values.filter(isPrimitive);\n *\n * assert.deepStrictEqual(primitives, [42, 'Ada', null]);\n * ```\n *\n * @param u - The value to check\n * @returns `true` if `u` is a primitive type, `false` otherwise. When `true`,\n * TypeScript narrows the type to `Primitive`.\n */\nexport const isPrimitive = (u: unknown): u is Primitive => {\n switch (typeof u) {\n case 'string':\n case 'number':\n case 'boolean':\n case 'undefined':\n case 'symbol':\n case 'bigint':\n return true;\n case 'function':\n case 'object':\n return u === null;\n }\n};\n\nexpectType<\n bigint | boolean | number | string | symbol | undefined | null,\n Primitive\n>('=');\n"],"names":[],"mappings":"AAkCO,MAAM,WAAA,GAAc,CAAC,CAAA,KAA+B;AACzD,EAAA,QAAQ,OAAO,CAAA;AAAG,IAChB,KAAK,QAAA;AAAA,IACL,KAAK,QAAA;AAAA,IACL,KAAK,SAAA;AAAA,IACL,KAAK,WAAA;AAAA,IACL,KAAK,QAAA;AAAA,IACL,KAAK,QAAA;AACH,MAAA,OAAO,IAAA;AAAA,IACT,KAAK,UAAA;AAAA,IACL,KAAK,QAAA;AACH,MAAA,OAAO,CAAA,KAAM,IAAA;AAAA;AAEnB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"is-record.d.mts","sourceRoot":"","sources":["../../src/guard/is-record.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAGvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,eAAO,MAAM,QAAQ,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,aACF,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,eAAe,EAAE,CAC5B,CAAC,EAAE,OAAO,KACP,CAAC,IAAI,aAAa,CAAC,MAAM,EAAE,OAAO,CAAY,CAAC"}
1
+ {"version":3,"file":"is-record.d.mts","sourceRoot":"","sources":["../../src/guard/is-record.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAGvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,eAAO,MAAM,QAAQ,MAAO,OAAO,KAAG,CAAC,IAAI,aACF,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,eAAe,EAAE,CAC5B,CAAC,EAAE,OAAO,KACP,CAAC,IAAI,aAAa,CAAC,MAAM,EAAE,OAAO,CAAY,CAAC"}
@@ -1,92 +1,6 @@
1
1
  import { isNonNullObject } from './is-non-null-object.mjs';
2
2
 
3
- /**
4
- * Type guard that checks if a value is a record — a non-null, non-array
5
- * object — and narrows it to `UnknownRecord` (= `ReadonlyRecord<string,
6
- * unknown>`).
7
- *
8
- * This function is designed to be combined with {@link hasKey} to probe
9
- * values of type `unknown` (e.g. parsed JSON, caught errors, external data)
10
- * in a type-safe way: `if (isRecord(u) && hasKey(u, 'some-key')) { ... }`.
11
- *
12
- * **Type Narrowing Behavior:**
13
- *
14
- * - Narrows `unknown` to `UnknownRecord` (= `ReadonlyRecord<string, unknown>`)
15
- * - Excludes `null`, `undefined`, primitives, and functions
16
- * - Excludes arrays: arrays have no string index signature, so they are not
17
- * assignable to `UnknownRecord`; admitting them at runtime would be
18
- * inconsistent with the narrowed type
19
- * - Returns `true` for every other non-null object, including dictionary
20
- * objects created with `Object.create(null)` and instances such as `Date`,
21
- * `RegExp`, `Map`, `Set`, `Error`, and user-defined classes
22
- *
23
- * **Why non-plain objects are included:** since every property of
24
- * `UnknownRecord` is typed `unknown`, reading properties from any object
25
- * through this narrowing is type-safe, and `hasKey` (backed by
26
- * `Object.hasOwn`) answers own-property questions correctly on any object
27
- * (e.g. `Map` entries are not own properties, so `hasKey` correctly returns
28
- * `false` for them). Restricting the guard to plain objects would require
29
- * prototype checks that misjudge cross-realm objects and would prevent
30
- * probing useful instances such as `Error` subclasses.
31
- *
32
- * **Implementation:** `isNonNullObject(u) && !Array.isArray(u)`.
33
- *
34
- * @example
35
- *
36
- * ```ts
37
- * const entries: readonly unknown[] = [
38
- * { id: 1 },
39
- * [1, 2],
40
- * 'str',
41
- * 0,
42
- * null,
43
- * ] as const;
44
- *
45
- * const records = entries.filter(isRecord);
46
- *
47
- * assert.deepStrictEqual(records, [{ id: 1 }]);
48
- * ```
49
- *
50
- * @param u - The value to check
51
- * @returns `true` if `u` is a non-null, non-array object, `false` otherwise.
52
- * When `true`, TypeScript narrows the type to `UnknownRecord`.
53
- * @see {@link isNonNullObject} - For checking any non-null object (includes arrays)
54
- * @see {@link hasKey} - For checking if a record has specific keys
55
- */
56
3
  const isRecord = (u) => isNonNullObject(u) && !Array.isArray(u);
57
- /**
58
- * Type guard that checks if a value is a mutable record.
59
- *
60
- * This function has the same runtime behavior as {@link isRecord} (non-null,
61
- * non-array object check), but narrows the type to `MutableRecord<string,
62
- * unknown>`, which is useful when you need to add or overwrite properties on
63
- * the narrowed object.
64
- *
65
- * **Type Narrowing Behavior:**
66
- *
67
- * - Narrows `unknown` to `MutableRecord<string, unknown>`
68
- * - Excludes `null`, `undefined`, primitives, functions, and arrays
69
- * - Returns `true` for every other non-null object (see {@link isRecord} for
70
- * details on non-plain objects such as `Date`, `Map`, and `Set`)
71
- *
72
- * **Implementation:** This is a type alias for {@link isRecord}.
73
- *
74
- * @example
75
- *
76
- * ```ts
77
- * const obj: unknown = { foo: 1 } as const;
78
- *
79
- * if (isMutableRecord(obj)) {
80
- * obj['bar'] = 2; // Safe: obj is now known to be a mutable record
81
- * }
82
- * ```
83
- *
84
- * @param u - The value to check
85
- * @returns `true` if `u` is a non-null, non-array object, `false` otherwise.
86
- * When `true`, TypeScript narrows the type to `MutableRecord<string,
87
- * unknown>`.
88
- * @see {@link isRecord} - For the underlying implementation and more details
89
- */
90
4
  const isMutableRecord = isRecord;
91
5
 
92
6
  export { isMutableRecord, isRecord };
@@ -1 +1 @@
1
- {"version":3,"file":"is-record.mjs","sources":["../../src/guard/is-record.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDG;MACU,QAAQ,GAAG,CAAC,CAAU,KACjC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCG;AACI,MAAM,eAAe,GAEe;;;;"}
1
+ {"version":3,"file":"is-record.mjs","sources":["../../src/guard/is-record.mts"],"sourcesContent":["import { type MutableRecord, type UnknownRecord } from 'ts-type-forge';\nimport { isNonNullObject } from './is-non-null-object.mjs';\n\n/**\n * Type guard that checks if a value is a record — a non-null, non-array\n * object — and narrows it to `UnknownRecord` (= `ReadonlyRecord<string,\n * unknown>`).\n *\n * This function is designed to be combined with {@link hasKey} to probe\n * values of type `unknown` (e.g. parsed JSON, caught errors, external data)\n * in a type-safe way: `if (isRecord(u) && hasKey(u, 'some-key')) { ... }`.\n *\n * **Type Narrowing Behavior:**\n *\n * - Narrows `unknown` to `UnknownRecord` (= `ReadonlyRecord<string, unknown>`)\n * - Excludes `null`, `undefined`, primitives, and functions\n * - Excludes arrays: arrays have no string index signature, so they are not\n * assignable to `UnknownRecord`; admitting them at runtime would be\n * inconsistent with the narrowed type\n * - Returns `true` for every other non-null object, including dictionary\n * objects created with `Object.create(null)` and instances such as `Date`,\n * `RegExp`, `Map`, `Set`, `Error`, and user-defined classes\n *\n * **Why non-plain objects are included:** since every property of\n * `UnknownRecord` is typed `unknown`, reading properties from any object\n * through this narrowing is type-safe, and `hasKey` (backed by\n * `Object.hasOwn`) answers own-property questions correctly on any object\n * (e.g. `Map` entries are not own properties, so `hasKey` correctly returns\n * `false` for them). Restricting the guard to plain objects would require\n * prototype checks that misjudge cross-realm objects and would prevent\n * probing useful instances such as `Error` subclasses.\n *\n * **Implementation:** `isNonNullObject(u) && !Array.isArray(u)`.\n *\n * @example\n *\n * ```ts\n * const entries: readonly unknown[] = [\n * { id: 1 },\n * [1, 2],\n * 'str',\n * 0,\n * null,\n * ] as const;\n *\n * const records = entries.filter(isRecord);\n *\n * assert.deepStrictEqual(records, [{ id: 1 }]);\n * ```\n *\n * @param u - The value to check\n * @returns `true` if `u` is a non-null, non-array object, `false` otherwise.\n * When `true`, TypeScript narrows the type to `UnknownRecord`.\n * @see {@link isNonNullObject} - For checking any non-null object (includes arrays)\n * @see {@link hasKey} - For checking if a record has specific keys\n */\nexport const isRecord = (u: unknown): u is UnknownRecord =>\n isNonNullObject(u) && !Array.isArray(u);\n\n/**\n * Type guard that checks if a value is a mutable record.\n *\n * This function has the same runtime behavior as {@link isRecord} (non-null,\n * non-array object check), but narrows the type to `MutableRecord<string,\n * unknown>`, which is useful when you need to add or overwrite properties on\n * the narrowed object.\n *\n * **Type Narrowing Behavior:**\n *\n * - Narrows `unknown` to `MutableRecord<string, unknown>`\n * - Excludes `null`, `undefined`, primitives, functions, and arrays\n * - Returns `true` for every other non-null object (see {@link isRecord} for\n * details on non-plain objects such as `Date`, `Map`, and `Set`)\n *\n * **Implementation:** This is a type alias for {@link isRecord}.\n *\n * @example\n *\n * ```ts\n * const obj: unknown = { foo: 1 } as const;\n *\n * if (isMutableRecord(obj)) {\n * obj['bar'] = 2; // Safe: obj is now known to be a mutable record\n * }\n * ```\n *\n * @param u - The value to check\n * @returns `true` if `u` is a non-null, non-array object, `false` otherwise.\n * When `true`, TypeScript narrows the type to `MutableRecord<string,\n * unknown>`.\n * @see {@link isRecord} - For the underlying implementation and more details\n */\nexport const isMutableRecord: (\n u: unknown,\n) => u is MutableRecord<string, unknown> = isRecord;\n"],"names":[],"mappings":";;AAwDO,MAAM,QAAA,GAAW,CAAC,CAAA,KACvB,eAAA,CAAgB,CAAC,CAAA,IAAK,CAAC,KAAA,CAAM,OAAA,CAAQ,CAAC;AAmCjC,MAAM,eAAA,GAE8B;;;;"}