type-plus 6.8.1 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (531) hide show
  1. package/README.md +1054 -355
  2. package/cjs/array/{array.d.ts → array.at.d.ts} +4 -14
  3. package/cjs/array/array.at.d.ts.map +1 -0
  4. package/cjs/array/{pad_left.js → array.at.js} +1 -1
  5. package/cjs/array/array.at.js.map +1 -0
  6. package/cjs/array/array.concat.d.ts +13 -0
  7. package/cjs/array/array.concat.d.ts.map +1 -0
  8. package/cjs/array/array.concat.js +3 -0
  9. package/cjs/array/array.concat.js.map +1 -0
  10. package/cjs/array/array.entries.d.ts +17 -0
  11. package/cjs/array/array.entries.d.ts.map +1 -0
  12. package/cjs/array/array.entries.js +3 -0
  13. package/cjs/array/array.entries.js.map +1 -0
  14. package/cjs/array/array.find.d.ts +21 -0
  15. package/cjs/array/array.find.d.ts.map +1 -0
  16. package/cjs/array/{find_first.js → array.find.js} +1 -1
  17. package/cjs/array/array.find.js.map +1 -0
  18. package/cjs/array/array.find_last.d.ts +17 -0
  19. package/cjs/array/array.find_last.d.ts.map +1 -0
  20. package/cjs/array/array.find_last.js +3 -0
  21. package/cjs/array/array.find_last.js.map +1 -0
  22. package/cjs/array/array.reverse.d.ts +2 -0
  23. package/cjs/array/array.reverse.d.ts.map +1 -0
  24. package/cjs/array/array.reverse.js +3 -0
  25. package/cjs/array/array.reverse.js.map +1 -0
  26. package/cjs/array/array.some.d.ts +29 -0
  27. package/cjs/array/array.some.d.ts.map +1 -0
  28. package/cjs/array/array.some.js +3 -0
  29. package/cjs/array/array.some.js.map +1 -0
  30. package/cjs/array/array_index.d.ts +8 -8
  31. package/cjs/array/array_index.d.ts.map +1 -1
  32. package/cjs/array/array_plus.d.ts +9 -1
  33. package/cjs/array/array_plus.d.ts.map +1 -1
  34. package/cjs/array/array_plus.split_at.d.ts +30 -0
  35. package/cjs/array/array_plus.split_at.d.ts.map +1 -0
  36. package/cjs/array/array_plus.split_at.js +3 -0
  37. package/cjs/array/array_plus.split_at.js.map +1 -0
  38. package/cjs/array/drop.d.ts +2 -2
  39. package/cjs/array/drop.d.ts.map +1 -1
  40. package/cjs/array/index.d.ts +4 -5
  41. package/cjs/array/index.d.ts.map +1 -1
  42. package/cjs/array/index.js +4 -5
  43. package/cjs/array/index.js.map +1 -1
  44. package/cjs/array/pad_start.d.ts +32 -0
  45. package/cjs/array/pad_start.d.ts.map +1 -0
  46. package/cjs/array/{find_last.js → pad_start.js} +1 -1
  47. package/cjs/array/pad_start.js.map +1 -0
  48. package/cjs/assertion/assert_type.d.ts +3 -0
  49. package/cjs/assertion/assert_type.d.ts.map +1 -1
  50. package/cjs/assertion/assert_type.js +3 -0
  51. package/cjs/assertion/assert_type.js.map +1 -1
  52. package/cjs/bigint/cast.d.ts +10 -0
  53. package/cjs/bigint/cast.d.ts.map +1 -0
  54. package/cjs/{array/some.js → bigint/cast.js} +1 -1
  55. package/cjs/bigint/cast.js.map +1 -0
  56. package/cjs/equal/equal.d.ts +51 -3
  57. package/cjs/equal/equal.d.ts.map +1 -1
  58. package/cjs/functional/Maybe.d.ts +2 -2
  59. package/cjs/functional/Maybe.d.ts.map +1 -1
  60. package/cjs/index.d.ts +16 -7
  61. package/cjs/index.d.ts.map +1 -1
  62. package/cjs/index.js +6 -1
  63. package/cjs/index.js.map +1 -1
  64. package/cjs/math/abs.d.ts +6 -0
  65. package/cjs/math/abs.d.ts.map +1 -0
  66. package/cjs/math/{Add.js → abs.js} +1 -1
  67. package/cjs/math/abs.js.map +1 -0
  68. package/cjs/math/add.d.ts +7 -0
  69. package/cjs/math/add.d.ts.map +1 -0
  70. package/cjs/math/{Max.js → add.js} +1 -1
  71. package/cjs/math/add.js.map +1 -0
  72. package/cjs/math/greater_than.d.ts +4 -0
  73. package/cjs/math/greater_than.d.ts.map +1 -0
  74. package/cjs/math/greater_than.js +3 -0
  75. package/cjs/math/greater_than.js.map +1 -0
  76. package/cjs/math/index.d.ts +6 -6
  77. package/cjs/math/index.d.ts.map +1 -1
  78. package/cjs/math/math_plus.d.ts +5 -0
  79. package/cjs/math/math_plus.d.ts.map +1 -0
  80. package/cjs/math/math_plus.js +3 -0
  81. package/cjs/math/math_plus.js.map +1 -0
  82. package/cjs/math/math_plus.to_negative.d.ts +13 -0
  83. package/cjs/math/math_plus.to_negative.d.ts.map +1 -0
  84. package/cjs/math/math_plus.to_negative.js +3 -0
  85. package/cjs/math/math_plus.to_negative.js.map +1 -0
  86. package/cjs/math/max.d.ts +4 -0
  87. package/cjs/math/max.d.ts.map +1 -0
  88. package/cjs/math/{Abs.js → max.js} +1 -1
  89. package/cjs/math/max.js.map +1 -0
  90. package/cjs/math/multiply.d.ts +6 -0
  91. package/cjs/math/multiply.d.ts.map +1 -0
  92. package/cjs/{array/array.js → math/multiply.js} +1 -1
  93. package/cjs/math/multiply.js.map +1 -0
  94. package/cjs/math/numeric_struct.d.ts +1469 -0
  95. package/cjs/math/numeric_struct.d.ts.map +1 -0
  96. package/cjs/math/numeric_struct.js +3 -0
  97. package/cjs/math/numeric_struct.js.map +1 -0
  98. package/cjs/math/subtract.d.ts +7 -0
  99. package/cjs/math/subtract.d.ts.map +1 -0
  100. package/cjs/math/subtract.js +3 -0
  101. package/cjs/math/subtract.js.map +1 -0
  102. package/cjs/nominal/brand.js +2 -2
  103. package/cjs/nominal/brand.js.map +1 -1
  104. package/cjs/nominal/flavor.js +2 -2
  105. package/cjs/nominal/flavor.js.map +1 -1
  106. package/cjs/number/cast.d.ts +10 -0
  107. package/cjs/number/cast.d.ts.map +1 -0
  108. package/cjs/number/cast.js +3 -0
  109. package/cjs/number/cast.js.map +1 -0
  110. package/cjs/number/number_array.d.ts +0 -2
  111. package/cjs/number/number_array.d.ts.map +1 -1
  112. package/cjs/number/number_array.js +14 -1
  113. package/cjs/number/number_array.js.map +1 -1
  114. package/cjs/number/number_plus.d.ts +4 -5
  115. package/cjs/number/number_plus.d.ts.map +1 -1
  116. package/cjs/number/strict_number_type.d.ts +12 -0
  117. package/cjs/number/strict_number_type.d.ts.map +1 -1
  118. package/cjs/numeric/cast.d.ts +27 -0
  119. package/cjs/numeric/cast.d.ts.map +1 -0
  120. package/cjs/numeric/cast.js +3 -0
  121. package/cjs/numeric/cast.js.map +1 -0
  122. package/{esm/number → cjs/numeric}/integer.d.ts +2 -0
  123. package/cjs/numeric/integer.d.ts.map +1 -0
  124. package/cjs/{number → numeric}/integer.js.map +1 -1
  125. package/cjs/numeric/negative.d.ts.map +1 -0
  126. package/cjs/{number → numeric}/negative.js.map +1 -1
  127. package/cjs/numeric/numeric_plus.d.ts +5 -0
  128. package/cjs/numeric/numeric_plus.d.ts.map +1 -0
  129. package/cjs/numeric/numeric_plus.js +3 -0
  130. package/cjs/numeric/numeric_plus.js.map +1 -0
  131. package/cjs/numeric/numeric_type.d.ts.map +1 -0
  132. package/cjs/{number → numeric}/numeric_type.js.map +1 -1
  133. package/cjs/{number → numeric}/positive.d.ts +2 -2
  134. package/cjs/numeric/positive.d.ts.map +1 -0
  135. package/cjs/{number → numeric}/positive.js.map +1 -1
  136. package/cjs/object/ANotB.d.ts +3 -3
  137. package/cjs/object/ANotB.d.ts.map +1 -1
  138. package/cjs/object/Partial.d.ts +6 -0
  139. package/cjs/object/Partial.d.ts.map +1 -1
  140. package/cjs/object/Required.d.ts +4 -0
  141. package/cjs/object/Required.d.ts.map +1 -1
  142. package/cjs/object/index.d.ts +1 -1
  143. package/cjs/object/index.d.ts.map +1 -1
  144. package/cjs/object/object_type.d.ts +1 -1
  145. package/cjs/object/split.d.ts +3 -1
  146. package/cjs/object/split.d.ts.map +1 -1
  147. package/cjs/object/split.js.map +1 -1
  148. package/cjs/predicates/CanAssign.d.ts +35 -0
  149. package/cjs/predicates/CanAssign.d.ts.map +1 -1
  150. package/cjs/predicates/CanAssign.js.map +1 -1
  151. package/cjs/predicates/Extends.d.ts +2 -2
  152. package/cjs/predicates/Extends.d.ts.map +1 -1
  153. package/cjs/predicates/index.d.ts +0 -1
  154. package/cjs/predicates/index.d.ts.map +1 -1
  155. package/cjs/predicates/index.js +0 -1
  156. package/cjs/predicates/index.js.map +1 -1
  157. package/cjs/testing/test_type.d.ts +125 -50
  158. package/cjs/testing/test_type.d.ts.map +1 -1
  159. package/cjs/testing/test_type.js +4 -141
  160. package/cjs/testing/test_type.js.map +1 -1
  161. package/cjs/tuple/create_tuple.d.ts +28 -0
  162. package/cjs/tuple/create_tuple.d.ts.map +1 -0
  163. package/cjs/{array → tuple}/create_tuple.js.map +1 -1
  164. package/cjs/tuple/tuple_plus.d.ts +2 -0
  165. package/cjs/tuple/tuple_plus.d.ts.map +1 -0
  166. package/cjs/tuple/tuple_plus.js +18 -0
  167. package/cjs/tuple/tuple_plus.js.map +1 -0
  168. package/cjs/tuple/tuple_plus.pad_start.d.ts +22 -0
  169. package/cjs/tuple/tuple_plus.pad_start.d.ts.map +1 -0
  170. package/cjs/tuple/tuple_plus.pad_start.js +3 -0
  171. package/cjs/tuple/tuple_plus.pad_start.js.map +1 -0
  172. package/cjs/{predicates/isType.d.ts → type-guard/is_type.d.ts} +5 -3
  173. package/cjs/type-guard/is_type.d.ts.map +1 -0
  174. package/cjs/{predicates/isType.js → type-guard/is_type.js} +8 -2
  175. package/cjs/type-guard/is_type.js.map +1 -0
  176. package/esm/array/{array.d.ts → array.at.d.ts} +4 -14
  177. package/esm/array/array.at.d.ts.map +1 -0
  178. package/esm/array/array.at.js +2 -0
  179. package/esm/array/array.at.js.map +1 -0
  180. package/esm/array/array.concat.d.ts +13 -0
  181. package/esm/array/array.concat.d.ts.map +1 -0
  182. package/esm/array/array.concat.js +2 -0
  183. package/esm/array/array.concat.js.map +1 -0
  184. package/esm/array/array.entries.d.ts +17 -0
  185. package/esm/array/array.entries.d.ts.map +1 -0
  186. package/esm/array/array.entries.js +2 -0
  187. package/esm/array/array.entries.js.map +1 -0
  188. package/esm/array/array.find.d.ts +21 -0
  189. package/esm/array/array.find.d.ts.map +1 -0
  190. package/esm/array/array.find.js +2 -0
  191. package/esm/array/array.find.js.map +1 -0
  192. package/esm/array/array.find_last.d.ts +17 -0
  193. package/esm/array/array.find_last.d.ts.map +1 -0
  194. package/esm/array/array.find_last.js +2 -0
  195. package/esm/array/array.find_last.js.map +1 -0
  196. package/esm/array/array.reverse.d.ts +2 -0
  197. package/esm/array/array.reverse.d.ts.map +1 -0
  198. package/esm/array/array.reverse.js +2 -0
  199. package/esm/array/array.reverse.js.map +1 -0
  200. package/esm/array/array.some.d.ts +29 -0
  201. package/esm/array/array.some.d.ts.map +1 -0
  202. package/esm/array/array.some.js +2 -0
  203. package/esm/array/array.some.js.map +1 -0
  204. package/esm/array/array_index.d.ts +8 -8
  205. package/esm/array/array_index.d.ts.map +1 -1
  206. package/esm/array/array_plus.d.ts +9 -1
  207. package/esm/array/array_plus.d.ts.map +1 -1
  208. package/esm/array/array_plus.split_at.d.ts +30 -0
  209. package/esm/array/array_plus.split_at.d.ts.map +1 -0
  210. package/esm/array/array_plus.split_at.js +2 -0
  211. package/esm/array/array_plus.split_at.js.map +1 -0
  212. package/esm/array/drop.d.ts +2 -2
  213. package/esm/array/drop.d.ts.map +1 -1
  214. package/esm/array/index.d.ts +4 -5
  215. package/esm/array/index.d.ts.map +1 -1
  216. package/esm/array/index.js +4 -5
  217. package/esm/array/index.js.map +1 -1
  218. package/esm/array/pad_start.d.ts +32 -0
  219. package/esm/array/pad_start.d.ts.map +1 -0
  220. package/esm/array/pad_start.js +2 -0
  221. package/esm/array/pad_start.js.map +1 -0
  222. package/esm/assertion/assert_type.d.ts +3 -0
  223. package/esm/assertion/assert_type.d.ts.map +1 -1
  224. package/esm/assertion/assert_type.js +3 -0
  225. package/esm/assertion/assert_type.js.map +1 -1
  226. package/esm/bigint/cast.d.ts +10 -0
  227. package/esm/bigint/cast.d.ts.map +1 -0
  228. package/esm/bigint/cast.js +2 -0
  229. package/esm/bigint/cast.js.map +1 -0
  230. package/esm/equal/equal.d.ts +51 -3
  231. package/esm/equal/equal.d.ts.map +1 -1
  232. package/esm/functional/Maybe.d.ts +2 -2
  233. package/esm/functional/Maybe.d.ts.map +1 -1
  234. package/esm/index.d.ts +16 -7
  235. package/esm/index.d.ts.map +1 -1
  236. package/esm/index.js +5 -0
  237. package/esm/index.js.map +1 -1
  238. package/esm/math/abs.d.ts +6 -0
  239. package/esm/math/abs.d.ts.map +1 -0
  240. package/esm/math/abs.js +2 -0
  241. package/esm/math/abs.js.map +1 -0
  242. package/esm/math/add.d.ts +7 -0
  243. package/esm/math/add.d.ts.map +1 -0
  244. package/esm/math/add.js +2 -0
  245. package/esm/math/add.js.map +1 -0
  246. package/esm/math/greater_than.d.ts +4 -0
  247. package/esm/math/greater_than.d.ts.map +1 -0
  248. package/esm/math/greater_than.js +2 -0
  249. package/esm/math/greater_than.js.map +1 -0
  250. package/esm/math/index.d.ts +6 -6
  251. package/esm/math/index.d.ts.map +1 -1
  252. package/esm/math/math_plus.d.ts +5 -0
  253. package/esm/math/math_plus.d.ts.map +1 -0
  254. package/esm/math/math_plus.js +2 -0
  255. package/esm/math/math_plus.js.map +1 -0
  256. package/esm/math/math_plus.to_negative.d.ts +13 -0
  257. package/esm/math/math_plus.to_negative.d.ts.map +1 -0
  258. package/esm/math/math_plus.to_negative.js +2 -0
  259. package/esm/math/math_plus.to_negative.js.map +1 -0
  260. package/esm/math/max.d.ts +4 -0
  261. package/esm/math/max.d.ts.map +1 -0
  262. package/esm/math/max.js +2 -0
  263. package/esm/math/max.js.map +1 -0
  264. package/esm/math/multiply.d.ts +6 -0
  265. package/esm/math/multiply.d.ts.map +1 -0
  266. package/esm/math/multiply.js +2 -0
  267. package/esm/math/multiply.js.map +1 -0
  268. package/esm/math/numeric_struct.d.ts +1469 -0
  269. package/esm/math/numeric_struct.d.ts.map +1 -0
  270. package/esm/math/numeric_struct.js +2 -0
  271. package/esm/math/numeric_struct.js.map +1 -0
  272. package/esm/math/subtract.d.ts +7 -0
  273. package/esm/math/subtract.d.ts.map +1 -0
  274. package/esm/math/subtract.js +2 -0
  275. package/esm/math/subtract.js.map +1 -0
  276. package/esm/nominal/brand.js +1 -1
  277. package/esm/nominal/brand.js.map +1 -1
  278. package/esm/nominal/flavor.js +1 -1
  279. package/esm/nominal/flavor.js.map +1 -1
  280. package/esm/number/cast.d.ts +10 -0
  281. package/esm/number/cast.d.ts.map +1 -0
  282. package/esm/number/cast.js +2 -0
  283. package/esm/number/cast.js.map +1 -0
  284. package/esm/number/number_array.d.ts +1 -2
  285. package/esm/number/number_array.d.ts.map +1 -1
  286. package/esm/number/number_array.js +14 -0
  287. package/esm/number/number_array.js.map +1 -1
  288. package/esm/number/number_plus.d.ts +4 -5
  289. package/esm/number/number_plus.d.ts.map +1 -1
  290. package/esm/number/strict_number_type.d.ts +12 -0
  291. package/esm/number/strict_number_type.d.ts.map +1 -1
  292. package/esm/numeric/cast.d.ts +27 -0
  293. package/esm/numeric/cast.d.ts.map +1 -0
  294. package/esm/numeric/cast.js +2 -0
  295. package/esm/numeric/cast.js.map +1 -0
  296. package/{cjs/number → esm/numeric}/integer.d.ts +2 -0
  297. package/esm/numeric/integer.d.ts.map +1 -0
  298. package/esm/{number → numeric}/integer.js.map +1 -1
  299. package/esm/numeric/negative.d.ts.map +1 -0
  300. package/esm/{number → numeric}/negative.js.map +1 -1
  301. package/esm/numeric/numeric_plus.d.ts +5 -0
  302. package/esm/numeric/numeric_plus.d.ts.map +1 -0
  303. package/esm/numeric/numeric_plus.js +2 -0
  304. package/esm/numeric/numeric_plus.js.map +1 -0
  305. package/esm/numeric/numeric_type.d.ts.map +1 -0
  306. package/esm/{number → numeric}/numeric_type.js.map +1 -1
  307. package/esm/{number → numeric}/positive.d.ts +2 -2
  308. package/esm/numeric/positive.d.ts.map +1 -0
  309. package/esm/{number → numeric}/positive.js.map +1 -1
  310. package/esm/object/ANotB.d.ts +3 -3
  311. package/esm/object/ANotB.d.ts.map +1 -1
  312. package/esm/object/Partial.d.ts +6 -0
  313. package/esm/object/Partial.d.ts.map +1 -1
  314. package/esm/object/Required.d.ts +4 -0
  315. package/esm/object/Required.d.ts.map +1 -1
  316. package/esm/object/index.d.ts +1 -1
  317. package/esm/object/index.d.ts.map +1 -1
  318. package/esm/object/object_type.d.ts +1 -1
  319. package/esm/object/split.d.ts +3 -1
  320. package/esm/object/split.d.ts.map +1 -1
  321. package/esm/object/split.js.map +1 -1
  322. package/esm/predicates/CanAssign.d.ts +35 -0
  323. package/esm/predicates/CanAssign.d.ts.map +1 -1
  324. package/esm/predicates/CanAssign.js.map +1 -1
  325. package/esm/predicates/Extends.d.ts +2 -2
  326. package/esm/predicates/Extends.d.ts.map +1 -1
  327. package/esm/predicates/index.d.ts +0 -1
  328. package/esm/predicates/index.d.ts.map +1 -1
  329. package/esm/predicates/index.js +0 -1
  330. package/esm/predicates/index.js.map +1 -1
  331. package/esm/testing/test_type.d.ts +125 -50
  332. package/esm/testing/test_type.d.ts.map +1 -1
  333. package/esm/testing/test_type.js +4 -141
  334. package/esm/testing/test_type.js.map +1 -1
  335. package/esm/tuple/create_tuple.d.ts +28 -0
  336. package/esm/tuple/create_tuple.d.ts.map +1 -0
  337. package/esm/{array → tuple}/create_tuple.js.map +1 -1
  338. package/esm/tuple/tuple_plus.d.ts +2 -0
  339. package/esm/tuple/tuple_plus.d.ts.map +1 -0
  340. package/esm/tuple/tuple_plus.js +2 -0
  341. package/esm/tuple/tuple_plus.js.map +1 -0
  342. package/esm/tuple/tuple_plus.pad_start.d.ts +22 -0
  343. package/esm/tuple/tuple_plus.pad_start.d.ts.map +1 -0
  344. package/esm/tuple/tuple_plus.pad_start.js +2 -0
  345. package/esm/tuple/tuple_plus.pad_start.js.map +1 -0
  346. package/esm/{predicates/isType.d.ts → type-guard/is_type.d.ts} +5 -3
  347. package/esm/type-guard/is_type.d.ts.map +1 -0
  348. package/esm/{predicates/isType.js → type-guard/is_type.js} +8 -2
  349. package/esm/type-guard/is_type.js.map +1 -0
  350. package/package.json +1 -1
  351. package/ts/array/{array.ts → array.at.ts} +10 -15
  352. package/ts/array/array.concat.ts +12 -0
  353. package/ts/array/array.entries.ts +24 -0
  354. package/ts/array/array.find.ts +32 -0
  355. package/ts/array/array.find_last.ts +27 -0
  356. package/ts/array/array.reverse.ts +16 -0
  357. package/ts/array/array.some.ts +53 -0
  358. package/ts/array/array_index.ts +16 -10
  359. package/ts/array/array_plus.split_at.ts +47 -0
  360. package/ts/array/array_plus.ts +9 -1
  361. package/ts/array/drop.ts +2 -2
  362. package/ts/array/index.ts +4 -5
  363. package/ts/array/pad_start.ts +43 -0
  364. package/ts/array/readme.md +184 -4
  365. package/ts/assertion/assert_type.ts +6 -0
  366. package/ts/assertion/readme.md +132 -1
  367. package/ts/bigint/cast.ts +13 -0
  368. package/ts/bigint/readme.md +17 -17
  369. package/ts/equal/equal.ts +53 -3
  370. package/ts/equal/readme.md +30 -16
  371. package/ts/functional/Maybe.ts +2 -2
  372. package/ts/index.ts +22 -24
  373. package/ts/math/README.md +97 -7
  374. package/ts/math/abs.ts +18 -0
  375. package/ts/math/add.ts +14 -0
  376. package/ts/math/greater_than.ts +12 -0
  377. package/ts/math/index.ts +7 -6
  378. package/ts/math/math_plus.to_negative.ts +22 -0
  379. package/ts/math/math_plus.ts +4 -0
  380. package/ts/math/max.ts +13 -0
  381. package/ts/math/multiply.ts +12 -0
  382. package/ts/math/numeric_struct.ts +658 -0
  383. package/ts/math/subtract.ts +14 -0
  384. package/ts/nominal/brand.ts +1 -1
  385. package/ts/nominal/flavor.ts +1 -1
  386. package/ts/number/cast.ts +17 -0
  387. package/ts/number/number_array.ts +14 -14
  388. package/ts/number/number_plus.ts +6 -6
  389. package/ts/number/readme.md +0 -108
  390. package/ts/number/strict_number_type.ts +12 -0
  391. package/ts/numeric/cast.ts +28 -0
  392. package/ts/{number → numeric}/integer.ts +2 -0
  393. package/ts/numeric/numeric_plus.ts +12 -0
  394. package/ts/{number → numeric}/positive.ts +2 -2
  395. package/ts/numeric/readme.md +115 -0
  396. package/ts/object/ANotB.ts +3 -3
  397. package/ts/object/Partial.ts +5 -0
  398. package/ts/object/Required.ts +4 -0
  399. package/ts/object/index.ts +1 -1
  400. package/ts/object/object_type.ts +1 -1
  401. package/ts/object/split.ts +3 -1
  402. package/ts/predicates/CanAssign.ts +46 -0
  403. package/ts/predicates/Extends.ts +2 -2
  404. package/ts/predicates/index.ts +0 -1
  405. package/ts/testing/test_type.ts +131 -88
  406. package/ts/tuple/create_tuple.ts +42 -0
  407. package/ts/tuple/tuple_plus.pad_start.ts +42 -0
  408. package/ts/tuple/tuple_plus.ts +1 -0
  409. package/ts/{predicates/isType.ts → type-guard/is_type.ts} +11 -3
  410. package/ts/type-guard/readme.md +37 -0
  411. package/cjs/array/array.d.ts.map +0 -1
  412. package/cjs/array/array.js.map +0 -1
  413. package/cjs/array/create_tuple.d.ts +0 -11
  414. package/cjs/array/create_tuple.d.ts.map +0 -1
  415. package/cjs/array/find_first.d.ts +0 -6
  416. package/cjs/array/find_first.d.ts.map +0 -1
  417. package/cjs/array/find_first.js.map +0 -1
  418. package/cjs/array/find_last.d.ts +0 -2
  419. package/cjs/array/find_last.d.ts.map +0 -1
  420. package/cjs/array/find_last.js.map +0 -1
  421. package/cjs/array/pad_left.d.ts +0 -6
  422. package/cjs/array/pad_left.d.ts.map +0 -1
  423. package/cjs/array/pad_left.js.map +0 -1
  424. package/cjs/array/some.d.ts +0 -8
  425. package/cjs/array/some.d.ts.map +0 -1
  426. package/cjs/array/some.js.map +0 -1
  427. package/cjs/math/Abs.d.ts +0 -3
  428. package/cjs/math/Abs.d.ts.map +0 -1
  429. package/cjs/math/Abs.js.map +0 -1
  430. package/cjs/math/Add.d.ts +0 -19
  431. package/cjs/math/Add.d.ts.map +0 -1
  432. package/cjs/math/Add.js.map +0 -1
  433. package/cjs/math/Digit.d.ts +0 -100
  434. package/cjs/math/Digit.d.ts.map +0 -1
  435. package/cjs/math/Digit.js +0 -3
  436. package/cjs/math/Digit.js.map +0 -1
  437. package/cjs/math/GreaterThan.d.ts +0 -13
  438. package/cjs/math/GreaterThan.d.ts.map +0 -1
  439. package/cjs/math/GreaterThan.js +0 -3
  440. package/cjs/math/GreaterThan.js.map +0 -1
  441. package/cjs/math/Max.d.ts +0 -4
  442. package/cjs/math/Max.d.ts.map +0 -1
  443. package/cjs/math/Max.js.map +0 -1
  444. package/cjs/math/Subtract.d.ts +0 -19
  445. package/cjs/math/Subtract.d.ts.map +0 -1
  446. package/cjs/math/Subtract.js +0 -3
  447. package/cjs/math/Subtract.js.map +0 -1
  448. package/cjs/number/integer.d.ts.map +0 -1
  449. package/cjs/number/negative.d.ts.map +0 -1
  450. package/cjs/number/numeric_type.d.ts.map +0 -1
  451. package/cjs/number/positive.d.ts.map +0 -1
  452. package/cjs/predicates/isType.d.ts.map +0 -1
  453. package/cjs/predicates/isType.js.map +0 -1
  454. package/esm/array/array.d.ts.map +0 -1
  455. package/esm/array/array.js +0 -2
  456. package/esm/array/array.js.map +0 -1
  457. package/esm/array/create_tuple.d.ts +0 -11
  458. package/esm/array/create_tuple.d.ts.map +0 -1
  459. package/esm/array/find_first.d.ts +0 -6
  460. package/esm/array/find_first.d.ts.map +0 -1
  461. package/esm/array/find_first.js +0 -2
  462. package/esm/array/find_first.js.map +0 -1
  463. package/esm/array/find_last.d.ts +0 -2
  464. package/esm/array/find_last.d.ts.map +0 -1
  465. package/esm/array/find_last.js +0 -2
  466. package/esm/array/find_last.js.map +0 -1
  467. package/esm/array/pad_left.d.ts +0 -6
  468. package/esm/array/pad_left.d.ts.map +0 -1
  469. package/esm/array/pad_left.js +0 -2
  470. package/esm/array/pad_left.js.map +0 -1
  471. package/esm/array/some.d.ts +0 -8
  472. package/esm/array/some.d.ts.map +0 -1
  473. package/esm/array/some.js +0 -2
  474. package/esm/array/some.js.map +0 -1
  475. package/esm/math/Abs.d.ts +0 -3
  476. package/esm/math/Abs.d.ts.map +0 -1
  477. package/esm/math/Abs.js +0 -2
  478. package/esm/math/Abs.js.map +0 -1
  479. package/esm/math/Add.d.ts +0 -19
  480. package/esm/math/Add.d.ts.map +0 -1
  481. package/esm/math/Add.js +0 -2
  482. package/esm/math/Add.js.map +0 -1
  483. package/esm/math/Digit.d.ts +0 -100
  484. package/esm/math/Digit.d.ts.map +0 -1
  485. package/esm/math/Digit.js +0 -2
  486. package/esm/math/Digit.js.map +0 -1
  487. package/esm/math/GreaterThan.d.ts +0 -13
  488. package/esm/math/GreaterThan.d.ts.map +0 -1
  489. package/esm/math/GreaterThan.js +0 -2
  490. package/esm/math/GreaterThan.js.map +0 -1
  491. package/esm/math/Max.d.ts +0 -4
  492. package/esm/math/Max.d.ts.map +0 -1
  493. package/esm/math/Max.js +0 -2
  494. package/esm/math/Max.js.map +0 -1
  495. package/esm/math/Subtract.d.ts +0 -19
  496. package/esm/math/Subtract.d.ts.map +0 -1
  497. package/esm/math/Subtract.js +0 -2
  498. package/esm/math/Subtract.js.map +0 -1
  499. package/esm/number/integer.d.ts.map +0 -1
  500. package/esm/number/negative.d.ts.map +0 -1
  501. package/esm/number/numeric_type.d.ts.map +0 -1
  502. package/esm/number/positive.d.ts.map +0 -1
  503. package/esm/predicates/isType.d.ts.map +0 -1
  504. package/esm/predicates/isType.js.map +0 -1
  505. package/ts/array/create_tuple.ts +0 -17
  506. package/ts/array/find_first.ts +0 -16
  507. package/ts/array/find_last.ts +0 -11
  508. package/ts/array/pad_left.ts +0 -16
  509. package/ts/array/some.ts +0 -33
  510. package/ts/math/Abs.ts +0 -7
  511. package/ts/math/Add.ts +0 -58
  512. package/ts/math/Digit.ts +0 -152
  513. package/ts/math/GreaterThan.ts +0 -55
  514. package/ts/math/Max.ts +0 -10
  515. package/ts/math/Subtract.ts +0 -57
  516. /package/cjs/{number → numeric}/integer.js +0 -0
  517. /package/cjs/{number → numeric}/negative.d.ts +0 -0
  518. /package/cjs/{number → numeric}/negative.js +0 -0
  519. /package/cjs/{number → numeric}/numeric_type.d.ts +0 -0
  520. /package/cjs/{number → numeric}/numeric_type.js +0 -0
  521. /package/cjs/{number → numeric}/positive.js +0 -0
  522. /package/cjs/{array → tuple}/create_tuple.js +0 -0
  523. /package/esm/{number → numeric}/integer.js +0 -0
  524. /package/esm/{number → numeric}/negative.d.ts +0 -0
  525. /package/esm/{number → numeric}/negative.js +0 -0
  526. /package/esm/{number → numeric}/numeric_type.d.ts +0 -0
  527. /package/esm/{number → numeric}/numeric_type.js +0 -0
  528. /package/esm/{number → numeric}/positive.js +0 -0
  529. /package/esm/{array → tuple}/create_tuple.js +0 -0
  530. /package/ts/{number → numeric}/negative.ts +0 -0
  531. /package/ts/{number → numeric}/numeric_type.ts +0 -0
@@ -1,5 +1,5 @@
1
- export type Extendable<A, B> = A extends B ? A : never;
2
- export type NotExtendable<A, B> = A extends B ? never : A;
1
+ export type Extendable<A, B, Then = A, Else = never> = A extends B ? Then : Else;
2
+ export type NotExtendable<A, B, Then = A, Else = never> = A extends B ? Else : Then;
3
3
  export type IsExtend<A, B, Then = true, Else = false> = A extends B ? Then : Else;
4
4
  export type IsNotExtend<A, B, Then = true, Else = false> = A extends B ? Else : Then;
5
5
  //# sourceMappingURL=Extends.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Extends.d.ts","sourceRoot":"","sources":["../../ts/predicates/Extends.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;AACtD,MAAM,MAAM,aAAa,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,KAAK,GAAG,CAAC,CAAA;AACzD,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,GAAG,IAAI,CAAA;AACjF,MAAM,MAAM,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,GAAG,IAAI,CAAA"}
1
+ {"version":3,"file":"Extends.d.ts","sourceRoot":"","sources":["../../ts/predicates/Extends.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,KAAK,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,GAAG,IAAI,CAAA;AAChF,MAAM,MAAM,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,KAAK,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,GAAG,IAAI,CAAA;AACnF,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,GAAG,IAAI,CAAA;AACjF,MAAM,MAAM,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,GAAG,IAAI,CAAA"}
@@ -2,7 +2,6 @@ export * from './CanAssign.js';
2
2
  export type { Extendable, IsExtend, IsNotExtend, NotExtendable } from './Extends.js';
3
3
  export type { If } from './If.js';
4
4
  export type { IsEmptyObject } from './IsEmptyObject.js';
5
- export * from './isType.js';
6
5
  export type { And, Not, Or, Xor } from './logical.js';
7
6
  export type IsLiteral<T extends number | string, Then = true, Else = false> = number extends T ? Else : string extends T ? Else : Then;
8
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../ts/predicates/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACpF,YAAY,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AACjC,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,cAAc,aAAa,CAAA;AAC3B,YAAY,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAErD,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK,IAAI,MAAM,SAAS,CAAC,GAC3F,IAAI,GACJ,MAAM,SAAS,CAAC,GAChB,IAAI,GACJ,IAAI,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../ts/predicates/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACpF,YAAY,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AACjC,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,YAAY,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAErD,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK,IAAI,MAAM,SAAS,CAAC,GAC3F,IAAI,GACJ,MAAM,SAAS,CAAC,GAChB,IAAI,GACJ,IAAI,CAAA"}
@@ -1,3 +1,2 @@
1
1
  export * from './CanAssign.js';
2
- export * from './isType.js';
3
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/predicates/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAI9B,cAAc,aAAa,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/predicates/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
@@ -1,41 +1,77 @@
1
1
  import type { IsAny } from '../any/any_type.js';
2
+ import type { IsArray } from '../array/array_type.js';
2
3
  import type { IsBigint } from '../bigint/bigint_type.js';
3
4
  import type { IsStrictBigint } from '../bigint/strict_bigint_type.js';
4
5
  import type { IsBoolean } from '../boolean/boolean_type.js';
5
6
  import type { IsFalse } from '../boolean/false_type.js';
6
7
  import type { IsStrictBoolean } from '../boolean/strict_boolean_type.js';
7
8
  import type { IsTrue } from '../boolean/true_type.js';
8
- import type { Equal } from '../equal/equal.js';
9
+ import type { IsEqual } from '../equal/equal.js';
10
+ import type { IsFunction } from '../function/function_type.js';
11
+ import type { IsStrictFunction } from '../function/strict_function_type.js';
9
12
  import type { IsNever } from '../never/never_type.js';
10
13
  import type { IsNull } from '../null/null_type.js';
11
14
  import type { IsNumber } from '../number/number_type.js';
12
15
  import type { IsStrictNumber } from '../number/strict_number_type.js';
13
- import type { CanAssign } from '../predicates/CanAssign.js';
16
+ import type { IsObject } from '../object/object_type.js';
17
+ import type { CanAssign, StrictCanAssign } from '../predicates/CanAssign.js';
14
18
  import type { IsStrictString } from '../string/strict_string_type.js';
15
19
  import type { IsString } from '../string/string_type.js';
20
+ import type { IsSymbol } from '../symbol/symbol_type.js';
21
+ import type { IsTuple } from '../tuple/tuple_type.js';
16
22
  import type { IsUndefined } from '../undefined/undefined_type.js';
17
23
  import type { IsUnknown } from '../unknown/unknown_type.js';
18
24
  import type { IsVoid } from '../void/void_type.js';
19
- /**
20
- * Check if type `A` is equal to type `B` and `C`.
21
- *
22
- * @return `expected` as `A` for type inspection.
23
- */
24
- declare function equal<A, B, C>(expected: Equal<A, B> & Equal<A, C>): A;
25
- /**
26
- * Check if type `A` is equal to type `B`.
27
- *
28
- * @return `expected` as `A` for type inspection.
29
- */
30
- declare function equal<A, B>(expected: Equal<A, B>): A;
31
- /**
32
- * Test utilities for types.
33
- *
34
- * This is designed specifically for testing.
35
- * The return value is the input `expected` parameter asserted as the first type parameter,
36
- * so that the type can be further inspected.
37
- */
38
- export declare const testType: {
25
+ interface TestType {
26
+ /**
27
+ * Check if type `A` is equal to type `B` and `C`.
28
+ *
29
+ * @return `expected` as `A` for type inspection.
30
+ */
31
+ equal<A, B, C>(expected: IsEqual<A, B> & IsEqual<A, C>): A;
32
+ /**
33
+ * Check if type `A` is equal to type `B`.
34
+ *
35
+ * @return `expected` as `A` for type inspection.
36
+ */
37
+ equal<A, B>(expected: IsEqual<A, B>): A;
38
+ /**
39
+ * Check if `A` can assign to `B`.
40
+ *
41
+ * If `A` is a union,
42
+ * the check is distributive.
43
+ *
44
+ * Meaning the result can be `boolean`,
45
+ * meaning both `true` and `false` will pass.
46
+ *
47
+ * If you want to avoid the distributivity,
48
+ * use `testType.strictCanAssign()` instead.
49
+ *
50
+ * @example
51
+ * ```ts
52
+ * testType.canAssign<123, number> // true
53
+ *
54
+ * testType.canAssign<number | string, number> // boolean
55
+ * ```
56
+ *
57
+ * @return `expected` as `A` for type inspection.
58
+ */
59
+ canAssign<A, B>(expected: CanAssign<A, B>): A;
60
+ /**
61
+ * Check if `A` can fully assign to `B`.
62
+ *
63
+ * This checks all branches in an union `A` are assignable to `B`.
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * testType.strictCanAssign<number | string, number | string> // true
68
+ *
69
+ * testType.strictCanAssign<number | string, number> // false
70
+ * ```
71
+ *
72
+ * @return `expected` as `A` for type inspection.
73
+ */
74
+ strictCanAssign<A, B>(expected: StrictCanAssign<A, B>): A;
39
75
  /**
40
76
  * Check if type `T` is exactly `any`.
41
77
  *
@@ -43,102 +79,141 @@ export declare const testType: {
43
79
  */
44
80
  any<T>(expected: IsAny<T>): T;
45
81
  /**
46
- * Check if type `T` is exactly `unknown`.
82
+ * Check if type `T` is exactly `array`.
47
83
  *
48
84
  * @return `expected` as `T` for type inspection.
49
85
  */
50
- unknown<T_1>(expected: IsUnknown<T_1>): T_1;
86
+ array<T>(expected: IsArray<T>): T;
51
87
  /**
52
- * Check if type `T` is exactly `never`.
88
+ * Check if type `T` is exactly `bigint`.
53
89
  *
54
90
  * @return `expected` as `T` for type inspection.
55
91
  */
56
- never<T_2>(expected: IsNever<T_2>): T_2;
92
+ strictBigint<T>(expected: IsStrictBigint<T>): T;
57
93
  /**
58
- * Check if type `T` is exactly `void`.
94
+ * Check if type `T` is `bigint` or bigint literals.
59
95
  *
60
96
  * @return `expected` as `T` for type inspection.
61
97
  */
62
- void<T_3>(expected: IsVoid<T_3>): T_3;
63
- equal: typeof equal;
98
+ bigint<T>(expected: IsBigint<T>): T;
64
99
  /**
65
- * Check if `A` can assign to `B`.
100
+ * Check if type `T` is exactly `boolean`.
66
101
  *
67
- * @return `expected` as `A` for type inspection.
102
+ * @return `expected` as `T` for type inspection.
68
103
  */
69
- canAssign<A, B>(expected: CanAssign<A, B>): A;
104
+ strictBoolean<T>(expected: IsStrictBoolean<T>): T;
105
+ /**
106
+ * Check if type `T` is `boolean` and boolean literals.
107
+ *
108
+ * @return `expected` as `T` for type inspection.
109
+ */
110
+ boolean<T>(expected: IsBoolean<T>): T;
111
+ /**
112
+ * Check if type `T` is exactly `true`.
113
+ *
114
+ * @return `expected` as `T` for type inspection.
115
+ */
116
+ true<T>(expected: IsTrue<T>): T;
117
+ /**
118
+ * Check if type `T` is exactly `false`.
119
+ *
120
+ * @return `expected` as `T` for type inspection.
121
+ */
122
+ false<T>(expected: IsFalse<T>): T;
70
123
  /**
71
124
  * Check if type `T` is exactly `boolean`.
72
125
  *
73
126
  * @return `expected` as `T` for type inspection.
74
127
  */
75
- strictBoolean<T_4>(expected: IsStrictBoolean<T_4>): T_4;
128
+ strictFunction<T>(expected: IsStrictFunction<T>): T;
76
129
  /**
77
130
  * Check if type `T` is `boolean` and boolean literals.
78
131
  *
79
132
  * @return `expected` as `T` for type inspection.
80
133
  */
81
- boolean<T_5>(expected: IsBoolean<T_5>): T_5;
134
+ function<T>(expected: IsFunction<T>): T;
82
135
  /**
83
- * Check if type `T` is exactly `true`.
136
+ * Check if type `T` is exactly `never`.
84
137
  *
85
138
  * @return `expected` as `T` for type inspection.
86
139
  */
87
- true<T_6>(expected: IsTrue<T_6>): T_6;
140
+ never<T>(expected: IsNever<T>): T;
88
141
  /**
89
- * Check if type `T` is exactly `false`.
142
+ * Check if type `T` is exactly `null`.
90
143
  *
91
144
  * @return `expected` as `T` for type inspection.
92
145
  */
93
- false<T_7>(expected: IsFalse<T_7>): T_7;
146
+ null<T>(expected: IsNull<T>): T;
94
147
  /**
95
148
  * Check if type `T` is exactly `number`.
96
149
  *
97
150
  * @return `expected` as `T` for type inspection.
98
151
  */
99
- strictNumber<T_8>(expected: IsStrictNumber<T_8>): T_8;
152
+ strictNumber<T>(expected: IsStrictNumber<T>): T;
100
153
  /**
101
154
  * Check if type `T` is `number` or number literals.
102
155
  *
103
156
  * @return `expected` as `T` for type inspection.
104
157
  */
105
- number<T_9>(expected: IsNumber<T_9>): T_9;
158
+ number<T>(expected: IsNumber<T>): T;
159
+ /**
160
+ * Check if type `T` is `object`.
161
+ *
162
+ * Note that `Function`, `Array`, and *tuple* are also `object`.
163
+ *
164
+ * @return `expected` as `T` for type inspection.
165
+ */
166
+ object<T>(expected: IsObject<T>): T;
106
167
  /**
107
168
  * Check if type `T` is exactly `string`.
108
169
  *
109
170
  * @return `expected` as `T` for type inspection.
110
171
  */
111
- strictString<T_10>(expected: IsStrictString<T_10>): T_10;
172
+ strictString<T>(expected: IsStrictString<T>): T;
112
173
  /**
113
174
  * Check if type `T` is `string` or string literals.
114
175
  *
115
176
  * @return `expected` as `T` for type inspection.
116
177
  */
117
- string<T_11>(expected: IsString<T_11>): T_11;
178
+ string<T>(expected: IsString<T>): T;
118
179
  /**
119
- * Check if type `T` is exactly `bigint`.
180
+ * Check if type `T` is a `symbol`.
120
181
  *
121
182
  * @return `expected` as `T` for type inspection.
122
183
  */
123
- strictBigint<T_12>(expected: IsStrictBigint<T_12>): T_12;
184
+ symbol<T>(expected: IsSymbol<T>): T;
124
185
  /**
125
- * Check if type `T` is `bigint` or bigint literals.
186
+ * Check if type `T` is a *tuple*.
126
187
  *
127
188
  * @return `expected` as `T` for type inspection.
128
189
  */
129
- bigint<T_13>(expected: IsBigint<T_13>): T_13;
190
+ tuple<T>(expected: IsTuple<T>): T;
130
191
  /**
131
192
  * Check if type `T` is exactly `undefined`.
132
193
  *
133
194
  * @return `expected` as `T` for type inspection.
134
195
  */
135
- undefined<T_14>(expected: IsUndefined<T_14>): T_14;
196
+ undefined<T>(expected: IsUndefined<T>): T;
136
197
  /**
137
- * Check if type `T` is exactly `null`.
198
+ * Check if type `T` is exactly `unknown`.
199
+ *
200
+ * @return `expected` as `T` for type inspection.
201
+ */
202
+ unknown<T>(expected: IsUnknown<T>): T;
203
+ /**
204
+ * Check if type `T` is exactly `void`.
138
205
  *
139
206
  * @return `expected` as `T` for type inspection.
140
207
  */
141
- null<T_15>(expected: IsNull<T_15>): T_15;
142
- };
208
+ void<T>(expected: IsVoid<T>): T;
209
+ }
210
+ /**
211
+ * Test utilities for types.
212
+ *
213
+ * This is designed specifically for testing.
214
+ * The return value is the input `expected` parameter asserted as the first type parameter,
215
+ * so that the type can be further inspected.
216
+ */
217
+ export declare const testType: TestType;
143
218
  export {};
144
219
  //# sourceMappingURL=test_type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"test_type.d.ts","sourceRoot":"","sources":["../../ts/testing/test_type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,KAAK,EAAE,eAAe,EA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C,GAAG,CAAC,CAAA;IACnC;;;;OAIG;IACH,YAAY,CAAC,CAAC,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;IAC/C;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;IACnC;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;IACnC;;;;OAIG;IACH,KAAK,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;IACjC;;;;OAIG;IACH,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;IAEzC;;;;OAIG;IACH,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;IACrC;;;;OAIG;IACH,IAAI,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;CAC/B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,UAInB,CAAA"}
@@ -1,6 +1,3 @@
1
- function equal(expected) {
2
- return expected;
3
- }
4
1
  /**
5
2
  * Test utilities for types.
6
3
  *
@@ -8,143 +5,9 @@ function equal(expected) {
8
5
  * The return value is the input `expected` parameter asserted as the first type parameter,
9
6
  * so that the type can be further inspected.
10
7
  */
11
- export const testType = {
12
- /**
13
- * Check if type `T` is exactly `any`.
14
- *
15
- * @return `expected` as `T` for type inspection.
16
- */
17
- any(expected) {
18
- return expected;
19
- },
20
- /**
21
- * Check if type `T` is exactly `unknown`.
22
- *
23
- * @return `expected` as `T` for type inspection.
24
- */
25
- unknown(expected) {
26
- return expected;
27
- },
28
- /**
29
- * Check if type `T` is exactly `never`.
30
- *
31
- * @return `expected` as `T` for type inspection.
32
- */
33
- never(expected) {
34
- return expected;
35
- },
36
- /**
37
- * Check if type `T` is exactly `void`.
38
- *
39
- * @return `expected` as `T` for type inspection.
40
- */
41
- void(expected) {
42
- return expected;
43
- },
44
- equal,
45
- /**
46
- * Check if `A` can assign to `B`.
47
- *
48
- * @return `expected` as `A` for type inspection.
49
- */
50
- canAssign(expected) {
51
- return expected;
52
- },
53
- /**
54
- * Check if type `T` is exactly `boolean`.
55
- *
56
- * @return `expected` as `T` for type inspection.
57
- */
58
- strictBoolean(expected) {
59
- return expected;
60
- },
61
- /**
62
- * Check if type `T` is `boolean` and boolean literals.
63
- *
64
- * @return `expected` as `T` for type inspection.
65
- */
66
- boolean(expected) {
67
- return expected;
68
- },
69
- /**
70
- * Check if type `T` is exactly `true`.
71
- *
72
- * @return `expected` as `T` for type inspection.
73
- */
74
- true(expected) {
75
- return expected;
76
- },
77
- /**
78
- * Check if type `T` is exactly `false`.
79
- *
80
- * @return `expected` as `T` for type inspection.
81
- */
82
- false(expected) {
83
- return expected;
84
- },
85
- /**
86
- * Check if type `T` is exactly `number`.
87
- *
88
- * @return `expected` as `T` for type inspection.
89
- */
90
- strictNumber(expected) {
91
- return expected;
92
- },
93
- /**
94
- * Check if type `T` is `number` or number literals.
95
- *
96
- * @return `expected` as `T` for type inspection.
97
- */
98
- number(expected) {
99
- return expected;
100
- },
101
- /**
102
- * Check if type `T` is exactly `string`.
103
- *
104
- * @return `expected` as `T` for type inspection.
105
- */
106
- strictString(expected) {
107
- return expected;
108
- },
109
- /**
110
- * Check if type `T` is `string` or string literals.
111
- *
112
- * @return `expected` as `T` for type inspection.
113
- */
114
- string(expected) {
115
- return expected;
116
- },
117
- /**
118
- * Check if type `T` is exactly `bigint`.
119
- *
120
- * @return `expected` as `T` for type inspection.
121
- */
122
- strictBigint(expected) {
123
- return expected;
124
- },
125
- /**
126
- * Check if type `T` is `bigint` or bigint literals.
127
- *
128
- * @return `expected` as `T` for type inspection.
129
- */
130
- bigint(expected) {
131
- return expected;
132
- },
133
- /**
134
- * Check if type `T` is exactly `undefined`.
135
- *
136
- * @return `expected` as `T` for type inspection.
137
- */
138
- undefined(expected) {
139
- return expected;
140
- },
141
- /**
142
- * Check if type `T` is exactly `null`.
143
- *
144
- * @return `expected` as `T` for type inspection.
145
- */
146
- null(expected) {
147
- return expected;
8
+ export const testType = new Proxy({}, {
9
+ get(_target, _prop, _receiver) {
10
+ return (expected) => expected;
148
11
  }
149
- };
12
+ });
150
13
  //# sourceMappingURL=test_type.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"test_type.js","sourceRoot":"","sources":["../../ts/testing/test_type.ts"],"names":[],"mappings":"AA+BA,SAAS,KAAK,CAAC,QAAiB;IAC/B,OAAO,QAAQ,CAAA;AAChB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACvB;;;;OAIG;IACH,GAAG,CAAI,QAAkB;QACxB,OAAO,QAAa,CAAA;IACrB,CAAC;IACD;;;;OAIG;IACH,OAAO,CAAI,QAAsB;QAChC,OAAO,QAAa,CAAA;IACrB,CAAC;IACD;;;;OAIG;IACH,KAAK,CAAI,QAAoB;QAC5B,OAAO,QAAa,CAAA;IACrB,CAAC;IACD;;;;OAIG;IACH,IAAI,CAAI,QAAmB;QAC1B,OAAO,QAAa,CAAA;IACrB,CAAC;IACD,KAAK;IACL;;;;OAIG;IACH,SAAS,CAAO,QAAyB;QACxC,OAAO,QAAa,CAAA;IACrB,CAAC;IACD;;;;OAIG;IACH,aAAa,CAAI,QAA4B;QAC5C,OAAO,QAAa,CAAA;IACrB,CAAC;IACD;;;;OAIG;IACH,OAAO,CAAI,QAAsB;QAChC,OAAO,QAAa,CAAA;IACrB,CAAC;IACD;;;;OAIG;IACH,IAAI,CAAI,QAAmB;QAC1B,OAAO,QAAa,CAAA;IACrB,CAAC;IACD;;;;OAIG;IACH,KAAK,CAAI,QAAoB;QAC5B,OAAO,QAAa,CAAA;IACrB,CAAC;IACD;;;;OAIG;IACH,YAAY,CAAI,QAA2B;QAC1C,OAAO,QAAa,CAAA;IACrB,CAAC;IACD;;;;OAIG;IACH,MAAM,CAAI,QAAqB;QAC9B,OAAO,QAAa,CAAA;IACrB,CAAC;IACD;;;;OAIG;IACH,YAAY,CAAI,QAA2B;QAC1C,OAAO,QAAa,CAAA;IACrB,CAAC;IACD;;;;OAIG;IACH,MAAM,CAAI,QAAqB;QAC9B,OAAO,QAAa,CAAA;IACrB,CAAC;IACD;;;;OAIG;IACH,YAAY,CAAI,QAA2B;QAC1C,OAAO,QAAa,CAAA;IACrB,CAAC;IACD;;;;OAIG;IACH,MAAM,CAAI,QAAqB;QAC9B,OAAO,QAAa,CAAA;IACrB,CAAC;IACD;;;;OAIG;IACH,SAAS,CAAI,QAAwB;QACpC,OAAO,QAAa,CAAA;IACrB,CAAC;IACD;;;;OAIG;IACH,IAAI,CAAI,QAAmB;QAC1B,OAAO,QAAa,CAAA;IACrB,CAAC;CACD,CAAA"}
1
+ {"version":3,"file":"test_type.js","sourceRoot":"","sources":["../../ts/testing/test_type.ts"],"names":[],"mappings":"AAoNA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,KAAK,CAAC,EAAc,EAAE;IACjD,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS;QAC5B,OAAO,CAAC,QAAiB,EAAE,EAAE,CAAC,QAAQ,CAAA;IACvC,CAAC;CACD,CAAC,CAAA"}
@@ -0,0 +1,28 @@
1
+ import type { DigitArray } from '../math/numeric_struct.js';
2
+ import type { IsInteger } from '../numeric/integer.js';
3
+ import type { IsPositive } from '../numeric/positive.js';
4
+ /**
5
+ * Creates `Tuple<T>` with `L` number of elements.
6
+ * @note Other cool implementations by @lazytype, @jcalz:
7
+ * @see https://github.com/microsoft/TypeScript/issues/26223#issuecomment-674514787
8
+ * @see https://github.com/microsoft/TypeScript/issues/47874#issuecomment-1039157322
9
+ */
10
+ export type CreateTuple<L extends number, T = unknown, Fail = never> = number extends L ? T[] : IsPositive<L> extends true ? IsInteger<L> extends true ? ToTuple<[], DigitArray.FromString<`${L}`>, T> : Fail : Fail;
11
+ export type ToTuple<R extends any[], S extends number[], X = any> = S['length'] extends 0 ? R : S['length'] extends 1 ? [...R, ...DigitToTuple<X>[S[0]]] : S extends [any, ...infer T] ? T extends any[] ? ToTuple<Multi10<[...R, ...DigitToTuple<X>[S[0]]]>, T> : never : never;
12
+ type DigitToTuple<T = 1> = {
13
+ [k in number]: any[];
14
+ } & {
15
+ 0: [];
16
+ 1: [T];
17
+ 2: [T, T];
18
+ 3: [T, T, T];
19
+ 4: [T, T, T, T];
20
+ 5: [T, T, T, T, T];
21
+ 6: [T, T, T, T, T, T];
22
+ 7: [T, T, T, T, T, T, T];
23
+ 8: [T, T, T, T, T, T, T, T];
24
+ 9: [T, T, T, T, T, T, T, T, T];
25
+ };
26
+ type Multi10<C extends any[]> = [...C, ...C, ...C, ...C, ...C, ...C, ...C, ...C, ...C, ...C];
27
+ export {};
28
+ //# sourceMappingURL=create_tuple.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create_tuple.d.ts","sourceRoot":"","sources":["../../ts/tuple/create_tuple.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAExD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,GAAG,OAAO,EAAE,IAAI,GAAG,KAAK,IAAI,MAAM,SAAS,CAAC,GACpF,CAAC,EAAE,GACH,UAAU,CAAC,CAAC,CAAC,SAAS,IAAI,GAC1B,SAAS,CAAC,CAAC,CAAC,SAAS,IAAI,GACxB,OAAO,CAAC,EAAE,EAAE,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,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AAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IACxB,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IAC3B,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;CAC9B,CAAA;AACD,KAAK,OAAO,CAAC,CAAC,SAAS,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"create_tuple.js","sourceRoot":"","sources":["../../ts/array/create_tuple.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"create_tuple.js","sourceRoot":"","sources":["../../ts/tuple/create_tuple.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from './tuple_plus.pad_start.js';
2
+ //# sourceMappingURL=tuple_plus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tuple_plus.d.ts","sourceRoot":"","sources":["../../ts/tuple/tuple_plus.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './tuple_plus.pad_start.js';
2
+ //# sourceMappingURL=tuple_plus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tuple_plus.js","sourceRoot":"","sources":["../../ts/tuple/tuple_plus.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Pads the start of a tuple with `PadWith`.
3
+ *
4
+ * If the `MaxLength` is less than the length of the tuple,
5
+ * the `Tuple` will be returned unchanged.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * PadStart<[1, 2, 3], 5, 0> // [0, 0, 1, 2, 3]
10
+ *
11
+ * // Ignore if MaxLength is less than the length of the tuple
12
+ * PadStart<[1, 2, 3], 5, 0> // [0, 0, 1, 2, 3]
13
+ *
14
+ * // Default to unknown
15
+ * PadStart<[1, 2, 3], 5> // [unknown, unknown, 1, 2, 3]
16
+ * ```
17
+ */
18
+ export type PadStart<Tuple extends unknown[], MaxLength extends number, PadWith = unknown> = PadStartDevice<Tuple, MaxLength, PadWith, [
19
+ ]>;
20
+ type PadStartDevice<Source extends unknown[], MaxLength extends number, PadWith, Result extends unknown[]> = Result['length'] extends MaxLength ? Source extends [] ? Result : Source extends [...infer Head, infer Tail] ? [Tail, ...Result] extends infer R extends unknown[] ? PadStartDevice<Head, R['length'], PadWith, R> : never : never : Source extends [] ? PadStartDevice<Source, MaxLength, PadWith, [PadWith, ...Result]> : Source extends [...infer Head, infer Tail] ? PadStartDevice<Head, MaxLength, PadWith, [Tail, ...Result]> : Source;
21
+ export {};
22
+ //# sourceMappingURL=tuple_plus.pad_start.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tuple_plus.pad_start.d.ts","sourceRoot":"","sources":["../../ts/tuple/tuple_plus.pad_start.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,QAAQ,CAAC,KAAK,SAAS,OAAO,EAAE,EAAE,SAAS,SAAS,MAAM,EAAE,OAAO,GAAG,OAAO,IAAI,cAAc,CAC1G,KAAK,EACL,SAAS,EACT,OAAO,EACP;CAAE,CACF,CAAA;AAED,KAAK,cAAc,CAClB,MAAM,SAAS,OAAO,EAAE,EACxB,SAAS,SAAS,MAAM,EACxB,OAAO,EACP,MAAM,SAAS,OAAO,EAAE,IACrB,MAAM,CAAC,QAAQ,CAAC,SAAS,SAAS,GACnC,MAAM,SAAS,EAAE,GAChB,MAAM,GACN,MAAM,SAAS,CAAC,GAAG,MAAM,IAAI,EAAE,MAAM,IAAI,CAAC,GAC1C,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC,SAAS,MAAM,CAAC,SAAS,OAAO,EAAE,GAClD,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,GAC7C,KAAK,GACN,KAAK,GACN,MAAM,SAAS,EAAE,GACjB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC,GAChE,MAAM,SAAS,CAAC,GAAG,MAAM,IAAI,EAAE,MAAM,IAAI,CAAC,GAC1C,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC,CAAC,GAC3D,MAAM,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=tuple_plus.pad_start.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tuple_plus.pad_start.js","sourceRoot":"","sources":["../../ts/tuple/tuple_plus.pad_start.ts"],"names":[],"mappings":""}
@@ -1,4 +1,4 @@
1
- import type { Equal } from '../equal/equal.js';
1
+ import type { IsEqual } from '../equal/equal.js';
2
2
  /**
3
3
  * Is the subject of type T
4
4
  */
@@ -11,15 +11,17 @@ export declare namespace isType {
11
11
  var t: <T extends true>(subject?: T | undefined) => boolean;
12
12
  var f: <T extends false>(subject?: T | undefined) => boolean;
13
13
  var never: typeof isNever;
14
- var equal: <C extends Equal<A, B>, A, B>() => void;
14
+ var equal: <C extends IsEqual<A, B>, A, B>() => void;
15
15
  }
16
16
  /**
17
17
  * Check is the type `never`
18
+ * @deprecated use `isType<T>()` or `testType.never<T>()` instead
18
19
  */
19
20
  declare function isNever<S extends never>(): unknown;
20
21
  /**
21
22
  * Check is the value is type `never`
23
+ * @deprecated use `isType<T>()` or `testType.never<T>()` instead
22
24
  */
23
25
  declare function isNever(subject: never): subject is never;
24
26
  export {};
25
- //# sourceMappingURL=isType.d.ts.map
27
+ //# sourceMappingURL=is_type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is_type.d.ts","sourceRoot":"","sources":["../../ts/type-guard/is_type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAEhD;;GAEG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,IAAI,CAAC,CAAA;AACnD;;GAEG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,GAAG,OAAO,IAAI,CAAC,CAAA;yBAAvE,MAAM;;;;;;AAmBtB;;;GAGG;AACH,iBAAS,OAAO,CAAC,CAAC,SAAS,KAAK,KAAK,OAAO,CAAA;AAC5C;;;GAGG;AACH,iBAAS,OAAO,CAAC,OAAO,EAAE,KAAK,GAAG,OAAO,IAAI,KAAK,CAAA"}
@@ -1,9 +1,15 @@
1
1
  export function isType(subject, validator) {
2
2
  return validator ? !!validator(subject) : true;
3
3
  }
4
+ /**
5
+ * @deprecated use `isType<T>()` or `testType.true<T>()` instead
6
+ */
4
7
  isType.t = function (subject) {
5
8
  return subject === undefined || subject === true;
6
9
  };
10
+ /**
11
+ * @deprecated use `isType<T>()` or `testType.false<T>()` instead
12
+ */
7
13
  isType.f = function (subject) {
8
14
  return subject === undefined || subject === false;
9
15
  };
@@ -16,7 +22,7 @@ isType.never = isNever;
16
22
  * Easier to use than `isType.t<>()` and `isType.f<>()`,
17
23
  * when doing type level only equality comparison as you don't have to import `Equal<>`.
18
24
  *
19
- * @deprecated use `type.equal()` instead
25
+ * @deprecated use `testType.equal()` instead
20
26
  */
21
27
  isType.equal = function () { };
22
- //# sourceMappingURL=isType.js.map
28
+ //# sourceMappingURL=is_type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is_type.js","sourceRoot":"","sources":["../../ts/type-guard/is_type.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,MAAM,CAAC,OAAgB,EAAE,SAAmC;IAC3E,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AAC/C,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,CAAC,GAAG,UAA0B,OAAW;IAC/C,OAAO,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,IAAI,CAAA;AACjD,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,CAAC,GAAG,UAA2B,OAAW;IAChD,OAAO,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,KAAK,CAAA;AAClD,CAAC,CAAA;AAYD,SAAS,OAAO,CAAC,OAAiB;IACjC,OAAO,IAAI,CAAA;AACZ,CAAC;AAED,MAAM,CAAC,KAAK,GAAG,OAAO,CAAA;AAEtB;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,GAAG,cAA4C,CAAC,CAAA"}