ts-data-forge 14.6.4 → 14.7.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 (573) hide show
  1. package/README.md +2 -1
  2. package/dist/array/impl/array-utils-length-bounded-array-cast.d.mts +36 -6
  3. package/dist/array/impl/array-utils-length-bounded-array-cast.d.mts.map +1 -1
  4. package/dist/array/impl/array-utils-length-bounded-array-cast.mjs +4 -0
  5. package/dist/array/impl/array-utils-length-bounded-array-cast.mjs.map +1 -1
  6. package/dist/array/impl/array-utils-length-bounded-tuple-cast.d.mts +26 -6
  7. package/dist/array/impl/array-utils-length-bounded-tuple-cast.d.mts.map +1 -1
  8. package/dist/array/impl/array-utils-length-bounded-tuple-cast.mjs +4 -0
  9. package/dist/array/impl/array-utils-length-bounded-tuple-cast.mjs.map +1 -1
  10. package/dist/expect-type.d.mts +2 -70
  11. package/dist/expect-type.d.mts.map +1 -1
  12. package/dist/expect-type.mjs +1 -68
  13. package/dist/expect-type.mjs.map +1 -1
  14. package/dist/functional/index.d.mts +11 -6
  15. package/dist/functional/index.d.mts.map +1 -1
  16. package/dist/functional/index.mjs +10 -6
  17. package/dist/functional/index.mjs.map +1 -1
  18. package/dist/guard/has-key.d.mts +2 -51
  19. package/dist/guard/has-key.d.mts.map +1 -1
  20. package/dist/guard/has-key.mjs +1 -41
  21. package/dist/guard/has-key.mjs.map +1 -1
  22. package/dist/guard/is-non-null-object.d.mts +2 -34
  23. package/dist/guard/is-non-null-object.d.mts.map +1 -1
  24. package/dist/guard/is-non-null-object.mjs +1 -34
  25. package/dist/guard/is-non-null-object.mjs.map +1 -1
  26. package/dist/guard/is-record.d.mts +2 -89
  27. package/dist/guard/is-record.d.mts.map +1 -1
  28. package/dist/guard/is-record.mjs +1 -88
  29. package/dist/guard/is-record.mjs.map +1 -1
  30. package/dist/guard/key-is-in.d.mts +2 -42
  31. package/dist/guard/key-is-in.d.mts.map +1 -1
  32. package/dist/guard/key-is-in.mjs +1 -40
  33. package/dist/guard/key-is-in.mjs.map +1 -1
  34. package/dist/index.d.mts +2 -0
  35. package/dist/index.d.mts.map +1 -1
  36. package/dist/index.mjs +2 -0
  37. package/dist/index.mjs.map +1 -1
  38. package/dist/number/num.d.mts +9 -1
  39. package/dist/number/num.d.mts.map +1 -1
  40. package/dist/number/num.mjs +24 -16
  41. package/dist/number/num.mjs.map +1 -1
  42. package/dist/others/index.d.mts +1 -0
  43. package/dist/others/index.d.mts.map +1 -1
  44. package/dist/others/index.mjs +1 -0
  45. package/dist/others/index.mjs.map +1 -1
  46. package/dist/others/panic-error.d.mts +9 -0
  47. package/dist/others/panic-error.d.mts.map +1 -0
  48. package/dist/others/panic-error.mjs +9 -0
  49. package/dist/others/panic-error.mjs.map +1 -0
  50. package/dist/others/unknown-to-string.d.mts +2 -37
  51. package/dist/others/unknown-to-string.d.mts.map +1 -1
  52. package/dist/others/unknown-to-string.mjs +1 -92
  53. package/dist/others/unknown-to-string.mjs.map +1 -1
  54. package/dist/types.d.mts +1 -41
  55. package/dist/types.d.mts.map +1 -1
  56. package/dist/types.mjs +0 -1
  57. package/dist/types.mjs.map +1 -1
  58. package/package.json +9 -9
  59. package/src/array/impl/array-utils-length-bounded-array-cast.mts +36 -6
  60. package/src/array/impl/array-utils-length-bounded-tuple-cast.mts +26 -6
  61. package/src/expect-type.mts +2 -78
  62. package/src/functional/index.mts +31 -6
  63. package/src/guard/has-key.mts +2 -72
  64. package/src/guard/is-non-null-object.mts +2 -36
  65. package/src/guard/is-record.mts +2 -95
  66. package/src/guard/key-is-in.mts +2 -49
  67. package/src/index.mts +2 -0
  68. package/src/number/num.mts +36 -28
  69. package/src/others/index.mts +1 -0
  70. package/src/others/panic-error.mts +8 -0
  71. package/src/others/unknown-to-string.mts +2 -111
  72. package/src/types.mts +4 -54
  73. package/dist/functional/async-result/async-result.d.mts +0 -16
  74. package/dist/functional/async-result/async-result.d.mts.map +0 -1
  75. package/dist/functional/async-result/async-result.mjs +0 -2
  76. package/dist/functional/async-result/async-result.mjs.map +0 -1
  77. package/dist/functional/async-result/impl/async-result-flat-map.d.mts +0 -39
  78. package/dist/functional/async-result/impl/async-result-flat-map.d.mts.map +0 -1
  79. package/dist/functional/async-result/impl/async-result-flat-map.mjs +0 -23
  80. package/dist/functional/async-result/impl/async-result-flat-map.mjs.map +0 -1
  81. package/dist/functional/async-result/impl/async-result-from-promise.d.mts +0 -47
  82. package/dist/functional/async-result/impl/async-result-from-promise.d.mts.map +0 -1
  83. package/dist/functional/async-result/impl/async-result-from-promise.mjs +0 -10
  84. package/dist/functional/async-result/impl/async-result-from-promise.mjs.map +0 -1
  85. package/dist/functional/async-result/impl/async-result-from-throwable.d.mts +0 -53
  86. package/dist/functional/async-result/impl/async-result-from-throwable.d.mts.map +0 -1
  87. package/dist/functional/async-result/impl/async-result-from-throwable.mjs +0 -15
  88. package/dist/functional/async-result/impl/async-result-from-throwable.mjs.map +0 -1
  89. package/dist/functional/async-result/impl/async-result-map-err.d.mts +0 -35
  90. package/dist/functional/async-result/impl/async-result-map-err.d.mts.map +0 -1
  91. package/dist/functional/async-result/impl/async-result-map-err.mjs +0 -20
  92. package/dist/functional/async-result/impl/async-result-map-err.mjs.map +0 -1
  93. package/dist/functional/async-result/impl/async-result-map.d.mts +0 -45
  94. package/dist/functional/async-result/impl/async-result-map.d.mts.map +0 -1
  95. package/dist/functional/async-result/impl/async-result-map.mjs +0 -20
  96. package/dist/functional/async-result/impl/async-result-map.mjs.map +0 -1
  97. package/dist/functional/async-result/impl/async-result-unwrap-or.d.mts +0 -34
  98. package/dist/functional/async-result/impl/async-result-unwrap-or.d.mts.map +0 -1
  99. package/dist/functional/async-result/impl/async-result-unwrap-or.mjs +0 -37
  100. package/dist/functional/async-result/impl/async-result-unwrap-or.mjs.map +0 -1
  101. package/dist/functional/async-result/impl/index.d.mts +0 -8
  102. package/dist/functional/async-result/impl/index.d.mts.map +0 -1
  103. package/dist/functional/async-result/impl/index.mjs +0 -8
  104. package/dist/functional/async-result/impl/index.mjs.map +0 -1
  105. package/dist/functional/async-result/impl/types.d.mts +0 -45
  106. package/dist/functional/async-result/impl/types.d.mts.map +0 -1
  107. package/dist/functional/async-result/impl/types.mjs +0 -2
  108. package/dist/functional/async-result/impl/types.mjs.map +0 -1
  109. package/dist/functional/async-result/index.d.mts +0 -2
  110. package/dist/functional/async-result/index.d.mts.map +0 -1
  111. package/dist/functional/async-result/index.mjs +0 -2
  112. package/dist/functional/async-result/index.mjs.map +0 -1
  113. package/dist/functional/match.d.mts +0 -80
  114. package/dist/functional/match.d.mts.map +0 -1
  115. package/dist/functional/match.mjs +0 -31
  116. package/dist/functional/match.mjs.map +0 -1
  117. package/dist/functional/optional/impl/index.d.mts +0 -19
  118. package/dist/functional/optional/impl/index.d.mts.map +0 -1
  119. package/dist/functional/optional/impl/index.mjs +0 -19
  120. package/dist/functional/optional/impl/index.mjs.map +0 -1
  121. package/dist/functional/optional/impl/optional-expect-to-be.d.mts +0 -37
  122. package/dist/functional/optional/impl/optional-expect-to-be.d.mts.map +0 -1
  123. package/dist/functional/optional/impl/optional-expect-to-be.mjs +0 -22
  124. package/dist/functional/optional/impl/optional-expect-to-be.mjs.map +0 -1
  125. package/dist/functional/optional/impl/optional-filter.d.mts +0 -33
  126. package/dist/functional/optional/impl/optional-filter.d.mts.map +0 -1
  127. package/dist/functional/optional/impl/optional-filter.mjs +0 -25
  128. package/dist/functional/optional/impl/optional-filter.mjs.map +0 -1
  129. package/dist/functional/optional/impl/optional-flat-map.d.mts +0 -39
  130. package/dist/functional/optional/impl/optional-flat-map.d.mts.map +0 -1
  131. package/dist/functional/optional/impl/optional-flat-map.mjs +0 -18
  132. package/dist/functional/optional/impl/optional-flat-map.mjs.map +0 -1
  133. package/dist/functional/optional/impl/optional-from-nullable.d.mts +0 -27
  134. package/dist/functional/optional/impl/optional-from-nullable.d.mts.map +0 -1
  135. package/dist/functional/optional/impl/optional-from-nullable.mjs +0 -28
  136. package/dist/functional/optional/impl/optional-from-nullable.mjs.map +0 -1
  137. package/dist/functional/optional/impl/optional-is-none.d.mts +0 -23
  138. package/dist/functional/optional/impl/optional-is-none.d.mts.map +0 -1
  139. package/dist/functional/optional/impl/optional-is-none.mjs +0 -22
  140. package/dist/functional/optional/impl/optional-is-none.mjs.map +0 -1
  141. package/dist/functional/optional/impl/optional-is-optional.d.mts +0 -21
  142. package/dist/functional/optional/impl/optional-is-optional.d.mts.map +0 -1
  143. package/dist/functional/optional/impl/optional-is-optional.mjs +0 -26
  144. package/dist/functional/optional/impl/optional-is-optional.mjs.map +0 -1
  145. package/dist/functional/optional/impl/optional-is-some.d.mts +0 -24
  146. package/dist/functional/optional/impl/optional-is-some.d.mts.map +0 -1
  147. package/dist/functional/optional/impl/optional-is-some.mjs +0 -23
  148. package/dist/functional/optional/impl/optional-is-some.mjs.map +0 -1
  149. package/dist/functional/optional/impl/optional-map.d.mts +0 -34
  150. package/dist/functional/optional/impl/optional-map.d.mts.map +0 -1
  151. package/dist/functional/optional/impl/optional-map.mjs +0 -22
  152. package/dist/functional/optional/impl/optional-map.mjs.map +0 -1
  153. package/dist/functional/optional/impl/optional-match.d.mts +0 -48
  154. package/dist/functional/optional/impl/optional-match.d.mts.map +0 -1
  155. package/dist/functional/optional/impl/optional-match.mjs +0 -20
  156. package/dist/functional/optional/impl/optional-match.mjs.map +0 -1
  157. package/dist/functional/optional/impl/optional-none.d.mts +0 -19
  158. package/dist/functional/optional/impl/optional-none.d.mts.map +0 -1
  159. package/dist/functional/optional/impl/optional-none.mjs +0 -19
  160. package/dist/functional/optional/impl/optional-none.mjs.map +0 -1
  161. package/dist/functional/optional/impl/optional-or-else.d.mts +0 -43
  162. package/dist/functional/optional/impl/optional-or-else.d.mts.map +0 -1
  163. package/dist/functional/optional/impl/optional-or-else.mjs +0 -16
  164. package/dist/functional/optional/impl/optional-or-else.mjs.map +0 -1
  165. package/dist/functional/optional/impl/optional-some.d.mts +0 -22
  166. package/dist/functional/optional/impl/optional-some.d.mts.map +0 -1
  167. package/dist/functional/optional/impl/optional-some.mjs +0 -25
  168. package/dist/functional/optional/impl/optional-some.mjs.map +0 -1
  169. package/dist/functional/optional/impl/optional-to-nullable.d.mts +0 -30
  170. package/dist/functional/optional/impl/optional-to-nullable.d.mts.map +0 -1
  171. package/dist/functional/optional/impl/optional-to-nullable.mjs +0 -30
  172. package/dist/functional/optional/impl/optional-to-nullable.mjs.map +0 -1
  173. package/dist/functional/optional/impl/optional-unwrap-or.d.mts +0 -37
  174. package/dist/functional/optional/impl/optional-unwrap-or.d.mts.map +0 -1
  175. package/dist/functional/optional/impl/optional-unwrap-or.mjs +0 -16
  176. package/dist/functional/optional/impl/optional-unwrap-or.mjs.map +0 -1
  177. package/dist/functional/optional/impl/optional-unwrap-throw.d.mts +0 -31
  178. package/dist/functional/optional/impl/optional-unwrap-throw.d.mts.map +0 -1
  179. package/dist/functional/optional/impl/optional-unwrap-throw.mjs +0 -36
  180. package/dist/functional/optional/impl/optional-unwrap-throw.mjs.map +0 -1
  181. package/dist/functional/optional/impl/optional-unwrap.d.mts +0 -32
  182. package/dist/functional/optional/impl/optional-unwrap.d.mts.map +0 -1
  183. package/dist/functional/optional/impl/optional-unwrap.mjs +0 -8
  184. package/dist/functional/optional/impl/optional-unwrap.mjs.map +0 -1
  185. package/dist/functional/optional/impl/optional-zip.d.mts +0 -35
  186. package/dist/functional/optional/impl/optional-zip.d.mts.map +0 -1
  187. package/dist/functional/optional/impl/optional-zip.mjs +0 -39
  188. package/dist/functional/optional/impl/optional-zip.mjs.map +0 -1
  189. package/dist/functional/optional/impl/tag.d.mts +0 -6
  190. package/dist/functional/optional/impl/tag.d.mts.map +0 -1
  191. package/dist/functional/optional/impl/tag.mjs +0 -4
  192. package/dist/functional/optional/impl/tag.mjs.map +0 -1
  193. package/dist/functional/optional/impl/types.d.mts +0 -24
  194. package/dist/functional/optional/impl/types.d.mts.map +0 -1
  195. package/dist/functional/optional/impl/types.mjs +0 -2
  196. package/dist/functional/optional/impl/types.mjs.map +0 -1
  197. package/dist/functional/optional/index.d.mts +0 -2
  198. package/dist/functional/optional/index.d.mts.map +0 -1
  199. package/dist/functional/optional/index.mjs +0 -2
  200. package/dist/functional/optional/index.mjs.map +0 -1
  201. package/dist/functional/optional/optional.d.mts +0 -16
  202. package/dist/functional/optional/optional.d.mts.map +0 -1
  203. package/dist/functional/optional/optional.mjs +0 -2
  204. package/dist/functional/optional/optional.mjs.map +0 -1
  205. package/dist/functional/pipe.d.mts +0 -102
  206. package/dist/functional/pipe.d.mts.map +0 -1
  207. package/dist/functional/pipe.mjs +0 -45
  208. package/dist/functional/pipe.mjs.map +0 -1
  209. package/dist/functional/result/impl/index.d.mts +0 -28
  210. package/dist/functional/result/impl/index.d.mts.map +0 -1
  211. package/dist/functional/result/impl/index.mjs +0 -28
  212. package/dist/functional/result/impl/index.mjs.map +0 -1
  213. package/dist/functional/result/impl/result-err.d.mts +0 -28
  214. package/dist/functional/result/impl/result-err.d.mts.map +0 -1
  215. package/dist/functional/result/impl/result-err.mjs +0 -31
  216. package/dist/functional/result/impl/result-err.mjs.map +0 -1
  217. package/dist/functional/result/impl/result-expect-to-be.d.mts +0 -33
  218. package/dist/functional/result/impl/result-expect-to-be.d.mts.map +0 -1
  219. package/dist/functional/result/impl/result-expect-to-be.mjs +0 -23
  220. package/dist/functional/result/impl/result-expect-to-be.mjs.map +0 -1
  221. package/dist/functional/result/impl/result-flat-map.d.mts +0 -45
  222. package/dist/functional/result/impl/result-flat-map.d.mts.map +0 -1
  223. package/dist/functional/result/impl/result-flat-map.mjs +0 -21
  224. package/dist/functional/result/impl/result-flat-map.mjs.map +0 -1
  225. package/dist/functional/result/impl/result-fold.d.mts +0 -50
  226. package/dist/functional/result/impl/result-fold.d.mts.map +0 -1
  227. package/dist/functional/result/impl/result-fold.mjs +0 -23
  228. package/dist/functional/result/impl/result-fold.mjs.map +0 -1
  229. package/dist/functional/result/impl/result-from-optional.d.mts +0 -41
  230. package/dist/functional/result/impl/result-from-optional.d.mts.map +0 -1
  231. package/dist/functional/result/impl/result-from-optional.mjs +0 -21
  232. package/dist/functional/result/impl/result-from-optional.mjs.map +0 -1
  233. package/dist/functional/result/impl/result-from-promise.d.mts +0 -43
  234. package/dist/functional/result/impl/result-from-promise.d.mts.map +0 -1
  235. package/dist/functional/result/impl/result-from-promise.mjs +0 -39
  236. package/dist/functional/result/impl/result-from-promise.mjs.map +0 -1
  237. package/dist/functional/result/impl/result-from-throwable.d.mts +0 -32
  238. package/dist/functional/result/impl/result-from-throwable.d.mts.map +0 -1
  239. package/dist/functional/result/impl/result-from-throwable.mjs +0 -46
  240. package/dist/functional/result/impl/result-from-throwable.mjs.map +0 -1
  241. package/dist/functional/result/impl/result-is-err.d.mts +0 -23
  242. package/dist/functional/result/impl/result-is-err.d.mts.map +0 -1
  243. package/dist/functional/result/impl/result-is-err.mjs +0 -22
  244. package/dist/functional/result/impl/result-is-err.mjs.map +0 -1
  245. package/dist/functional/result/impl/result-is-ok.d.mts +0 -23
  246. package/dist/functional/result/impl/result-is-ok.d.mts.map +0 -1
  247. package/dist/functional/result/impl/result-is-ok.mjs +0 -22
  248. package/dist/functional/result/impl/result-is-ok.mjs.map +0 -1
  249. package/dist/functional/result/impl/result-is-result.d.mts +0 -22
  250. package/dist/functional/result/impl/result-is-result.d.mts.map +0 -1
  251. package/dist/functional/result/impl/result-is-result.mjs +0 -26
  252. package/dist/functional/result/impl/result-is-result.mjs.map +0 -1
  253. package/dist/functional/result/impl/result-map-err.d.mts +0 -39
  254. package/dist/functional/result/impl/result-map-err.d.mts.map +0 -1
  255. package/dist/functional/result/impl/result-map-err.mjs +0 -22
  256. package/dist/functional/result/impl/result-map-err.mjs.map +0 -1
  257. package/dist/functional/result/impl/result-map.d.mts +0 -39
  258. package/dist/functional/result/impl/result-map.d.mts.map +0 -1
  259. package/dist/functional/result/impl/result-map.mjs +0 -22
  260. package/dist/functional/result/impl/result-map.mjs.map +0 -1
  261. package/dist/functional/result/impl/result-match.d.mts +0 -47
  262. package/dist/functional/result/impl/result-match.d.mts.map +0 -1
  263. package/dist/functional/result/impl/result-match.mjs +0 -20
  264. package/dist/functional/result/impl/result-match.mjs.map +0 -1
  265. package/dist/functional/result/impl/result-ok.d.mts +0 -28
  266. package/dist/functional/result/impl/result-ok.d.mts.map +0 -1
  267. package/dist/functional/result/impl/result-ok.mjs +0 -31
  268. package/dist/functional/result/impl/result-ok.mjs.map +0 -1
  269. package/dist/functional/result/impl/result-or-else.d.mts +0 -40
  270. package/dist/functional/result/impl/result-or-else.d.mts.map +0 -1
  271. package/dist/functional/result/impl/result-or-else.mjs +0 -17
  272. package/dist/functional/result/impl/result-or-else.mjs.map +0 -1
  273. package/dist/functional/result/impl/result-safe-try.d.mts +0 -51
  274. package/dist/functional/result/impl/result-safe-try.d.mts.map +0 -1
  275. package/dist/functional/result/impl/result-safe-try.mjs +0 -35
  276. package/dist/functional/result/impl/result-safe-try.mjs.map +0 -1
  277. package/dist/functional/result/impl/result-safe-unwrap.d.mts +0 -36
  278. package/dist/functional/result/impl/result-safe-unwrap.d.mts.map +0 -1
  279. package/dist/functional/result/impl/result-safe-unwrap.mjs +0 -42
  280. package/dist/functional/result/impl/result-safe-unwrap.mjs.map +0 -1
  281. package/dist/functional/result/impl/result-swap.d.mts +0 -23
  282. package/dist/functional/result/impl/result-swap.d.mts.map +0 -1
  283. package/dist/functional/result/impl/result-swap.mjs +0 -27
  284. package/dist/functional/result/impl/result-swap.mjs.map +0 -1
  285. package/dist/functional/result/impl/result-to-optional.d.mts +0 -32
  286. package/dist/functional/result/impl/result-to-optional.d.mts.map +0 -1
  287. package/dist/functional/result/impl/result-to-optional.mjs +0 -32
  288. package/dist/functional/result/impl/result-to-optional.mjs.map +0 -1
  289. package/dist/functional/result/impl/result-unwrap-err-or.d.mts +0 -33
  290. package/dist/functional/result/impl/result-unwrap-err-or.d.mts.map +0 -1
  291. package/dist/functional/result/impl/result-unwrap-err-or.mjs +0 -17
  292. package/dist/functional/result/impl/result-unwrap-err-or.mjs.map +0 -1
  293. package/dist/functional/result/impl/result-unwrap-err-throw.d.mts +0 -33
  294. package/dist/functional/result/impl/result-unwrap-err-throw.d.mts.map +0 -1
  295. package/dist/functional/result/impl/result-unwrap-err-throw.mjs +0 -46
  296. package/dist/functional/result/impl/result-unwrap-err-throw.mjs.map +0 -1
  297. package/dist/functional/result/impl/result-unwrap-err.d.mts +0 -33
  298. package/dist/functional/result/impl/result-unwrap-err.d.mts.map +0 -1
  299. package/dist/functional/result/impl/result-unwrap-err.mjs +0 -34
  300. package/dist/functional/result/impl/result-unwrap-err.mjs.map +0 -1
  301. package/dist/functional/result/impl/result-unwrap-ok-or.d.mts +0 -33
  302. package/dist/functional/result/impl/result-unwrap-ok-or.d.mts.map +0 -1
  303. package/dist/functional/result/impl/result-unwrap-ok-or.mjs +0 -17
  304. package/dist/functional/result/impl/result-unwrap-ok-or.mjs.map +0 -1
  305. package/dist/functional/result/impl/result-unwrap-ok.d.mts +0 -26
  306. package/dist/functional/result/impl/result-unwrap-ok.d.mts.map +0 -1
  307. package/dist/functional/result/impl/result-unwrap-ok.mjs +0 -8
  308. package/dist/functional/result/impl/result-unwrap-ok.mjs.map +0 -1
  309. package/dist/functional/result/impl/result-unwrap-throw.d.mts +0 -33
  310. package/dist/functional/result/impl/result-unwrap-throw.d.mts.map +0 -1
  311. package/dist/functional/result/impl/result-unwrap-throw.mjs +0 -40
  312. package/dist/functional/result/impl/result-unwrap-throw.mjs.map +0 -1
  313. package/dist/functional/result/impl/result-zip.d.mts +0 -32
  314. package/dist/functional/result/impl/result-zip.d.mts.map +0 -1
  315. package/dist/functional/result/impl/result-zip.mjs +0 -37
  316. package/dist/functional/result/impl/result-zip.mjs.map +0 -1
  317. package/dist/functional/result/impl/tag.d.mts +0 -6
  318. package/dist/functional/result/impl/tag.d.mts.map +0 -1
  319. package/dist/functional/result/impl/tag.mjs +0 -4
  320. package/dist/functional/result/impl/tag.mjs.map +0 -1
  321. package/dist/functional/result/impl/types.d.mts +0 -31
  322. package/dist/functional/result/impl/types.d.mts.map +0 -1
  323. package/dist/functional/result/impl/types.mjs +0 -2
  324. package/dist/functional/result/impl/types.mjs.map +0 -1
  325. package/dist/functional/result/index.d.mts +0 -2
  326. package/dist/functional/result/index.d.mts.map +0 -1
  327. package/dist/functional/result/index.mjs +0 -2
  328. package/dist/functional/result/index.mjs.map +0 -1
  329. package/dist/functional/result/result.d.mts +0 -16
  330. package/dist/functional/result/result.d.mts.map +0 -1
  331. package/dist/functional/result/result.mjs +0 -2
  332. package/dist/functional/result/result.mjs.map +0 -1
  333. package/dist/functional/ternary-result/impl/index.d.mts +0 -29
  334. package/dist/functional/ternary-result/impl/index.d.mts.map +0 -1
  335. package/dist/functional/ternary-result/impl/index.mjs +0 -29
  336. package/dist/functional/ternary-result/impl/index.mjs.map +0 -1
  337. package/dist/functional/ternary-result/impl/tag.d.mts +0 -8
  338. package/dist/functional/ternary-result/impl/tag.d.mts.map +0 -1
  339. package/dist/functional/ternary-result/impl/tag.mjs +0 -6
  340. package/dist/functional/ternary-result/impl/tag.mjs.map +0 -1
  341. package/dist/functional/ternary-result/impl/ternary-result-err.d.mts +0 -16
  342. package/dist/functional/ternary-result/impl/ternary-result-err.d.mts.map +0 -1
  343. package/dist/functional/ternary-result/impl/ternary-result-err.mjs +0 -19
  344. package/dist/functional/ternary-result/impl/ternary-result-err.mjs.map +0 -1
  345. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.d.mts +0 -24
  346. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.d.mts.map +0 -1
  347. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.mjs +0 -21
  348. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.mjs.map +0 -1
  349. package/dist/functional/ternary-result/impl/ternary-result-flat-map.d.mts +0 -39
  350. package/dist/functional/ternary-result/impl/ternary-result-flat-map.d.mts.map +0 -1
  351. package/dist/functional/ternary-result/impl/ternary-result-flat-map.mjs +0 -38
  352. package/dist/functional/ternary-result/impl/ternary-result-flat-map.mjs.map +0 -1
  353. package/dist/functional/ternary-result/impl/ternary-result-fold.d.mts +0 -30
  354. package/dist/functional/ternary-result/impl/ternary-result-fold.d.mts.map +0 -1
  355. package/dist/functional/ternary-result/impl/ternary-result-fold.mjs +0 -33
  356. package/dist/functional/ternary-result/impl/ternary-result-fold.mjs.map +0 -1
  357. package/dist/functional/ternary-result/impl/ternary-result-from-promise.d.mts +0 -23
  358. package/dist/functional/ternary-result/impl/ternary-result-from-promise.d.mts.map +0 -1
  359. package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs +0 -23
  360. package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs.map +0 -1
  361. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts +0 -20
  362. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts.map +0 -1
  363. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs +0 -33
  364. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs.map +0 -1
  365. package/dist/functional/ternary-result/impl/ternary-result-is-err.d.mts +0 -21
  366. package/dist/functional/ternary-result/impl/ternary-result-is-err.d.mts.map +0 -1
  367. package/dist/functional/ternary-result/impl/ternary-result-is-err.mjs +0 -20
  368. package/dist/functional/ternary-result/impl/ternary-result-is-err.mjs.map +0 -1
  369. package/dist/functional/ternary-result/impl/ternary-result-is-ok.d.mts +0 -23
  370. package/dist/functional/ternary-result/impl/ternary-result-is-ok.d.mts.map +0 -1
  371. package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs +0 -22
  372. package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs.map +0 -1
  373. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts +0 -22
  374. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts.map +0 -1
  375. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs +0 -28
  376. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs.map +0 -1
  377. package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts +0 -22
  378. package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts.map +0 -1
  379. package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs +0 -21
  380. package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs.map +0 -1
  381. package/dist/functional/ternary-result/impl/ternary-result-map-err.d.mts +0 -27
  382. package/dist/functional/ternary-result/impl/ternary-result-map-err.d.mts.map +0 -1
  383. package/dist/functional/ternary-result/impl/ternary-result-map-err.mjs +0 -23
  384. package/dist/functional/ternary-result/impl/ternary-result-map-err.mjs.map +0 -1
  385. package/dist/functional/ternary-result/impl/ternary-result-map-warn.d.mts +0 -28
  386. package/dist/functional/ternary-result/impl/ternary-result-map-warn.d.mts.map +0 -1
  387. package/dist/functional/ternary-result/impl/ternary-result-map-warn.mjs +0 -26
  388. package/dist/functional/ternary-result/impl/ternary-result-map-warn.mjs.map +0 -1
  389. package/dist/functional/ternary-result/impl/ternary-result-map.d.mts +0 -36
  390. package/dist/functional/ternary-result/impl/ternary-result-map.d.mts.map +0 -1
  391. package/dist/functional/ternary-result/impl/ternary-result-map.mjs +0 -32
  392. package/dist/functional/ternary-result/impl/ternary-result-map.mjs.map +0 -1
  393. package/dist/functional/ternary-result/impl/ternary-result-ok.d.mts +0 -17
  394. package/dist/functional/ternary-result/impl/ternary-result-ok.d.mts.map +0 -1
  395. package/dist/functional/ternary-result/impl/ternary-result-ok.mjs +0 -20
  396. package/dist/functional/ternary-result/impl/ternary-result-ok.mjs.map +0 -1
  397. package/dist/functional/ternary-result/impl/ternary-result-or-else.d.mts +0 -29
  398. package/dist/functional/ternary-result/impl/ternary-result-or-else.d.mts.map +0 -1
  399. package/dist/functional/ternary-result/impl/ternary-result-or-else.mjs +0 -16
  400. package/dist/functional/ternary-result/impl/ternary-result-or-else.mjs.map +0 -1
  401. package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts +0 -23
  402. package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts.map +0 -1
  403. package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs +0 -26
  404. package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs.map +0 -1
  405. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.d.mts +0 -28
  406. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.d.mts.map +0 -1
  407. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.mjs +0 -14
  408. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.mjs.map +0 -1
  409. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.d.mts +0 -20
  410. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.d.mts.map +0 -1
  411. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs +0 -34
  412. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs.map +0 -1
  413. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.d.mts +0 -20
  414. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.d.mts.map +0 -1
  415. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs +0 -21
  416. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs.map +0 -1
  417. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.d.mts +0 -25
  418. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.d.mts.map +0 -1
  419. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mjs +0 -14
  420. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mjs.map +0 -1
  421. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.d.mts +0 -20
  422. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.d.mts.map +0 -1
  423. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.mjs +0 -10
  424. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.mjs.map +0 -1
  425. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.d.mts +0 -21
  426. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.d.mts.map +0 -1
  427. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs +0 -35
  428. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs.map +0 -1
  429. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.d.mts +0 -22
  430. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.d.mts.map +0 -1
  431. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mjs +0 -14
  432. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mjs.map +0 -1
  433. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.d.mts +0 -20
  434. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.d.mts.map +0 -1
  435. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs +0 -30
  436. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs.map +0 -1
  437. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.d.mts +0 -20
  438. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.d.mts.map +0 -1
  439. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs +0 -21
  440. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs.map +0 -1
  441. package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts +0 -19
  442. package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts.map +0 -1
  443. package/dist/functional/ternary-result/impl/ternary-result-warn.mjs +0 -23
  444. package/dist/functional/ternary-result/impl/ternary-result-warn.mjs.map +0 -1
  445. package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts +0 -34
  446. package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts.map +0 -1
  447. package/dist/functional/ternary-result/impl/ternary-result-zip.mjs +0 -52
  448. package/dist/functional/ternary-result/impl/ternary-result-zip.mjs.map +0 -1
  449. package/dist/functional/ternary-result/impl/types.d.mts +0 -26
  450. package/dist/functional/ternary-result/impl/types.d.mts.map +0 -1
  451. package/dist/functional/ternary-result/impl/types.mjs +0 -2
  452. package/dist/functional/ternary-result/impl/types.mjs.map +0 -1
  453. package/dist/functional/ternary-result/impl/variant-name.d.mts +0 -4
  454. package/dist/functional/ternary-result/impl/variant-name.d.mts.map +0 -1
  455. package/dist/functional/ternary-result/impl/variant-name.mjs +0 -13
  456. package/dist/functional/ternary-result/impl/variant-name.mjs.map +0 -1
  457. package/dist/functional/ternary-result/index.d.mts +0 -2
  458. package/dist/functional/ternary-result/index.d.mts.map +0 -1
  459. package/dist/functional/ternary-result/index.mjs +0 -2
  460. package/dist/functional/ternary-result/index.mjs.map +0 -1
  461. package/dist/functional/ternary-result/ternary-result.d.mts +0 -40
  462. package/dist/functional/ternary-result/ternary-result.d.mts.map +0 -1
  463. package/dist/functional/ternary-result/ternary-result.mjs +0 -2
  464. package/dist/functional/ternary-result/ternary-result.mjs.map +0 -1
  465. package/src/functional/async-result/async-result.mts +0 -17
  466. package/src/functional/async-result/impl/async-result-flat-map.mts +0 -99
  467. package/src/functional/async-result/impl/async-result-from-promise.mts +0 -69
  468. package/src/functional/async-result/impl/async-result-from-throwable.mts +0 -78
  469. package/src/functional/async-result/impl/async-result-map-err.mts +0 -84
  470. package/src/functional/async-result/impl/async-result-map.mts +0 -94
  471. package/src/functional/async-result/impl/async-result-unwrap-or.mts +0 -42
  472. package/src/functional/async-result/impl/index.mts +0 -7
  473. package/src/functional/async-result/impl/types.mts +0 -51
  474. package/src/functional/async-result/index.mts +0 -1
  475. package/src/functional/async-result.test.mts +0 -291
  476. package/src/functional/match.mts +0 -193
  477. package/src/functional/match.test.mts +0 -180
  478. package/src/functional/optional/impl/index.mts +0 -18
  479. package/src/functional/optional/impl/optional-expect-to-be.mts +0 -75
  480. package/src/functional/optional/impl/optional-filter.mts +0 -78
  481. package/src/functional/optional/impl/optional-flat-map.mts +0 -75
  482. package/src/functional/optional/impl/optional-from-nullable.mts +0 -31
  483. package/src/functional/optional/impl/optional-is-none.mts +0 -26
  484. package/src/functional/optional/impl/optional-is-optional.mts +0 -30
  485. package/src/functional/optional/impl/optional-is-some.mts +0 -27
  486. package/src/functional/optional/impl/optional-map.mts +0 -90
  487. package/src/functional/optional/impl/optional-match.mts +0 -108
  488. package/src/functional/optional/impl/optional-none.mts +0 -20
  489. package/src/functional/optional/impl/optional-or-else.mts +0 -83
  490. package/src/functional/optional/impl/optional-some.mts +0 -27
  491. package/src/functional/optional/impl/optional-to-nullable.mts +0 -34
  492. package/src/functional/optional/impl/optional-unwrap-or.mts +0 -70
  493. package/src/functional/optional/impl/optional-unwrap-throw.mts +0 -41
  494. package/src/functional/optional/impl/optional-unwrap.mts +0 -45
  495. package/src/functional/optional/impl/optional-zip.mts +0 -44
  496. package/src/functional/optional/impl/tag.mts +0 -8
  497. package/src/functional/optional/impl/types.mts +0 -31
  498. package/src/functional/optional/index.mts +0 -1
  499. package/src/functional/optional/optional.mts +0 -19
  500. package/src/functional/optional.test.mts +0 -883
  501. package/src/functional/pipe.mts +0 -180
  502. package/src/functional/pipe.test.mts +0 -155
  503. package/src/functional/result/impl/index.mts +0 -27
  504. package/src/functional/result/impl/result-err.mts +0 -33
  505. package/src/functional/result/impl/result-expect-to-be.mts +0 -73
  506. package/src/functional/result/impl/result-flat-map.mts +0 -88
  507. package/src/functional/result/impl/result-fold.mts +0 -102
  508. package/src/functional/result/impl/result-from-optional.mts +0 -80
  509. package/src/functional/result/impl/result-from-promise.mts +0 -51
  510. package/src/functional/result/impl/result-from-throwable.mts +0 -48
  511. package/src/functional/result/impl/result-is-err.mts +0 -26
  512. package/src/functional/result/impl/result-is-ok.mts +0 -26
  513. package/src/functional/result/impl/result-is-result.mts +0 -28
  514. package/src/functional/result/impl/result-map-err.mts +0 -96
  515. package/src/functional/result/impl/result-map.mts +0 -96
  516. package/src/functional/result/impl/result-match.mts +0 -108
  517. package/src/functional/result/impl/result-ok.mts +0 -33
  518. package/src/functional/result/impl/result-or-else.mts +0 -73
  519. package/src/functional/result/impl/result-safe-try.mts +0 -110
  520. package/src/functional/result/impl/result-safe-unwrap.mts +0 -50
  521. package/src/functional/result/impl/result-swap.mts +0 -31
  522. package/src/functional/result/impl/result-to-optional.mts +0 -37
  523. package/src/functional/result/impl/result-unwrap-err-or.mts +0 -66
  524. package/src/functional/result/impl/result-unwrap-err-throw.mts +0 -56
  525. package/src/functional/result/impl/result-unwrap-err.mts +0 -38
  526. package/src/functional/result/impl/result-unwrap-ok-or.mts +0 -66
  527. package/src/functional/result/impl/result-unwrap-ok.mts +0 -39
  528. package/src/functional/result/impl/result-unwrap-throw.mts +0 -46
  529. package/src/functional/result/impl/result-zip.mts +0 -42
  530. package/src/functional/result/impl/tag.mts +0 -8
  531. package/src/functional/result/impl/types.mts +0 -38
  532. package/src/functional/result/index.mts +0 -1
  533. package/src/functional/result/result.mts +0 -19
  534. package/src/functional/result.test.mts +0 -1349
  535. package/src/functional/ternary-result/impl/index.mts +0 -28
  536. package/src/functional/ternary-result/impl/tag.mts +0 -17
  537. package/src/functional/ternary-result/impl/ternary-result-err.mts +0 -21
  538. package/src/functional/ternary-result/impl/ternary-result-expect-to-be.mts +0 -65
  539. package/src/functional/ternary-result/impl/ternary-result-flat-map.mts +0 -112
  540. package/src/functional/ternary-result/impl/ternary-result-fold.mts +0 -102
  541. package/src/functional/ternary-result/impl/ternary-result-from-promise.mts +0 -30
  542. package/src/functional/ternary-result/impl/ternary-result-from-throwable.mts +0 -36
  543. package/src/functional/ternary-result/impl/ternary-result-is-err.mts +0 -24
  544. package/src/functional/ternary-result/impl/ternary-result-is-ok.mts +0 -26
  545. package/src/functional/ternary-result/impl/ternary-result-is-ternary-result.mts +0 -32
  546. package/src/functional/ternary-result/impl/ternary-result-is-warn.mts +0 -25
  547. package/src/functional/ternary-result/impl/ternary-result-map-err.mts +0 -74
  548. package/src/functional/ternary-result/impl/ternary-result-map-warn.mts +0 -79
  549. package/src/functional/ternary-result/impl/ternary-result-map.mts +0 -95
  550. package/src/functional/ternary-result/impl/ternary-result-ok.mts +0 -22
  551. package/src/functional/ternary-result/impl/ternary-result-or-else.mts +0 -72
  552. package/src/functional/ternary-result/impl/ternary-result-to-optional.mts +0 -31
  553. package/src/functional/ternary-result/impl/ternary-result-unwrap-err-or.mts +0 -54
  554. package/src/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mts +0 -42
  555. package/src/functional/ternary-result/impl/ternary-result-unwrap-err.mts +0 -25
  556. package/src/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mts +0 -51
  557. package/src/functional/ternary-result/impl/ternary-result-unwrap-ok.mts +0 -39
  558. package/src/functional/ternary-result/impl/ternary-result-unwrap-throw.mts +0 -48
  559. package/src/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mts +0 -48
  560. package/src/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mts +0 -40
  561. package/src/functional/ternary-result/impl/ternary-result-unwrap-warn.mts +0 -25
  562. package/src/functional/ternary-result/impl/ternary-result-warn.mts +0 -28
  563. package/src/functional/ternary-result/impl/ternary-result-zip.mts +0 -61
  564. package/src/functional/ternary-result/impl/types.mts +0 -46
  565. package/src/functional/ternary-result/impl/variant-name.mts +0 -18
  566. package/src/functional/ternary-result/index.mts +0 -1
  567. package/src/functional/ternary-result/ternary-result.mts +0 -50
  568. package/src/functional/ternary-result.test.mts +0 -310
  569. package/src/guard/has-key.test.mts +0 -111
  570. package/src/guard/is-non-null-object.test.mts +0 -109
  571. package/src/guard/is-record.test.mts +0 -195
  572. package/src/guard/key-is-in.test.mts +0 -21
  573. package/src/others/unknown-to-string.test.mts +0 -295
@@ -1,94 +1,3 @@
1
- import { isDate, isError, isMap, isRegExp, isSet } from '@sindresorhus/is';
2
1
 
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
- export const unknownToString = (value, options) => {
37
- switch (typeof value) {
38
- case 'string':
39
- return value;
40
- case 'bigint':
41
- return `${value.toString()}n`;
42
- case 'number':
43
- case 'boolean':
44
- case 'symbol':
45
- case 'function':
46
- return value.toString();
47
- case 'undefined':
48
- return 'undefined';
49
- case 'object': {
50
- if (value === null) {
51
- return 'null';
52
- }
53
- try {
54
-
55
- if (isDate(value)) {
56
- return value.toISOString();
57
- }
58
-
59
- if (isRegExp(value)) {
60
- return value.toString();
61
- }
62
- if (isError(value)) {
63
- return value.message;
64
- }
65
- const prettyPrintObject = options?.prettyPrintObject === true;
66
-
67
- if (isMap(value)) {
68
- const entries = Array.from(value);
69
- const entriesStr = prettyPrintObject
70
- ? JSON.stringify(entries, undefined, 2)
71
- : JSON.stringify(entries);
72
- return `Map(${entriesStr})`;
73
- }
74
-
75
- if (isSet(value)) {
76
- const values = Array.from(value);
77
- const valuesStr = prettyPrintObject
78
- ? JSON.stringify(values, undefined, 2)
79
- : JSON.stringify(values);
80
- return `Set(${valuesStr})`;
81
- }
82
- return prettyPrintObject
83
- ? JSON.stringify(value, undefined, 2)
84
- : JSON.stringify(value);
85
- }
86
- catch (error) {
87
- return isError(error)
88
- ? error.message
89
- : '[Circular or Non-serializable]';
90
- }
91
- }
92
- }
93
- };
2
+ export { unknownToString } from 'ts-std-forge';
94
3
  //# sourceMappingURL=unknown-to-string.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"unknown-to-string.mjs","sourceRoot":"","sources":["../../src/others/unknown-to-string.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,KAAc,EACd,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BAC9B,CAAC;gBAED,2BAA2B;gBAC3B,IAAI,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;oBACjB,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;oBAEjC,MAAM,SAAS,GAAG,iBAAiB;wBACjC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;wBACtC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;oBAE3B,OAAO,OAAO,SAAS,GAAG,CAAC;gBAC7B,CAAC;gBAED,OAAO,iBAAiB;oBACtB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;oBACrC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,OAAO,CAAC,KAAK,CAAC;oBACnB,CAAC,CAAC,KAAK,CAAC,OAAO;oBACf,CAAC,CAAC,gCAAgC,CAAC;YACvC,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC,CAAC"}
1
+ {"version":3,"file":"unknown-to-string.mjs","sourceRoot":"","sources":["../../src/others/unknown-to-string.mts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
package/dist/types.d.mts CHANGED
@@ -22,45 +22,5 @@ export declare namespace SizeType {
22
22
  type ArgTypedArrayPositive = WithSmallInt<IntersectBrand<PositiveNumber, TypedArray>>;
23
23
  type ArgStrPositive = WithSmallInt<IntersectBrand<PositiveNumber, Str>>;
24
24
  }
25
- /**
26
- * Represents the 'Some' variant of an Optional, containing a value.
27
- *
28
- * @template S The type of the contained value.
29
- */
30
- export type Some<S> = Readonly<{
31
- /** @internal Discriminant property for the 'Some' type. */
32
- $$tag: 'ts-data-forge::Optional.some';
33
- /** The contained value. */
34
- value: S;
35
- }>;
36
- /**
37
- * Represents the 'None' variant of an Optional, indicating the absence
38
- * of a value.
39
- */
40
- export type None = Readonly<{
41
- /** @internal Discriminant property for the 'None' type. */
42
- $$tag: 'ts-data-forge::Optional.none';
43
- }>;
44
- /**
45
- * Represents a `Result` that is a success, containing a value.
46
- *
47
- * @template S The type of the success value.
48
- */
49
- export type Ok<S> = Readonly<{
50
- /** @internal Discriminant property for the 'Ok' type. */
51
- $$tag: 'ts-data-forge::Result.ok';
52
- /** The success value. */
53
- value: S;
54
- }>;
55
- /**
56
- * Represents a `Result` that is an error, containing an error value.
57
- *
58
- * @template E The type of the error value.
59
- */
60
- export type Err<E> = Readonly<{
61
- /** @internal Discriminant property for the 'Err' type. */
62
- $$tag: 'ts-data-forge::Result.err';
63
- /** The error value. */
64
- value: E;
65
- }>;
25
+ export type { Err, None, Ok, Some } from 'ts-std-forge';
66
26
  //# sourceMappingURL=types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,KAAK,YAAY,EAClB,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;AAEzD,iFAAiF;AACjF,MAAM,MAAM,aAAa,GAAG,SAAS,CAAC;AAEtC,MAAM,MAAM,UAAU,CAAC,EAAE,SAAS,SAAS,OAAO,EAAE,IAClD,iBAAiB,CAAC,EAAE,CAAC,SAAS,IAAI,GAAG,YAAY,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC;AAEvE,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GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IAEvD,KAAY,cAAc,GAAG,YAAY,CACvC,cAAc,CAAC,cAAc,EAAE,GAAG,CAAC,CACpC,CAAC;IAEF,KAAY,qBAAqB,GAAG,YAAY,CAC9C,cAAc,CAAC,cAAc,EAAE,UAAU,CAAC,CAC3C,CAAC;IAEF,KAAY,cAAc,GAAG,YAAY,CACvC,cAAc,CAAC,cAAc,EAAE,GAAG,CAAC,CACpC,CAAC;CACH;AAKD,YAAY,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC"}
package/dist/types.mjs CHANGED
@@ -1,3 +1,2 @@
1
1
  export {};
2
-
3
2
  //# sourceMappingURL=types.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.mts"],"names":[],"mappings":";AAkIA,oBAAoB"}
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.mts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-data-forge",
3
- "version": "14.6.4",
3
+ "version": "14.7.1",
4
4
  "private": false,
5
5
  "keywords": [
6
6
  "typescript",
@@ -37,25 +37,25 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@sindresorhus/is": "^8.1.0",
40
+ "ts-std-forge": "^0.5.1",
40
41
  "ts-type-forge": "~9.2.2"
41
42
  },
42
43
  "devDependencies": {
43
44
  "@emotion/react": "11.14.0",
44
45
  "@emotion/styled": "11.14.1",
45
46
  "@mui/material": "9.4.0",
46
- "@types/react": "19.2.18",
47
- "@vitest/browser-playwright": "4.1.11",
48
- "dedent": "1.7.2",
49
- "eslint-config-typed": "5.11.2",
50
- "eslint-plugin-ts-fortress": "1.2.0",
51
- "eslint-plugin-ts-type-forge": "0.8.1",
47
+ "@types/react": "19.3.0",
48
+ "@vitest/browser-playwright": "5.0.0",
49
+ "eslint-config-typed": "5.11.7",
50
+ "eslint-plugin-ts-fortress": "1.2.2",
51
+ "eslint-plugin-ts-type-forge": "0.8.3",
52
52
  "immer": "11.1.18",
53
53
  "playwright": "1.62.1",
54
54
  "prettier": "3.9.6",
55
55
  "prettier-plugin-organize-imports": "4.3.0",
56
56
  "prettier-plugin-packagejson": "3.0.2",
57
57
  "react": "19.2.8",
58
- "ts-repo-utils": "10.6.1",
58
+ "ts-repo-utils": "10.6.2",
59
59
  "typedoc": "0.28.20",
60
60
  "typedoc-github-theme": "0.4.0",
61
61
  "vite": "8.2.2"
@@ -85,7 +85,7 @@
85
85
  "fmt:full": "pnpm run z:prettier .",
86
86
  "gen:branded-number": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/gen-branded-number/generate.mts && pnpm run doc:embed:jsdoc && pnpm run z:prettier 'src/number/branded-types/*.mts' 'src/number/enum/*.mts'",
87
87
  "gi": "run-s gi:src fmt",
88
- "gi:src": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json scripts/cmd/gen-index.mts",
88
+ "gi:src": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ../../libs/ts-repo-utils/src/cmd/gen-index-ts.mts ./src --index-ext .mts --export-ext .mjs --target-ext .mts --exclude entry-point.mts --preserve 'array/index.mts' --preserve 'functional/index.mts'",
89
89
  "lint": "eslint .",
90
90
  "lint:fix": "eslint . --fix",
91
91
  "test": "pnpm run z:vitest:node run",
@@ -33,13 +33,21 @@ import {
33
33
  * const rgb = Arr.asFixedLengthArray(3, [255, 128, 0]);
34
34
  *
35
35
  * const atMost5: MaxLengthArray<5, number> = rgb; // OK (3 <= 5)
36
+ *
36
37
  * const red: number = rgb[0]; // OK — no `undefined`
37
38
  *
38
39
  * // curried version
39
40
  * const asRgb = Arr.asFixedLengthArray(3);
41
+ *
40
42
  * const green = asRgb([0, 255, 0]);
41
43
  *
42
- * // Arr.asFixedLengthArray(3, [255, 128]); // throws TypeError
44
+ * assert.deepStrictEqual(Array.from(atMost5), [255, 128, 0]);
45
+ *
46
+ * assert.strictEqual(red, 255);
47
+ *
48
+ * assert.deepStrictEqual(green, [0, 255, 0]);
49
+ *
50
+ * assert.throws(() => Arr.asFixedLengthArray(3, [255, 128]), TypeError);
43
51
  * ```
44
52
  *
45
53
  * @template Length - The exact number of elements.
@@ -110,13 +118,21 @@ const asFixedLengthArrayImpl = <E,>(
110
118
  * const history = Arr.asMinLengthArray(3, [0, 1, 2, 3]);
111
119
  *
112
120
  * const nonEmpty: MinLengthArray<1, number> = history; // OK (3 >= 1)
121
+ *
113
122
  * const first: number = history[0]; // OK — no `undefined`
114
123
  *
115
124
  * // curried version
116
125
  * const asHistory = Arr.asMinLengthArray(3);
126
+ *
117
127
  * const next = asHistory([4, 5, 6, 7]);
118
128
  *
119
- * // Arr.asMinLengthArray(3, [0]); // throws TypeError
129
+ * assert.deepStrictEqual(Array.from(nonEmpty), [0, 1, 2, 3]);
130
+ *
131
+ * assert.strictEqual(first, 0);
132
+ *
133
+ * assert.deepStrictEqual(next, [4, 5, 6, 7]);
134
+ *
135
+ * assert.throws(() => Arr.asMinLengthArray(3, [0]), TypeError);
120
136
  * ```
121
137
  *
122
138
  * @template MinLength - The minimum number of elements (inclusive).
@@ -188,9 +204,14 @@ const asMinLengthArrayImpl = <E,>(
188
204
  *
189
205
  * // curried version
190
206
  * const asTags = Arr.asMaxLengthArray(8);
207
+ *
191
208
  * const more = asTags(['d', 'e']);
192
209
  *
193
- * // Arr.asMaxLengthArray(2, ['a', 'b', 'c']); // throws TypeError
210
+ * assert.deepStrictEqual(Array.from(relaxed), ['a', 'b', 'c']);
211
+ *
212
+ * assert.deepStrictEqual(more, ['d', 'e']);
213
+ *
214
+ * assert.throws(() => Arr.asMaxLengthArray(2, ['a', 'b', 'c']), TypeError);
194
215
  * ```
195
216
  *
196
217
  * @template MaxLength - The maximum number of elements (inclusive).
@@ -264,9 +285,14 @@ const asMaxLengthArrayImpl = <E,>(
264
285
  *
265
286
  * // curried version
266
287
  * const asSelection = Arr.asBoundedLengthArray(1, 5);
288
+ *
267
289
  * const next = asSelection([4, 5]);
268
290
  *
269
- * // Arr.asBoundedLengthArray(1, 5, []); // throws TypeError
291
+ * assert.deepStrictEqual(Array.from(relaxed), [1, 2, 3]);
292
+ *
293
+ * assert.deepStrictEqual(next, [4, 5]);
294
+ *
295
+ * assert.throws(() => Arr.asBoundedLengthArray(1, 5, []), TypeError);
270
296
  * ```
271
297
  *
272
298
  * @template MinLength - The minimum number of elements (inclusive).
@@ -349,7 +375,9 @@ const asBoundedLengthArrayImpl = <E,>(
349
375
  *
350
376
  * const atMost5: MaxLengthArray<5, never> = nothing; // OK (0 <= 5)
351
377
  *
352
- * // Arr.asEmptyArray([1]); // throws TypeError
378
+ * assert.deepStrictEqual(Array.from(atMost5), []);
379
+ *
380
+ * assert.throws(() => Arr.asEmptyArray([1]), TypeError);
353
381
  * ```
354
382
  *
355
383
  * @template Xs - The input array type (tuple types are preserved).
@@ -387,7 +415,9 @@ export const asEmptyArray = <Xs extends readonly unknown[]>(
387
415
  *
388
416
  * const first: number = history[0]; // OK — no `undefined`
389
417
  *
390
- * // Arr.asNonEmptyArray([]); // throws TypeError
418
+ * assert.strictEqual(first, 0);
419
+ *
420
+ * assert.throws(() => Arr.asNonEmptyArray([]), TypeError);
391
421
  * ```
392
422
  *
393
423
  * @template Xs - The input array type (tuple types are preserved).
@@ -36,7 +36,11 @@ import {
36
36
  * // curried version
37
37
  * const asRgb = Arr.asFixedLengthTuple(3);
38
38
  *
39
- * // Arr.asFixedLengthTuple(3, [255, 128]); // throws TypeError
39
+ * assert.strictEqual(red, 255);
40
+ *
41
+ * assert.deepStrictEqual(asRgb([0, 255, 0]), [0, 255, 0]);
42
+ *
43
+ * assert.throws(() => Arr.asFixedLengthTuple(3, [255, 128]), TypeError);
40
44
  * ```
41
45
  *
42
46
  * @template Length - The exact number of elements.
@@ -104,7 +108,11 @@ const asFixedLengthTupleImpl = (
104
108
  * // curried version
105
109
  * const asHistory = Arr.asMinLengthTuple(3);
106
110
  *
107
- * // Arr.asMinLengthTuple(3, [0, 1]); // throws TypeError
111
+ * assert.strictEqual(first, 0);
112
+ *
113
+ * assert.deepStrictEqual(asHistory([4, 5, 6]), [4, 5, 6]);
114
+ *
115
+ * assert.throws(() => Arr.asMinLengthTuple(3, [0, 1]), TypeError);
108
116
  * ```
109
117
  *
110
118
  * @template MinLength - The minimum number of elements (inclusive).
@@ -170,7 +178,11 @@ const asMinLengthTupleImpl = (
170
178
  * // curried version
171
179
  * const asTags = Arr.asMaxLengthTuple(8);
172
180
  *
173
- * // Arr.asMaxLengthTuple(2, ['a', 'b', 'c']); // throws TypeError
181
+ * assert.deepStrictEqual(tags, ['a', 'b', 'c']);
182
+ *
183
+ * assert.deepStrictEqual(asTags(['d', 'e']), ['d', 'e']);
184
+ *
185
+ * assert.throws(() => Arr.asMaxLengthTuple(2, ['a', 'b', 'c']), TypeError);
174
186
  * ```
175
187
  *
176
188
  * @template MaxLength - The maximum number of elements (inclusive).
@@ -236,7 +248,11 @@ const asMaxLengthTupleImpl = (
236
248
  * // curried version
237
249
  * const asSelection = Arr.asBoundedLengthTuple(1, 5);
238
250
  *
239
- * // Arr.asBoundedLengthTuple(1, 2, [1, 2, 3]); // throws TypeError
251
+ * assert.deepStrictEqual(selection, [1, 2, 3]);
252
+ *
253
+ * assert.deepStrictEqual(asSelection([4, 5]), [4, 5]);
254
+ *
255
+ * assert.throws(() => Arr.asBoundedLengthTuple(1, 2, [1, 2, 3]), TypeError);
240
256
  * ```
241
257
  *
242
258
  * @template Min - The minimum number of elements (inclusive).
@@ -311,7 +327,9 @@ const asBoundedLengthTupleImpl = (
311
327
  * ```ts
312
328
  * const nothing = Arr.asEmptyTuple([]);
313
329
  *
314
- * // Arr.asEmptyTuple([1]); // throws TypeError
330
+ * assert.deepStrictEqual(nothing, []);
331
+ *
332
+ * assert.throws(() => Arr.asEmptyTuple([1]), TypeError);
315
333
  * ```
316
334
  *
317
335
  * @template Xs - The input array type (tuple types are preserved).
@@ -345,7 +363,9 @@ export const asEmptyTuple = <Xs extends readonly unknown[]>(
345
363
  *
346
364
  * const first: number = values[0]; // OK — no `undefined`
347
365
  *
348
- * // Arr.asNonEmptyTuple([]); // throws TypeError
366
+ * assert.strictEqual(first, 1);
367
+ *
368
+ * assert.throws(() => Arr.asNonEmptyTuple([]), TypeError);
349
369
  * ```
350
370
  *
351
371
  * @template Xs - The input array type (tuple types are preserved).
@@ -1,78 +1,2 @@
1
- import { type TypeEq, type TypeExtends } from 'ts-type-forge';
2
-
3
- /**
4
- * Compile-time type assertion utility for TypeScript type testing.
5
- *
6
- * This function performs static type relationship checking at compile-time and
7
- * has no runtime effect. It is primarily used in test files to verify that
8
- * TypeScript's type inference and type relationships work as expected. The
9
- * function will cause TypeScript compilation errors if the specified type
10
- * relationship does not hold.
11
- *
12
- * ## Supported Type Relations
13
- *
14
- * ### Equality Relations
15
- *
16
- * - **`"="` (strict equality)**: Asserts that types `A` and `B` are exactly the
17
- * same type. Uses TypeScript's internal type equality checking.
18
- * - **`"!="` (strict inequality)**: Asserts that types `A` and `B` are not
19
- * exactly the same type.
20
- *
21
- * ### Assignability Relations
22
- *
23
- * - **`"~="` (mutual assignability)**: Asserts that `A` extends `B` AND `B`
24
- * extends `A`. Types are structurally equivalent and mutually assignable.
25
- * - **`"<="` (subtype relation)**: Asserts that type `A` extends (is assignable
26
- * to) type `B`. Type `A` is a subtype of `B`.
27
- * - **`">="` (supertype relation)**: Asserts that type `B` extends (is assignable
28
- * to) type `A`. Type `A` is a supertype of `B`.
29
- *
30
- * ### Negative Assignability Relations
31
- *
32
- * - **`"!<="` (not subtype)**: Asserts that type `A` does NOT extend type `B`.
33
- * - **`"!>="` (not supertype)**: Asserts that type `B` does NOT extend type `A`.
34
- *
35
- * ## Type Parameter Constraints
36
- *
37
- * @since 1.0.0
38
- * @template A - The first type for comparison. Can be any TypeScript type
39
- * including:
40
- *
41
- * - Primitive types (string, number, boolean, etc.)
42
- * - Object types and interfaces
43
- * - Union and intersection types
44
- * - Generic types and type parameters
45
- * - Literal types and branded types
46
- * - Function types and return types
47
- *
48
- * @template B - The second type for comparison. Same constraints as type `A`.
49
- * @param _relation - A string literal representing the expected type
50
- * relationship. TypeScript's type system automatically infers and restricts
51
- * the available operators based on the actual relationship between types `A`
52
- * and `B`. If an invalid relationship is specified, TypeScript will show a
53
- * compilation error.
54
- *
55
- * Combine `expectType` with runtime assertions for comprehensive testing:
56
- *
57
- * ## Important Notes
58
- *
59
- * - **Compile-time only**: This function has no runtime behavior and will be
60
- * optimized away.
61
- * - **Type inference**: The available relation operators are automatically
62
- * inferred by TypeScript based on the actual type relationship between
63
- * `A` and `B`.
64
- * - **Error feedback**: Invalid type relationships will cause clear TypeScript
65
- * compilation errors.
66
- * - **Test organization**: Typically used in `.test.mts` files alongside runtime
67
- * assertions.
68
- * - **Performance**: Has zero runtime overhead as it's purely a compile-time
69
- * construct.
70
- */
71
- export const expectType = <A, B>(
72
- _relation: TypeEq<A, B> extends true
73
- ? '<=' | '=' | '>=' | '~='
74
- : | '!='
75
- | (TypeExtends<A, B> extends true
76
- ? '<=' | (TypeExtends<B, A> extends true ? '>=' | '~=' : '!>=')
77
- : '!<=' | (TypeExtends<B, A> extends true ? '>=' : '!>=')),
78
- ): void => undefined;
1
+ /** Implemented in ts-std-forge since Sumi D-49; re-exported here. */
2
+ export { expectType } from 'ts-std-forge';
@@ -1,6 +1,31 @@
1
- export * from './async-result/index.mjs';
2
- export * from './match.mjs';
3
- export * from './optional/index.mjs';
4
- export * from './pipe.mjs';
5
- export * from './result/index.mjs';
6
- export * from './ternary-result/index.mjs';
1
+ /**
2
+ * The algebraic data type core. The implementation lives in ts-std-forge
3
+ * since Sumi D-49 reversed the dependency between the two packages; what
4
+ * remains here is the re-export that keeps `import { Result } from
5
+ * 'ts-data-forge'` working. Both names denote the same declarations, so a
6
+ * value built through either package is the same type to both.
7
+ *
8
+ * New code should import these from `ts-std-forge` directly.
9
+ */
10
+ export {
11
+ AsyncResult,
12
+ Optional,
13
+ Result,
14
+ TernaryResult,
15
+ match,
16
+ pipe,
17
+ } from 'ts-std-forge';
18
+
19
+ export type {
20
+ Err,
21
+ None,
22
+ Ok,
23
+ Pipe,
24
+ Some,
25
+ TernaryErr,
26
+ TernaryOk,
27
+ TernaryWarn,
28
+ UnknownOptional,
29
+ UnknownResult,
30
+ UnknownTernaryResult,
31
+ } from 'ts-std-forge';
@@ -1,72 +1,2 @@
1
- import { type ReadonlyRecord, type UnknownRecord } from 'ts-type-forge';
2
-
3
- /**
4
- * Type guard function that checks if an object has a specific key as its own
5
- * property.
6
- *
7
- * This function uses `Object.hasOwn()` to check if the given object has the
8
- * specified key as its own property (not inherited). It acts as a type guard
9
- * that narrows the type of the object to guarantee the key exists, enabling
10
- * type-safe property access.
11
- *
12
- * **Type Narrowing Behavior:**
13
- *
14
- * - When the guard returns `true`, TypeScript narrows the object type to include
15
- * the checked key
16
- * - For union types, only union members that contain the key are preserved
17
- * - The key's value type is preserved from the original object type when possible
18
- *
19
- * @example
20
- *
21
- * ```ts
22
- * const maybeUser: Readonly<{ id?: number; name?: string }> = {
23
- * id: 42,
24
- * } as const;
25
- *
26
- * if (hasKey(maybeUser, 'id')) {
27
- * // `maybeUser` is now known to have an `id` property.
28
- * assert.isTrue(maybeUser.id === 42);
29
- * } else {
30
- * assert.fail();
31
- * }
32
- * ```
33
- *
34
- * @template R - The type of the input object, must extend UnknownRecord
35
- * @template K - The type of the key to check for, must extend PropertyKey
36
- * (string | number | symbol)
37
- * @param obj - The object to check for the presence of the key
38
- * @param key - The key to check for in the object
39
- * @returns `true` if the object has the specified key as its own property,
40
- * `false` otherwise. When `true`, TypeScript narrows the object type to
41
- * guarantee the key exists.
42
- * @see {@link keyIsIn} - Similar function that narrows the key type instead of the object type
43
- */
44
- export const hasKey = <
45
- const R extends UnknownRecord,
46
- const K extends PropertyKey,
47
- >(
48
- obj: R,
49
- key: K,
50
- ): obj is HasKeyReturnType<R, K> => Object.hasOwn(obj, key);
51
-
52
- /**
53
- * @internal
54
- * When R is a union type (including the case with only one element), if any element in the union
55
- * contains K as a key, returns a type that narrows the union to only those elements that contain K as a key.
56
- * If none of the elements in the union contain K as a key, returns `ReadonlyRecord<K, unknown>`.
57
- * The result is made readonly.
58
- */
59
- export type HasKeyReturnType<
60
- R extends UnknownRecord,
61
- K extends PropertyKey,
62
- > = R extends R // union distribution
63
- ? K extends keyof R
64
- ? string extends keyof R
65
- ? ReadonlyRecord<K, R[keyof R]> & R
66
- : number extends keyof R
67
- ? ReadonlyRecord<K, R[keyof R]> & R
68
- : symbol extends keyof R
69
- ? ReadonlyRecord<K, R[keyof R]> & R
70
- : R
71
- : never // omit union member that does not have key K
72
- : never; // dummy case for union distribution
1
+ /** Implemented in ts-std-forge since Sumi D-49; re-exported here. */
2
+ export { hasKey, type HasKeyReturnType } from 'ts-std-forge';
@@ -1,36 +1,2 @@
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
- export const isNonNullObject = (u: unknown): u is object =>
36
- typeof u === 'object' && u !== null;
1
+ /** Implemented in ts-std-forge since Sumi D-49; re-exported here. */
2
+ export { isNonNullObject } from 'ts-std-forge';