type-plus 6.3.0 → 6.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1072) hide show
  1. package/README.md +36 -9
  2. package/cjs/any/any_or_never.d.ts +17 -0
  3. package/cjs/any/any_or_never.d.ts.map +1 -0
  4. package/cjs/any/any_or_never.js +3 -0
  5. package/cjs/any/any_or_never.js.map +1 -0
  6. package/cjs/any/any_type.d.ts +57 -0
  7. package/cjs/any/any_type.d.ts.map +1 -0
  8. package/cjs/any/any_type.js +3 -0
  9. package/cjs/any/any_type.js.map +1 -0
  10. package/cjs/array/array.d.ts +32 -0
  11. package/cjs/array/array.d.ts.map +1 -0
  12. package/cjs/array/array.js.map +1 -0
  13. package/cjs/array/array_index.d.ts +37 -0
  14. package/cjs/array/array_index.d.ts.map +1 -0
  15. package/cjs/array/array_index.js +3 -0
  16. package/cjs/array/array_index.js.map +1 -0
  17. package/cjs/array/array_plus.d.ts +3 -0
  18. package/cjs/array/array_plus.d.ts.map +1 -0
  19. package/cjs/array/array_plus.js.map +1 -0
  20. package/cjs/array/array_type.d.ts +56 -0
  21. package/cjs/array/array_type.d.ts.map +1 -0
  22. package/cjs/array/array_type.js +3 -0
  23. package/cjs/array/array_type.js.map +1 -0
  24. package/cjs/array/common_prop_keys.d.ts.map +1 -0
  25. package/cjs/array/common_prop_keys.js.map +1 -0
  26. package/cjs/array/create_tuple.d.ts +11 -0
  27. package/cjs/array/create_tuple.d.ts.map +1 -0
  28. package/cjs/array/create_tuple.js.map +1 -0
  29. package/cjs/array/drop.d.ts +19 -0
  30. package/cjs/array/drop.d.ts.map +1 -0
  31. package/cjs/array/drop.js.map +1 -0
  32. package/cjs/array/filter.d.ts +9 -0
  33. package/cjs/array/filter.d.ts.map +1 -0
  34. package/cjs/array/filter.js.map +1 -0
  35. package/cjs/array/find_first.d.ts.map +1 -0
  36. package/cjs/array/find_first.js.map +1 -0
  37. package/cjs/array/find_last.d.ts.map +1 -0
  38. package/cjs/array/find_last.js.map +1 -0
  39. package/cjs/array/head.d.ts.map +1 -0
  40. package/cjs/array/head.js.map +1 -0
  41. package/cjs/array/index.d.ts +18 -0
  42. package/cjs/array/index.d.ts.map +1 -0
  43. package/cjs/array/index.js +34 -0
  44. package/cjs/array/index.js.map +1 -0
  45. package/cjs/array/intersect_of_props.d.ts.map +1 -0
  46. package/cjs/array/intersect_of_props.js.map +1 -0
  47. package/cjs/array/last.d.ts.map +1 -0
  48. package/cjs/array/last.js.map +1 -0
  49. package/cjs/array/literal_array.d.ts.map +1 -0
  50. package/cjs/array/literal_array.js.map +1 -0
  51. package/cjs/array/pad_left.d.ts +6 -0
  52. package/cjs/array/pad_left.d.ts.map +1 -0
  53. package/cjs/array/pad_left.js.map +1 -0
  54. package/cjs/array/reduce_while.d.ts.map +1 -0
  55. package/cjs/array/reduce_while.js.map +1 -0
  56. package/cjs/array/reverse.d.ts.map +1 -0
  57. package/cjs/array/reverse.js.map +1 -0
  58. package/cjs/array/some.d.ts +8 -0
  59. package/cjs/array/some.d.ts.map +1 -0
  60. package/cjs/array/some.js.map +1 -0
  61. package/cjs/array/tail.d.ts.map +1 -0
  62. package/cjs/array/tail.js.map +1 -0
  63. package/cjs/array/union_of_props.d.ts.map +1 -0
  64. package/cjs/array/union_of_props.js.map +1 -0
  65. package/cjs/array/union_of_values.d.ts.map +1 -0
  66. package/cjs/array/union_of_values.js.map +1 -0
  67. package/cjs/assertion/assert_type.d.ts +34 -0
  68. package/cjs/assertion/assert_type.d.ts.map +1 -0
  69. package/cjs/assertion/assert_type.js +107 -0
  70. package/cjs/assertion/assert_type.js.map +1 -0
  71. package/cjs/bigint/bigint_type.d.ts +62 -0
  72. package/cjs/bigint/bigint_type.d.ts.map +1 -0
  73. package/cjs/bigint/bigint_type.js +3 -0
  74. package/cjs/bigint/bigint_type.js.map +1 -0
  75. package/cjs/bigint/strict_bigint_type.d.ts +64 -0
  76. package/cjs/bigint/strict_bigint_type.d.ts.map +1 -0
  77. package/cjs/bigint/strict_bigint_type.js +3 -0
  78. package/cjs/bigint/strict_bigint_type.js.map +1 -0
  79. package/cjs/boolean/boolean_type.d.ts +64 -0
  80. package/cjs/boolean/boolean_type.d.ts.map +1 -0
  81. package/cjs/boolean/boolean_type.js +3 -0
  82. package/cjs/boolean/boolean_type.js.map +1 -0
  83. package/cjs/boolean/false_type.d.ts +57 -0
  84. package/cjs/boolean/false_type.d.ts.map +1 -0
  85. package/cjs/boolean/false_type.js +3 -0
  86. package/cjs/boolean/false_type.js.map +1 -0
  87. package/cjs/boolean/strict_boolean_type.d.ts +61 -0
  88. package/cjs/boolean/strict_boolean_type.d.ts.map +1 -0
  89. package/cjs/boolean/strict_boolean_type.js +3 -0
  90. package/cjs/boolean/strict_boolean_type.js.map +1 -0
  91. package/cjs/boolean/true_type.d.ts +57 -0
  92. package/cjs/boolean/true_type.d.ts.map +1 -0
  93. package/cjs/boolean/true_type.js +3 -0
  94. package/cjs/boolean/true_type.js.map +1 -0
  95. package/cjs/composable_types.d.ts +9 -0
  96. package/cjs/composable_types.d.ts.map +1 -0
  97. package/cjs/composable_types.js +3 -0
  98. package/cjs/composable_types.js.map +1 -0
  99. package/cjs/equal/equal.d.ts +52 -0
  100. package/cjs/equal/equal.d.ts.map +1 -0
  101. package/cjs/equal/equal.js +3 -0
  102. package/cjs/equal/equal.js.map +1 -0
  103. package/cjs/function/any_function.d.ts +2 -0
  104. package/cjs/function/any_function.d.ts.map +1 -0
  105. package/cjs/function/any_function.js +3 -0
  106. package/cjs/function/any_function.js.map +1 -0
  107. package/cjs/function/extract_function.d.ts +24 -0
  108. package/cjs/function/extract_function.d.ts.map +1 -0
  109. package/cjs/function/extract_function.js +13 -0
  110. package/cjs/function/extract_function.js.map +1 -0
  111. package/cjs/function/function_type.d.ts +67 -0
  112. package/cjs/function/function_type.d.ts.map +1 -0
  113. package/cjs/function/function_type.js +3 -0
  114. package/cjs/function/function_type.js.map +1 -0
  115. package/cjs/function/strict_function_type.d.ts +57 -0
  116. package/cjs/function/strict_function_type.d.ts.map +1 -0
  117. package/cjs/function/strict_function_type.js +3 -0
  118. package/cjs/function/strict_function_type.js.map +1 -0
  119. package/cjs/functional/Maybe.d.ts +2 -2
  120. package/cjs/functional/Maybe.d.ts.map +1 -1
  121. package/cjs/functional/compose.d.ts +2 -2
  122. package/cjs/functional/compose.d.ts.map +1 -1
  123. package/cjs/index.d.ts +44 -15
  124. package/cjs/index.d.ts.map +1 -1
  125. package/cjs/index.js +11 -15
  126. package/cjs/index.js.map +1 -1
  127. package/cjs/json.d.ts +12 -0
  128. package/cjs/json.d.ts.map +1 -0
  129. package/cjs/json.js +14 -0
  130. package/cjs/json.js.map +1 -0
  131. package/cjs/math/Add.d.ts +4 -3
  132. package/cjs/math/Add.d.ts.map +1 -1
  133. package/cjs/math/Digit.d.ts +4 -3
  134. package/cjs/math/Digit.d.ts.map +1 -1
  135. package/cjs/math/GreaterThan.d.ts +6 -4
  136. package/cjs/math/GreaterThan.d.ts.map +1 -1
  137. package/cjs/math/Max.d.ts +1 -1
  138. package/cjs/math/Max.d.ts.map +1 -1
  139. package/cjs/math/Subtract.d.ts +4 -3
  140. package/cjs/math/Subtract.d.ts.map +1 -1
  141. package/cjs/never/never_type.d.ts +59 -0
  142. package/cjs/never/never_type.d.ts.map +1 -0
  143. package/cjs/never/never_type.js +3 -0
  144. package/cjs/never/never_type.js.map +1 -0
  145. package/cjs/nominal/brand.d.ts +23 -0
  146. package/cjs/nominal/brand.d.ts.map +1 -0
  147. package/cjs/nominal/brand.js +20 -0
  148. package/cjs/nominal/brand.js.map +1 -0
  149. package/cjs/nominal/constants.d.ts +3 -0
  150. package/cjs/nominal/constants.d.ts.map +1 -0
  151. package/cjs/nominal/constants.js +6 -0
  152. package/cjs/nominal/constants.js.map +1 -0
  153. package/cjs/nominal/flavor.d.ts +31 -0
  154. package/cjs/nominal/flavor.d.ts.map +1 -0
  155. package/cjs/nominal/flavor.js +20 -0
  156. package/cjs/nominal/flavor.js.map +1 -0
  157. package/cjs/nominal/index.d.ts +4 -0
  158. package/cjs/nominal/index.d.ts.map +1 -0
  159. package/cjs/nominal/index.js +20 -0
  160. package/cjs/nominal/index.js.map +1 -0
  161. package/cjs/nominal/nominal_match.d.ts +5 -0
  162. package/cjs/nominal/nominal_match.d.ts.map +1 -0
  163. package/cjs/nominal/nominal_match.js +13 -0
  164. package/cjs/nominal/nominal_match.js.map +1 -0
  165. package/cjs/null/null_type.d.ts +58 -0
  166. package/cjs/null/null_type.d.ts.map +1 -0
  167. package/cjs/null/null_type.js +3 -0
  168. package/cjs/null/null_type.js.map +1 -0
  169. package/cjs/number/integer.d.ts +75 -0
  170. package/cjs/number/integer.d.ts.map +1 -0
  171. package/cjs/number/integer.js +3 -0
  172. package/cjs/number/integer.js.map +1 -0
  173. package/cjs/number/negative.d.ts +78 -0
  174. package/cjs/number/negative.d.ts.map +1 -0
  175. package/cjs/number/negative.js +3 -0
  176. package/cjs/number/negative.js.map +1 -0
  177. package/cjs/number/number_array.d.ts +3 -0
  178. package/cjs/number/number_array.d.ts.map +1 -0
  179. package/cjs/number/number_array.js +3 -0
  180. package/cjs/number/number_array.js.map +1 -0
  181. package/cjs/number/number_plus.d.ts +8 -0
  182. package/cjs/number/number_plus.d.ts.map +1 -0
  183. package/cjs/number/number_plus.js.map +1 -0
  184. package/cjs/number/number_type.d.ts +58 -0
  185. package/cjs/number/number_type.d.ts.map +1 -0
  186. package/cjs/number/number_type.js +3 -0
  187. package/cjs/number/number_type.js.map +1 -0
  188. package/cjs/number/numeric_type.d.ts +67 -0
  189. package/cjs/number/numeric_type.d.ts.map +1 -0
  190. package/cjs/number/numeric_type.js +3 -0
  191. package/cjs/number/numeric_type.js.map +1 -0
  192. package/cjs/number/positive.d.ts +61 -0
  193. package/cjs/number/positive.d.ts.map +1 -0
  194. package/cjs/number/positive.js +3 -0
  195. package/cjs/number/positive.js.map +1 -0
  196. package/cjs/number/strict_number_type.d.ts +61 -0
  197. package/cjs/number/strict_number_type.d.ts.map +1 -0
  198. package/cjs/number/strict_number_type.js +3 -0
  199. package/cjs/number/strict_number_type.js.map +1 -0
  200. package/cjs/object/ANotB.d.ts +1 -1
  201. package/cjs/object/ANotB.d.ts.map +1 -1
  202. package/cjs/object/KnownKeys.d.ts +1 -1
  203. package/cjs/object/KnownKeys.d.ts.map +1 -1
  204. package/cjs/object/Partial.d.ts +1 -1
  205. package/cjs/object/Partial.d.ts.map +1 -1
  206. package/cjs/object/getField.d.ts +1 -1
  207. package/cjs/object/getField.d.ts.map +1 -1
  208. package/cjs/object/hasProperty.d.ts +1 -1
  209. package/cjs/object/hasProperty.d.ts.map +1 -1
  210. package/cjs/object/index.d.ts +17 -16
  211. package/cjs/object/index.d.ts.map +1 -1
  212. package/cjs/object/index.js.map +1 -1
  213. package/cjs/object/object_type.d.ts +62 -0
  214. package/cjs/object/object_type.d.ts.map +1 -0
  215. package/cjs/object/object_type.js +3 -0
  216. package/cjs/object/object_type.js.map +1 -0
  217. package/cjs/object/omit.d.ts +1 -1
  218. package/cjs/object/omit.d.ts.map +1 -1
  219. package/cjs/object/pick.d.ts +1 -1
  220. package/cjs/object/pick.d.ts.map +1 -1
  221. package/cjs/object/properties.d.ts +7 -0
  222. package/cjs/object/properties.d.ts.map +1 -0
  223. package/cjs/object/properties.js +3 -0
  224. package/cjs/object/properties.js.map +1 -0
  225. package/cjs/predicates/index.d.ts +0 -2
  226. package/cjs/predicates/index.d.ts.map +1 -1
  227. package/cjs/predicates/index.js.map +1 -1
  228. package/cjs/predicates/isType.d.ts +1 -1
  229. package/cjs/predicates/isType.d.ts.map +1 -1
  230. package/cjs/predicates/isType.js +2 -1
  231. package/cjs/predicates/isType.js.map +1 -1
  232. package/cjs/primitive.d.ts +2 -0
  233. package/cjs/primitive.d.ts.map +1 -0
  234. package/cjs/primitive.js +3 -0
  235. package/cjs/primitive.js.map +1 -0
  236. package/cjs/string/strict_string_type.d.ts +66 -0
  237. package/cjs/string/strict_string_type.d.ts.map +1 -0
  238. package/cjs/string/strict_string_type.js +3 -0
  239. package/cjs/string/strict_string_type.js.map +1 -0
  240. package/cjs/string/string_type.d.ts +66 -0
  241. package/cjs/string/string_type.d.ts.map +1 -0
  242. package/cjs/string/string_type.js +3 -0
  243. package/cjs/string/string_type.js.map +1 -0
  244. package/cjs/symbol/symbol_type.d.ts +60 -0
  245. package/cjs/symbol/symbol_type.d.ts.map +1 -0
  246. package/cjs/symbol/symbol_type.js +3 -0
  247. package/cjs/symbol/symbol_type.js.map +1 -0
  248. package/cjs/testing/stub.d.ts +2 -2
  249. package/cjs/testing/stub.d.ts.map +1 -1
  250. package/cjs/testing/test_type.d.ts +102 -0
  251. package/cjs/testing/test_type.d.ts.map +1 -0
  252. package/cjs/testing/test_type.js +105 -0
  253. package/cjs/testing/test_type.js.map +1 -0
  254. package/cjs/tuple/tuple_type.d.ts +67 -0
  255. package/cjs/tuple/tuple_type.d.ts.map +1 -0
  256. package/cjs/tuple/tuple_type.js +3 -0
  257. package/cjs/tuple/tuple_type.js.map +1 -0
  258. package/cjs/type/constants.d.ts +5 -0
  259. package/cjs/type/constants.d.ts.map +1 -0
  260. package/cjs/type/constants.js +8 -0
  261. package/cjs/type/constants.js.map +1 -0
  262. package/cjs/type/failed.d.ts +33 -0
  263. package/cjs/type/failed.d.ts.map +1 -0
  264. package/cjs/type/failed.js +4 -0
  265. package/cjs/type/failed.js.map +1 -0
  266. package/cjs/undefined/undefined_type.d.ts +61 -0
  267. package/cjs/undefined/undefined_type.d.ts.map +1 -0
  268. package/cjs/undefined/undefined_type.js +3 -0
  269. package/cjs/undefined/undefined_type.js.map +1 -0
  270. package/cjs/union/union_to_intersection.d.ts +3 -0
  271. package/cjs/union/union_to_intersection.d.ts.map +1 -0
  272. package/cjs/union/union_to_intersection.js +8 -0
  273. package/cjs/union/union_to_intersection.js.map +1 -0
  274. package/cjs/union_keys.d.ts +6 -0
  275. package/cjs/union_keys.d.ts.map +1 -0
  276. package/cjs/union_keys.js +3 -0
  277. package/cjs/union_keys.js.map +1 -0
  278. package/cjs/unknown/unknown_type.d.ts +59 -0
  279. package/cjs/unknown/unknown_type.d.ts.map +1 -0
  280. package/cjs/unknown/unknown_type.js +3 -0
  281. package/cjs/unknown/unknown_type.js.map +1 -0
  282. package/cjs/void/void_type.d.ts +51 -0
  283. package/cjs/void/void_type.d.ts.map +1 -0
  284. package/cjs/void/void_type.js +3 -0
  285. package/cjs/void/void_type.js.map +1 -0
  286. package/esm/any/any_or_never.d.ts +17 -0
  287. package/esm/any/any_or_never.d.ts.map +1 -0
  288. package/esm/any/any_or_never.js +2 -0
  289. package/esm/any/any_or_never.js.map +1 -0
  290. package/esm/any/any_type.d.ts +57 -0
  291. package/esm/any/any_type.d.ts.map +1 -0
  292. package/esm/any/any_type.js +2 -0
  293. package/esm/any/any_type.js.map +1 -0
  294. package/esm/array/array.d.ts +32 -0
  295. package/esm/array/array.d.ts.map +1 -0
  296. package/esm/array/array.js.map +1 -0
  297. package/esm/array/array_index.d.ts +37 -0
  298. package/esm/array/array_index.d.ts.map +1 -0
  299. package/esm/array/array_index.js +2 -0
  300. package/esm/array/array_index.js.map +1 -0
  301. package/esm/array/array_plus.d.ts +3 -0
  302. package/esm/array/array_plus.d.ts.map +1 -0
  303. package/esm/array/array_plus.js.map +1 -0
  304. package/esm/array/array_type.d.ts +56 -0
  305. package/esm/array/array_type.d.ts.map +1 -0
  306. package/esm/array/array_type.js +2 -0
  307. package/esm/array/array_type.js.map +1 -0
  308. package/esm/array/common_prop_keys.d.ts.map +1 -0
  309. package/esm/array/common_prop_keys.js.map +1 -0
  310. package/esm/array/create_tuple.d.ts +11 -0
  311. package/esm/array/create_tuple.d.ts.map +1 -0
  312. package/esm/array/create_tuple.js.map +1 -0
  313. package/esm/array/drop.d.ts +19 -0
  314. package/esm/array/drop.d.ts.map +1 -0
  315. package/esm/array/drop.js.map +1 -0
  316. package/esm/array/filter.d.ts +9 -0
  317. package/esm/array/filter.d.ts.map +1 -0
  318. package/esm/array/filter.js.map +1 -0
  319. package/esm/array/find_first.d.ts.map +1 -0
  320. package/esm/array/find_first.js.map +1 -0
  321. package/esm/array/find_last.d.ts.map +1 -0
  322. package/esm/array/find_last.js.map +1 -0
  323. package/esm/array/head.d.ts.map +1 -0
  324. package/esm/array/head.js.map +1 -0
  325. package/esm/array/index.d.ts +18 -0
  326. package/esm/array/index.d.ts.map +1 -0
  327. package/esm/array/index.js +18 -0
  328. package/esm/array/index.js.map +1 -0
  329. package/esm/array/intersect_of_props.d.ts.map +1 -0
  330. package/esm/array/intersect_of_props.js.map +1 -0
  331. package/esm/array/last.d.ts.map +1 -0
  332. package/esm/array/last.js.map +1 -0
  333. package/esm/array/literal_array.d.ts.map +1 -0
  334. package/esm/array/literal_array.js.map +1 -0
  335. package/esm/array/pad_left.d.ts +6 -0
  336. package/esm/array/pad_left.d.ts.map +1 -0
  337. package/esm/array/pad_left.js.map +1 -0
  338. package/esm/array/reduce_while.d.ts.map +1 -0
  339. package/esm/array/reduce_while.js.map +1 -0
  340. package/esm/array/reverse.d.ts.map +1 -0
  341. package/esm/array/reverse.js.map +1 -0
  342. package/esm/array/some.d.ts +8 -0
  343. package/esm/array/some.d.ts.map +1 -0
  344. package/esm/array/some.js.map +1 -0
  345. package/esm/array/tail.d.ts.map +1 -0
  346. package/esm/array/tail.js.map +1 -0
  347. package/esm/array/union_of_props.d.ts.map +1 -0
  348. package/esm/array/union_of_props.js.map +1 -0
  349. package/esm/array/union_of_values.d.ts.map +1 -0
  350. package/esm/array/union_of_values.js.map +1 -0
  351. package/esm/assertion/assert_type.d.ts +34 -0
  352. package/esm/assertion/assert_type.d.ts.map +1 -0
  353. package/esm/assertion/assert_type.js +103 -0
  354. package/esm/assertion/assert_type.js.map +1 -0
  355. package/esm/bigint/bigint_type.d.ts +62 -0
  356. package/esm/bigint/bigint_type.d.ts.map +1 -0
  357. package/esm/bigint/bigint_type.js +2 -0
  358. package/esm/bigint/bigint_type.js.map +1 -0
  359. package/esm/bigint/strict_bigint_type.d.ts +64 -0
  360. package/esm/bigint/strict_bigint_type.d.ts.map +1 -0
  361. package/esm/bigint/strict_bigint_type.js +2 -0
  362. package/esm/bigint/strict_bigint_type.js.map +1 -0
  363. package/esm/boolean/boolean_type.d.ts +64 -0
  364. package/esm/boolean/boolean_type.d.ts.map +1 -0
  365. package/esm/boolean/boolean_type.js +2 -0
  366. package/esm/boolean/boolean_type.js.map +1 -0
  367. package/esm/boolean/false_type.d.ts +57 -0
  368. package/esm/boolean/false_type.d.ts.map +1 -0
  369. package/esm/boolean/false_type.js +2 -0
  370. package/esm/boolean/false_type.js.map +1 -0
  371. package/esm/boolean/strict_boolean_type.d.ts +61 -0
  372. package/esm/boolean/strict_boolean_type.d.ts.map +1 -0
  373. package/esm/boolean/strict_boolean_type.js +2 -0
  374. package/esm/boolean/strict_boolean_type.js.map +1 -0
  375. package/esm/boolean/true_type.d.ts +57 -0
  376. package/esm/boolean/true_type.d.ts.map +1 -0
  377. package/esm/boolean/true_type.js +2 -0
  378. package/esm/boolean/true_type.js.map +1 -0
  379. package/esm/composable_types.d.ts +9 -0
  380. package/esm/composable_types.d.ts.map +1 -0
  381. package/esm/composable_types.js +2 -0
  382. package/esm/composable_types.js.map +1 -0
  383. package/esm/equal/equal.d.ts +52 -0
  384. package/esm/equal/equal.d.ts.map +1 -0
  385. package/esm/equal/equal.js +2 -0
  386. package/esm/equal/equal.js.map +1 -0
  387. package/esm/function/any_function.d.ts +2 -0
  388. package/esm/function/any_function.d.ts.map +1 -0
  389. package/esm/function/any_function.js +2 -0
  390. package/esm/function/any_function.js.map +1 -0
  391. package/esm/function/extract_function.d.ts +24 -0
  392. package/esm/function/extract_function.d.ts.map +1 -0
  393. package/esm/function/extract_function.js +9 -0
  394. package/esm/function/extract_function.js.map +1 -0
  395. package/esm/function/function_type.d.ts +67 -0
  396. package/esm/function/function_type.d.ts.map +1 -0
  397. package/esm/function/function_type.js +2 -0
  398. package/esm/function/function_type.js.map +1 -0
  399. package/esm/function/strict_function_type.d.ts +57 -0
  400. package/esm/function/strict_function_type.d.ts.map +1 -0
  401. package/esm/function/strict_function_type.js +2 -0
  402. package/esm/function/strict_function_type.js.map +1 -0
  403. package/esm/functional/Maybe.d.ts +2 -2
  404. package/esm/functional/Maybe.d.ts.map +1 -1
  405. package/esm/functional/compose.d.ts +2 -2
  406. package/esm/functional/compose.d.ts.map +1 -1
  407. package/esm/index.d.ts +44 -15
  408. package/esm/index.d.ts.map +1 -1
  409. package/esm/index.js +8 -12
  410. package/esm/index.js.map +1 -1
  411. package/esm/json.d.ts +12 -0
  412. package/esm/json.d.ts.map +1 -0
  413. package/esm/json.js +11 -0
  414. package/esm/json.js.map +1 -0
  415. package/esm/math/Add.d.ts +4 -3
  416. package/esm/math/Add.d.ts.map +1 -1
  417. package/esm/math/Digit.d.ts +4 -3
  418. package/esm/math/Digit.d.ts.map +1 -1
  419. package/esm/math/GreaterThan.d.ts +6 -4
  420. package/esm/math/GreaterThan.d.ts.map +1 -1
  421. package/esm/math/Max.d.ts +1 -1
  422. package/esm/math/Max.d.ts.map +1 -1
  423. package/esm/math/Subtract.d.ts +4 -3
  424. package/esm/math/Subtract.d.ts.map +1 -1
  425. package/esm/never/never_type.d.ts +59 -0
  426. package/esm/never/never_type.d.ts.map +1 -0
  427. package/esm/never/never_type.js +2 -0
  428. package/esm/never/never_type.js.map +1 -0
  429. package/esm/nominal/brand.d.ts +23 -0
  430. package/esm/nominal/brand.d.ts.map +1 -0
  431. package/esm/nominal/brand.js +16 -0
  432. package/esm/nominal/brand.js.map +1 -0
  433. package/esm/nominal/constants.d.ts +3 -0
  434. package/esm/nominal/constants.d.ts.map +1 -0
  435. package/esm/nominal/constants.js +3 -0
  436. package/esm/nominal/constants.js.map +1 -0
  437. package/esm/nominal/flavor.d.ts +31 -0
  438. package/esm/nominal/flavor.d.ts.map +1 -0
  439. package/esm/nominal/flavor.js +16 -0
  440. package/esm/nominal/flavor.js.map +1 -0
  441. package/esm/nominal/index.d.ts +4 -0
  442. package/esm/nominal/index.d.ts.map +1 -0
  443. package/esm/nominal/index.js +4 -0
  444. package/esm/nominal/index.js.map +1 -0
  445. package/esm/nominal/nominal_match.d.ts +5 -0
  446. package/esm/nominal/nominal_match.d.ts.map +1 -0
  447. package/esm/nominal/nominal_match.js +9 -0
  448. package/esm/nominal/nominal_match.js.map +1 -0
  449. package/esm/null/null_type.d.ts +58 -0
  450. package/esm/null/null_type.d.ts.map +1 -0
  451. package/esm/null/null_type.js +2 -0
  452. package/esm/null/null_type.js.map +1 -0
  453. package/esm/number/integer.d.ts +75 -0
  454. package/esm/number/integer.d.ts.map +1 -0
  455. package/esm/number/integer.js +2 -0
  456. package/esm/number/integer.js.map +1 -0
  457. package/esm/number/negative.d.ts +78 -0
  458. package/esm/number/negative.d.ts.map +1 -0
  459. package/esm/number/negative.js +2 -0
  460. package/esm/number/negative.js.map +1 -0
  461. package/esm/number/number_array.d.ts +3 -0
  462. package/esm/number/number_array.d.ts.map +1 -0
  463. package/esm/number/number_array.js +2 -0
  464. package/esm/number/number_array.js.map +1 -0
  465. package/esm/number/number_plus.d.ts +8 -0
  466. package/esm/number/number_plus.d.ts.map +1 -0
  467. package/esm/number/number_plus.js.map +1 -0
  468. package/esm/number/number_type.d.ts +58 -0
  469. package/esm/number/number_type.d.ts.map +1 -0
  470. package/esm/number/number_type.js +2 -0
  471. package/esm/number/number_type.js.map +1 -0
  472. package/esm/number/numeric_type.d.ts +67 -0
  473. package/esm/number/numeric_type.d.ts.map +1 -0
  474. package/esm/number/numeric_type.js +2 -0
  475. package/esm/number/numeric_type.js.map +1 -0
  476. package/esm/number/positive.d.ts +61 -0
  477. package/esm/number/positive.d.ts.map +1 -0
  478. package/esm/number/positive.js +2 -0
  479. package/esm/number/positive.js.map +1 -0
  480. package/esm/number/strict_number_type.d.ts +61 -0
  481. package/esm/number/strict_number_type.d.ts.map +1 -0
  482. package/esm/number/strict_number_type.js +2 -0
  483. package/esm/number/strict_number_type.js.map +1 -0
  484. package/esm/object/ANotB.d.ts +1 -1
  485. package/esm/object/ANotB.d.ts.map +1 -1
  486. package/esm/object/KnownKeys.d.ts +1 -1
  487. package/esm/object/KnownKeys.d.ts.map +1 -1
  488. package/esm/object/Partial.d.ts +1 -1
  489. package/esm/object/Partial.d.ts.map +1 -1
  490. package/esm/object/getField.d.ts +1 -1
  491. package/esm/object/getField.d.ts.map +1 -1
  492. package/esm/object/hasProperty.d.ts +1 -1
  493. package/esm/object/hasProperty.d.ts.map +1 -1
  494. package/esm/object/index.d.ts +17 -16
  495. package/esm/object/index.d.ts.map +1 -1
  496. package/esm/object/index.js.map +1 -1
  497. package/esm/object/object_type.d.ts +62 -0
  498. package/esm/object/object_type.d.ts.map +1 -0
  499. package/esm/object/object_type.js +2 -0
  500. package/esm/object/object_type.js.map +1 -0
  501. package/esm/object/omit.d.ts +1 -1
  502. package/esm/object/omit.d.ts.map +1 -1
  503. package/esm/object/pick.d.ts +1 -1
  504. package/esm/object/pick.d.ts.map +1 -1
  505. package/esm/object/properties.d.ts +7 -0
  506. package/esm/object/properties.d.ts.map +1 -0
  507. package/esm/object/properties.js +2 -0
  508. package/esm/object/properties.js.map +1 -0
  509. package/esm/predicates/index.d.ts +0 -2
  510. package/esm/predicates/index.d.ts.map +1 -1
  511. package/esm/predicates/index.js.map +1 -1
  512. package/esm/predicates/isType.d.ts +1 -1
  513. package/esm/predicates/isType.d.ts.map +1 -1
  514. package/esm/predicates/isType.js +2 -1
  515. package/esm/predicates/isType.js.map +1 -1
  516. package/esm/primitive.d.ts +2 -0
  517. package/esm/primitive.d.ts.map +1 -0
  518. package/esm/primitive.js +2 -0
  519. package/esm/primitive.js.map +1 -0
  520. package/esm/string/strict_string_type.d.ts +66 -0
  521. package/esm/string/strict_string_type.d.ts.map +1 -0
  522. package/esm/string/strict_string_type.js +2 -0
  523. package/esm/string/strict_string_type.js.map +1 -0
  524. package/esm/string/string_type.d.ts +66 -0
  525. package/esm/string/string_type.d.ts.map +1 -0
  526. package/esm/string/string_type.js +2 -0
  527. package/esm/string/string_type.js.map +1 -0
  528. package/esm/symbol/symbol_type.d.ts +60 -0
  529. package/esm/symbol/symbol_type.d.ts.map +1 -0
  530. package/esm/symbol/symbol_type.js +2 -0
  531. package/esm/symbol/symbol_type.js.map +1 -0
  532. package/esm/testing/stub.d.ts +2 -2
  533. package/esm/testing/stub.d.ts.map +1 -1
  534. package/esm/testing/test_type.d.ts +102 -0
  535. package/esm/testing/test_type.d.ts.map +1 -0
  536. package/esm/testing/test_type.js +102 -0
  537. package/esm/testing/test_type.js.map +1 -0
  538. package/esm/tuple/tuple_type.d.ts +67 -0
  539. package/esm/tuple/tuple_type.d.ts.map +1 -0
  540. package/esm/tuple/tuple_type.js +2 -0
  541. package/esm/tuple/tuple_type.js.map +1 -0
  542. package/esm/type/constants.d.ts +5 -0
  543. package/esm/type/constants.d.ts.map +1 -0
  544. package/esm/type/constants.js +5 -0
  545. package/esm/type/constants.js.map +1 -0
  546. package/esm/type/failed.d.ts +33 -0
  547. package/esm/type/failed.d.ts.map +1 -0
  548. package/esm/type/failed.js +2 -0
  549. package/esm/type/failed.js.map +1 -0
  550. package/esm/undefined/undefined_type.d.ts +61 -0
  551. package/esm/undefined/undefined_type.d.ts.map +1 -0
  552. package/esm/undefined/undefined_type.js +2 -0
  553. package/esm/undefined/undefined_type.js.map +1 -0
  554. package/esm/union/union_to_intersection.d.ts +3 -0
  555. package/esm/union/union_to_intersection.d.ts.map +1 -0
  556. package/esm/union/union_to_intersection.js +4 -0
  557. package/esm/union/union_to_intersection.js.map +1 -0
  558. package/esm/union_keys.d.ts +6 -0
  559. package/esm/union_keys.d.ts.map +1 -0
  560. package/esm/union_keys.js +2 -0
  561. package/esm/union_keys.js.map +1 -0
  562. package/esm/unknown/unknown_type.d.ts +59 -0
  563. package/esm/unknown/unknown_type.d.ts.map +1 -0
  564. package/esm/unknown/unknown_type.js +2 -0
  565. package/esm/unknown/unknown_type.js.map +1 -0
  566. package/esm/void/void_type.d.ts +51 -0
  567. package/esm/void/void_type.d.ts.map +1 -0
  568. package/esm/void/void_type.js +2 -0
  569. package/esm/void/void_type.js.map +1 -0
  570. package/package.json +10 -28
  571. package/ts/any/any_or_never.ts +17 -0
  572. package/ts/any/any_type.ts +60 -0
  573. package/ts/any/readme.md +26 -0
  574. package/ts/array/array.ts +37 -0
  575. package/ts/array/array_index.ts +70 -0
  576. package/ts/array/array_plus.ts +2 -0
  577. package/ts/array/array_type.ts +61 -0
  578. package/ts/array/create_tuple.ts +17 -0
  579. package/ts/array/drop.ts +71 -0
  580. package/ts/array/filter.ts +27 -0
  581. package/ts/array/index.ts +17 -0
  582. package/ts/array/pad_left.ts +16 -0
  583. package/ts/array/readme.md +32 -0
  584. package/ts/array/some.ts +33 -0
  585. package/ts/assertion/assert_type.ts +107 -0
  586. package/ts/assertion/readme.md +14 -0
  587. package/ts/bigint/bigint_type.ts +65 -0
  588. package/ts/bigint/readme.md +51 -0
  589. package/ts/bigint/strict_bigint_type.ts +69 -0
  590. package/ts/boolean/boolean_type.ts +69 -0
  591. package/ts/boolean/false_type.ts +61 -0
  592. package/ts/boolean/readme.md +85 -0
  593. package/ts/boolean/strict_boolean_type.ts +65 -0
  594. package/ts/boolean/true_type.ts +61 -0
  595. package/ts/composable_types.ts +9 -0
  596. package/ts/equal/equal.ts +88 -0
  597. package/ts/equal/readme.md +31 -0
  598. package/ts/function/extract_function.ts +29 -0
  599. package/ts/function/function_type.ts +72 -0
  600. package/ts/function/readme.md +84 -0
  601. package/ts/function/strict_function_type.ts +61 -0
  602. package/ts/functional/Maybe.ts +2 -2
  603. package/ts/functional/compose.ts +2 -2
  604. package/ts/index.ts +92 -19
  605. package/ts/math/Add.ts +5 -4
  606. package/ts/math/Digit.ts +4 -3
  607. package/ts/math/GreaterThan.ts +7 -5
  608. package/ts/math/Max.ts +1 -1
  609. package/ts/math/Subtract.ts +5 -5
  610. package/ts/never/never_type.ts +65 -0
  611. package/ts/never/readme.md +37 -0
  612. package/ts/nominal/brand.ts +43 -0
  613. package/ts/nominal/flavor.ts +53 -0
  614. package/ts/nominal/index.ts +3 -0
  615. package/ts/nominal/nominal_match.ts +22 -0
  616. package/ts/null/null_type.ts +61 -0
  617. package/ts/null/readme.md +24 -0
  618. package/ts/number/integer.ts +81 -0
  619. package/ts/number/negative.ts +109 -0
  620. package/ts/number/number_array.ts +15 -0
  621. package/ts/number/number_plus.ts +20 -0
  622. package/ts/number/number_type.ts +61 -0
  623. package/ts/number/numeric_type.ts +72 -0
  624. package/ts/number/positive.ts +68 -0
  625. package/ts/number/readme.md +155 -0
  626. package/ts/number/strict_number_type.ts +65 -0
  627. package/ts/object/ANotB.ts +1 -1
  628. package/ts/object/KnownKeys.ts +1 -1
  629. package/ts/object/Partial.ts +1 -1
  630. package/ts/object/getField.ts +1 -1
  631. package/ts/object/hasProperty.ts +1 -1
  632. package/ts/object/index.ts +17 -16
  633. package/ts/object/object_type.ts +65 -0
  634. package/ts/object/omit.ts +1 -1
  635. package/ts/object/pick.ts +1 -1
  636. package/ts/object/properties.ts +4 -0
  637. package/ts/object/readme.md +28 -0
  638. package/ts/predicates/index.ts +0 -3
  639. package/ts/predicates/isType.ts +4 -2
  640. package/ts/primitive.ts +10 -0
  641. package/ts/string/readme.md +43 -0
  642. package/ts/string/strict_string_type.ts +69 -0
  643. package/ts/string/string_type.ts +69 -0
  644. package/ts/symbol/readme.md +34 -0
  645. package/ts/symbol/symbol_type.ts +65 -0
  646. package/ts/testing/readme.md +19 -0
  647. package/ts/testing/stub.ts +2 -2
  648. package/ts/testing/test_type.ts +127 -0
  649. package/ts/tuple/readme.md +24 -4
  650. package/ts/tuple/tuple_type.ts +72 -0
  651. package/ts/type/constants.ts +4 -0
  652. package/ts/type/failed.ts +34 -0
  653. package/ts/undefined/readme.md +18 -0
  654. package/ts/undefined/undefined_type.ts +65 -0
  655. package/ts/unknown/readme.md +27 -0
  656. package/ts/unknown/unknown_type.ts +63 -0
  657. package/ts/void/readme.md +26 -0
  658. package/ts/void/void_type.ts +58 -0
  659. package/cjs/ComposableTypes.d.ts +0 -9
  660. package/cjs/ComposableTypes.d.ts.map +0 -1
  661. package/cjs/ComposableTypes.js +0 -3
  662. package/cjs/ComposableTypes.js.map +0 -1
  663. package/cjs/JSONTypes.d.ts +0 -12
  664. package/cjs/JSONTypes.d.ts.map +0 -1
  665. package/cjs/JSONTypes.js +0 -14
  666. package/cjs/JSONTypes.js.map +0 -1
  667. package/cjs/PrimitiveTypes.d.ts +0 -3
  668. package/cjs/PrimitiveTypes.d.ts.map +0 -1
  669. package/cjs/PrimitiveTypes.js +0 -4
  670. package/cjs/PrimitiveTypes.js.map +0 -1
  671. package/cjs/UnionKeys.d.ts +0 -6
  672. package/cjs/UnionKeys.d.ts.map +0 -1
  673. package/cjs/UnionKeys.js +0 -3
  674. package/cjs/UnionKeys.js.map +0 -1
  675. package/cjs/UnionToIntersection.d.ts +0 -3
  676. package/cjs/UnionToIntersection.d.ts.map +0 -1
  677. package/cjs/UnionToIntersection.js +0 -8
  678. package/cjs/UnionToIntersection.js.map +0 -1
  679. package/cjs/any_plus/any.d.ts +0 -29
  680. package/cjs/any_plus/any.d.ts.map +0 -1
  681. package/cjs/any_plus/any.js +0 -3
  682. package/cjs/any_plus/any.js.map +0 -1
  683. package/cjs/any_plus/index.d.ts +0 -2
  684. package/cjs/any_plus/index.d.ts.map +0 -1
  685. package/cjs/any_plus/index.js +0 -3
  686. package/cjs/any_plus/index.js.map +0 -1
  687. package/cjs/array_plus/array.d.ts +0 -42
  688. package/cjs/array_plus/array.d.ts.map +0 -1
  689. package/cjs/array_plus/array.js.map +0 -1
  690. package/cjs/array_plus/array_number.d.ts +0 -4
  691. package/cjs/array_plus/array_number.d.ts.map +0 -1
  692. package/cjs/array_plus/array_number.js +0 -3
  693. package/cjs/array_plus/array_number.js.map +0 -1
  694. package/cjs/array_plus/array_plus.d.ts +0 -35
  695. package/cjs/array_plus/array_plus.d.ts.map +0 -1
  696. package/cjs/array_plus/array_plus.js.map +0 -1
  697. package/cjs/array_plus/common_prop_keys.d.ts.map +0 -1
  698. package/cjs/array_plus/common_prop_keys.js.map +0 -1
  699. package/cjs/array_plus/create_tuple.d.ts +0 -10
  700. package/cjs/array_plus/create_tuple.d.ts.map +0 -1
  701. package/cjs/array_plus/create_tuple.js.map +0 -1
  702. package/cjs/array_plus/drop.d.ts +0 -19
  703. package/cjs/array_plus/drop.d.ts.map +0 -1
  704. package/cjs/array_plus/drop.js.map +0 -1
  705. package/cjs/array_plus/filter.d.ts +0 -10
  706. package/cjs/array_plus/filter.d.ts.map +0 -1
  707. package/cjs/array_plus/filter.js.map +0 -1
  708. package/cjs/array_plus/find_first.d.ts.map +0 -1
  709. package/cjs/array_plus/find_first.js.map +0 -1
  710. package/cjs/array_plus/find_last.d.ts.map +0 -1
  711. package/cjs/array_plus/find_last.js.map +0 -1
  712. package/cjs/array_plus/head.d.ts.map +0 -1
  713. package/cjs/array_plus/head.js.map +0 -1
  714. package/cjs/array_plus/index.d.ts +0 -20
  715. package/cjs/array_plus/index.d.ts.map +0 -1
  716. package/cjs/array_plus/index.js +0 -20
  717. package/cjs/array_plus/index.js.map +0 -1
  718. package/cjs/array_plus/intersect_of_props.d.ts.map +0 -1
  719. package/cjs/array_plus/intersect_of_props.js.map +0 -1
  720. package/cjs/array_plus/is_array.d.ts +0 -2
  721. package/cjs/array_plus/is_array.d.ts.map +0 -1
  722. package/cjs/array_plus/is_array.js +0 -3
  723. package/cjs/array_plus/is_array.js.map +0 -1
  724. package/cjs/array_plus/last.d.ts.map +0 -1
  725. package/cjs/array_plus/last.js.map +0 -1
  726. package/cjs/array_plus/literal_array.d.ts.map +0 -1
  727. package/cjs/array_plus/literal_array.js.map +0 -1
  728. package/cjs/array_plus/pad_left.d.ts +0 -6
  729. package/cjs/array_plus/pad_left.d.ts.map +0 -1
  730. package/cjs/array_plus/pad_left.js.map +0 -1
  731. package/cjs/array_plus/reduce_while.d.ts.map +0 -1
  732. package/cjs/array_plus/reduce_while.js.map +0 -1
  733. package/cjs/array_plus/reverse.d.ts.map +0 -1
  734. package/cjs/array_plus/reverse.js.map +0 -1
  735. package/cjs/array_plus/some.d.ts +0 -8
  736. package/cjs/array_plus/some.d.ts.map +0 -1
  737. package/cjs/array_plus/some.js.map +0 -1
  738. package/cjs/array_plus/tail.d.ts.map +0 -1
  739. package/cjs/array_plus/tail.js.map +0 -1
  740. package/cjs/array_plus/union_of_props.d.ts.map +0 -1
  741. package/cjs/array_plus/union_of_props.js.map +0 -1
  742. package/cjs/array_plus/union_of_values.d.ts.map +0 -1
  743. package/cjs/array_plus/union_of_values.js.map +0 -1
  744. package/cjs/assertion/assertType.d.ts +0 -34
  745. package/cjs/assertion/assertType.d.ts.map +0 -1
  746. package/cjs/assertion/assertType.js +0 -107
  747. package/cjs/assertion/assertType.js.map +0 -1
  748. package/cjs/assertion/index.d.ts +0 -2
  749. package/cjs/assertion/index.d.ts.map +0 -1
  750. package/cjs/assertion/index.js +0 -18
  751. package/cjs/assertion/index.js.map +0 -1
  752. package/cjs/function/AnyFunction.d.ts +0 -2
  753. package/cjs/function/AnyFunction.d.ts.map +0 -1
  754. package/cjs/function/AnyFunction.js +0 -3
  755. package/cjs/function/AnyFunction.js.map +0 -1
  756. package/cjs/function/ExtractFunction.d.ts +0 -15
  757. package/cjs/function/ExtractFunction.d.ts.map +0 -1
  758. package/cjs/function/ExtractFunction.js +0 -13
  759. package/cjs/function/ExtractFunction.js.map +0 -1
  760. package/cjs/function/index.d.ts +0 -3
  761. package/cjs/function/index.d.ts.map +0 -1
  762. package/cjs/function/index.js +0 -18
  763. package/cjs/function/index.js.map +0 -1
  764. package/cjs/nominal-types/Brand.d.ts +0 -21
  765. package/cjs/nominal-types/Brand.d.ts.map +0 -1
  766. package/cjs/nominal-types/Brand.js +0 -20
  767. package/cjs/nominal-types/Brand.js.map +0 -1
  768. package/cjs/nominal-types/Flavor.d.ts +0 -20
  769. package/cjs/nominal-types/Flavor.d.ts.map +0 -1
  770. package/cjs/nominal-types/Flavor.js +0 -20
  771. package/cjs/nominal-types/Flavor.js.map +0 -1
  772. package/cjs/nominal-types/index.d.ts +0 -4
  773. package/cjs/nominal-types/index.d.ts.map +0 -1
  774. package/cjs/nominal-types/index.js +0 -20
  775. package/cjs/nominal-types/index.js.map +0 -1
  776. package/cjs/nominal-types/nominalMatch.d.ts +0 -5
  777. package/cjs/nominal-types/nominalMatch.d.ts.map +0 -1
  778. package/cjs/nominal-types/nominalMatch.js +0 -13
  779. package/cjs/nominal-types/nominalMatch.js.map +0 -1
  780. package/cjs/nominal-types/types.d.ts +0 -3
  781. package/cjs/nominal-types/types.d.ts.map +0 -1
  782. package/cjs/nominal-types/types.js +0 -6
  783. package/cjs/nominal-types/types.js.map +0 -1
  784. package/cjs/number_plus/index.d.ts +0 -2
  785. package/cjs/number_plus/index.d.ts.map +0 -1
  786. package/cjs/number_plus/index.js +0 -3
  787. package/cjs/number_plus/index.js.map +0 -1
  788. package/cjs/number_plus/number.d.ts +0 -128
  789. package/cjs/number_plus/number.d.ts.map +0 -1
  790. package/cjs/number_plus/number.js +0 -3
  791. package/cjs/number_plus/number.js.map +0 -1
  792. package/cjs/number_plus/number_plus.d.ts +0 -2
  793. package/cjs/number_plus/number_plus.d.ts.map +0 -1
  794. package/cjs/number_plus/number_plus.js.map +0 -1
  795. package/cjs/predicates/Equal.d.ts +0 -38
  796. package/cjs/predicates/Equal.d.ts.map +0 -1
  797. package/cjs/predicates/Equal.js +0 -3
  798. package/cjs/predicates/Equal.js.map +0 -1
  799. package/cjs/testing/index.d.ts +0 -2
  800. package/cjs/testing/index.d.ts.map +0 -1
  801. package/cjs/testing/index.js +0 -18
  802. package/cjs/testing/index.js.map +0 -1
  803. package/cjs/tuple/index.d.ts +0 -2
  804. package/cjs/tuple/index.d.ts.map +0 -1
  805. package/cjs/tuple/index.js +0 -3
  806. package/cjs/tuple/index.js.map +0 -1
  807. package/cjs/tuple/tuple.d.ts +0 -16
  808. package/cjs/tuple/tuple.d.ts.map +0 -1
  809. package/cjs/tuple/tuple.js +0 -3
  810. package/cjs/tuple/tuple.js.map +0 -1
  811. package/esm/ComposableTypes.d.ts +0 -9
  812. package/esm/ComposableTypes.d.ts.map +0 -1
  813. package/esm/ComposableTypes.js +0 -2
  814. package/esm/ComposableTypes.js.map +0 -1
  815. package/esm/JSONTypes.d.ts +0 -12
  816. package/esm/JSONTypes.d.ts.map +0 -1
  817. package/esm/JSONTypes.js +0 -11
  818. package/esm/JSONTypes.js.map +0 -1
  819. package/esm/PrimitiveTypes.d.ts +0 -3
  820. package/esm/PrimitiveTypes.d.ts.map +0 -1
  821. package/esm/PrimitiveTypes.js +0 -3
  822. package/esm/PrimitiveTypes.js.map +0 -1
  823. package/esm/UnionKeys.d.ts +0 -6
  824. package/esm/UnionKeys.d.ts.map +0 -1
  825. package/esm/UnionKeys.js +0 -2
  826. package/esm/UnionKeys.js.map +0 -1
  827. package/esm/UnionToIntersection.d.ts +0 -3
  828. package/esm/UnionToIntersection.d.ts.map +0 -1
  829. package/esm/UnionToIntersection.js +0 -4
  830. package/esm/UnionToIntersection.js.map +0 -1
  831. package/esm/any_plus/any.d.ts +0 -29
  832. package/esm/any_plus/any.d.ts.map +0 -1
  833. package/esm/any_plus/any.js +0 -2
  834. package/esm/any_plus/any.js.map +0 -1
  835. package/esm/any_plus/index.d.ts +0 -2
  836. package/esm/any_plus/index.d.ts.map +0 -1
  837. package/esm/any_plus/index.js +0 -2
  838. package/esm/any_plus/index.js.map +0 -1
  839. package/esm/array_plus/array.d.ts +0 -42
  840. package/esm/array_plus/array.d.ts.map +0 -1
  841. package/esm/array_plus/array.js.map +0 -1
  842. package/esm/array_plus/array_number.d.ts +0 -4
  843. package/esm/array_plus/array_number.d.ts.map +0 -1
  844. package/esm/array_plus/array_number.js +0 -2
  845. package/esm/array_plus/array_number.js.map +0 -1
  846. package/esm/array_plus/array_plus.d.ts +0 -35
  847. package/esm/array_plus/array_plus.d.ts.map +0 -1
  848. package/esm/array_plus/array_plus.js.map +0 -1
  849. package/esm/array_plus/common_prop_keys.d.ts.map +0 -1
  850. package/esm/array_plus/common_prop_keys.js.map +0 -1
  851. package/esm/array_plus/create_tuple.d.ts +0 -10
  852. package/esm/array_plus/create_tuple.d.ts.map +0 -1
  853. package/esm/array_plus/create_tuple.js.map +0 -1
  854. package/esm/array_plus/drop.d.ts +0 -19
  855. package/esm/array_plus/drop.d.ts.map +0 -1
  856. package/esm/array_plus/drop.js.map +0 -1
  857. package/esm/array_plus/filter.d.ts +0 -10
  858. package/esm/array_plus/filter.d.ts.map +0 -1
  859. package/esm/array_plus/filter.js.map +0 -1
  860. package/esm/array_plus/find_first.d.ts.map +0 -1
  861. package/esm/array_plus/find_first.js.map +0 -1
  862. package/esm/array_plus/find_last.d.ts.map +0 -1
  863. package/esm/array_plus/find_last.js.map +0 -1
  864. package/esm/array_plus/head.d.ts.map +0 -1
  865. package/esm/array_plus/head.js.map +0 -1
  866. package/esm/array_plus/index.d.ts +0 -20
  867. package/esm/array_plus/index.d.ts.map +0 -1
  868. package/esm/array_plus/index.js +0 -4
  869. package/esm/array_plus/index.js.map +0 -1
  870. package/esm/array_plus/intersect_of_props.d.ts.map +0 -1
  871. package/esm/array_plus/intersect_of_props.js.map +0 -1
  872. package/esm/array_plus/is_array.d.ts +0 -2
  873. package/esm/array_plus/is_array.d.ts.map +0 -1
  874. package/esm/array_plus/is_array.js +0 -2
  875. package/esm/array_plus/is_array.js.map +0 -1
  876. package/esm/array_plus/last.d.ts.map +0 -1
  877. package/esm/array_plus/last.js.map +0 -1
  878. package/esm/array_plus/literal_array.d.ts.map +0 -1
  879. package/esm/array_plus/literal_array.js.map +0 -1
  880. package/esm/array_plus/pad_left.d.ts +0 -6
  881. package/esm/array_plus/pad_left.d.ts.map +0 -1
  882. package/esm/array_plus/pad_left.js.map +0 -1
  883. package/esm/array_plus/reduce_while.d.ts.map +0 -1
  884. package/esm/array_plus/reduce_while.js.map +0 -1
  885. package/esm/array_plus/reverse.d.ts.map +0 -1
  886. package/esm/array_plus/reverse.js.map +0 -1
  887. package/esm/array_plus/some.d.ts +0 -8
  888. package/esm/array_plus/some.d.ts.map +0 -1
  889. package/esm/array_plus/some.js.map +0 -1
  890. package/esm/array_plus/tail.d.ts.map +0 -1
  891. package/esm/array_plus/tail.js.map +0 -1
  892. package/esm/array_plus/union_of_props.d.ts.map +0 -1
  893. package/esm/array_plus/union_of_props.js.map +0 -1
  894. package/esm/array_plus/union_of_values.d.ts.map +0 -1
  895. package/esm/array_plus/union_of_values.js.map +0 -1
  896. package/esm/assertion/assertType.d.ts +0 -34
  897. package/esm/assertion/assertType.d.ts.map +0 -1
  898. package/esm/assertion/assertType.js +0 -103
  899. package/esm/assertion/assertType.js.map +0 -1
  900. package/esm/assertion/index.d.ts +0 -2
  901. package/esm/assertion/index.d.ts.map +0 -1
  902. package/esm/assertion/index.js +0 -2
  903. package/esm/assertion/index.js.map +0 -1
  904. package/esm/function/AnyFunction.d.ts +0 -2
  905. package/esm/function/AnyFunction.d.ts.map +0 -1
  906. package/esm/function/AnyFunction.js +0 -2
  907. package/esm/function/AnyFunction.js.map +0 -1
  908. package/esm/function/ExtractFunction.d.ts +0 -15
  909. package/esm/function/ExtractFunction.d.ts.map +0 -1
  910. package/esm/function/ExtractFunction.js +0 -9
  911. package/esm/function/ExtractFunction.js.map +0 -1
  912. package/esm/function/index.d.ts +0 -3
  913. package/esm/function/index.d.ts.map +0 -1
  914. package/esm/function/index.js +0 -2
  915. package/esm/function/index.js.map +0 -1
  916. package/esm/nominal-types/Brand.d.ts +0 -21
  917. package/esm/nominal-types/Brand.d.ts.map +0 -1
  918. package/esm/nominal-types/Brand.js +0 -16
  919. package/esm/nominal-types/Brand.js.map +0 -1
  920. package/esm/nominal-types/Flavor.d.ts +0 -20
  921. package/esm/nominal-types/Flavor.d.ts.map +0 -1
  922. package/esm/nominal-types/Flavor.js +0 -16
  923. package/esm/nominal-types/Flavor.js.map +0 -1
  924. package/esm/nominal-types/index.d.ts +0 -4
  925. package/esm/nominal-types/index.d.ts.map +0 -1
  926. package/esm/nominal-types/index.js +0 -4
  927. package/esm/nominal-types/index.js.map +0 -1
  928. package/esm/nominal-types/nominalMatch.d.ts +0 -5
  929. package/esm/nominal-types/nominalMatch.d.ts.map +0 -1
  930. package/esm/nominal-types/nominalMatch.js +0 -9
  931. package/esm/nominal-types/nominalMatch.js.map +0 -1
  932. package/esm/nominal-types/types.d.ts +0 -3
  933. package/esm/nominal-types/types.d.ts.map +0 -1
  934. package/esm/nominal-types/types.js +0 -3
  935. package/esm/nominal-types/types.js.map +0 -1
  936. package/esm/number_plus/index.d.ts +0 -2
  937. package/esm/number_plus/index.d.ts.map +0 -1
  938. package/esm/number_plus/index.js +0 -2
  939. package/esm/number_plus/index.js.map +0 -1
  940. package/esm/number_plus/number.d.ts +0 -128
  941. package/esm/number_plus/number.d.ts.map +0 -1
  942. package/esm/number_plus/number.js +0 -2
  943. package/esm/number_plus/number.js.map +0 -1
  944. package/esm/number_plus/number_plus.d.ts +0 -2
  945. package/esm/number_plus/number_plus.d.ts.map +0 -1
  946. package/esm/number_plus/number_plus.js.map +0 -1
  947. package/esm/predicates/Equal.d.ts +0 -38
  948. package/esm/predicates/Equal.d.ts.map +0 -1
  949. package/esm/predicates/Equal.js +0 -2
  950. package/esm/predicates/Equal.js.map +0 -1
  951. package/esm/testing/index.d.ts +0 -2
  952. package/esm/testing/index.d.ts.map +0 -1
  953. package/esm/testing/index.js +0 -2
  954. package/esm/testing/index.js.map +0 -1
  955. package/esm/tuple/index.d.ts +0 -2
  956. package/esm/tuple/index.d.ts.map +0 -1
  957. package/esm/tuple/index.js +0 -2
  958. package/esm/tuple/index.js.map +0 -1
  959. package/esm/tuple/tuple.d.ts +0 -16
  960. package/esm/tuple/tuple.d.ts.map +0 -1
  961. package/esm/tuple/tuple.js +0 -2
  962. package/esm/tuple/tuple.js.map +0 -1
  963. package/ts/ComposableTypes.ts +0 -10
  964. package/ts/PrimitiveTypes.ts +0 -15
  965. package/ts/any_plus/any.ts +0 -29
  966. package/ts/any_plus/index.ts +0 -1
  967. package/ts/array_plus/array.ts +0 -48
  968. package/ts/array_plus/array_number.ts +0 -12
  969. package/ts/array_plus/array_plus.ts +0 -66
  970. package/ts/array_plus/create_tuple.ts +0 -16
  971. package/ts/array_plus/drop.ts +0 -71
  972. package/ts/array_plus/filter.ts +0 -28
  973. package/ts/array_plus/index.ts +0 -19
  974. package/ts/array_plus/is_array.ts +0 -1
  975. package/ts/array_plus/pad_left.ts +0 -16
  976. package/ts/array_plus/some.ts +0 -33
  977. package/ts/assertion/assertType.ts +0 -107
  978. package/ts/assertion/index.ts +0 -1
  979. package/ts/function/ExtractFunction.ts +0 -20
  980. package/ts/function/index.ts +0 -2
  981. package/ts/nominal-types/Brand.ts +0 -34
  982. package/ts/nominal-types/Flavor.ts +0 -35
  983. package/ts/nominal-types/index.ts +0 -3
  984. package/ts/nominal-types/nominalMatch.ts +0 -22
  985. package/ts/number_plus/index.ts +0 -1
  986. package/ts/number_plus/number.ts +0 -149
  987. package/ts/number_plus/number_plus.ts +0 -1
  988. package/ts/predicates/Equal.ts +0 -43
  989. package/ts/testing/index.ts +0 -1
  990. package/ts/tuple/index.ts +0 -1
  991. package/ts/tuple/tuple.ts +0 -20
  992. /package/cjs/{array_plus → array}/array.js +0 -0
  993. /package/cjs/{array_plus → array}/array_plus.js +0 -0
  994. /package/cjs/{array_plus → array}/common_prop_keys.d.ts +0 -0
  995. /package/cjs/{array_plus → array}/common_prop_keys.js +0 -0
  996. /package/cjs/{array_plus → array}/create_tuple.js +0 -0
  997. /package/cjs/{array_plus → array}/drop.js +0 -0
  998. /package/cjs/{array_plus → array}/filter.js +0 -0
  999. /package/cjs/{array_plus → array}/find_first.d.ts +0 -0
  1000. /package/cjs/{array_plus → array}/find_first.js +0 -0
  1001. /package/cjs/{array_plus → array}/find_last.d.ts +0 -0
  1002. /package/cjs/{array_plus → array}/find_last.js +0 -0
  1003. /package/cjs/{array_plus → array}/head.d.ts +0 -0
  1004. /package/cjs/{array_plus → array}/head.js +0 -0
  1005. /package/cjs/{array_plus → array}/intersect_of_props.d.ts +0 -0
  1006. /package/cjs/{array_plus → array}/intersect_of_props.js +0 -0
  1007. /package/cjs/{array_plus → array}/last.d.ts +0 -0
  1008. /package/cjs/{array_plus → array}/last.js +0 -0
  1009. /package/cjs/{array_plus → array}/literal_array.d.ts +0 -0
  1010. /package/cjs/{array_plus → array}/literal_array.js +0 -0
  1011. /package/cjs/{array_plus → array}/pad_left.js +0 -0
  1012. /package/cjs/{array_plus → array}/reduce_while.d.ts +0 -0
  1013. /package/cjs/{array_plus → array}/reduce_while.js +0 -0
  1014. /package/cjs/{array_plus → array}/reverse.d.ts +0 -0
  1015. /package/cjs/{array_plus → array}/reverse.js +0 -0
  1016. /package/cjs/{array_plus → array}/some.js +0 -0
  1017. /package/cjs/{array_plus → array}/tail.d.ts +0 -0
  1018. /package/cjs/{array_plus → array}/tail.js +0 -0
  1019. /package/cjs/{array_plus → array}/union_of_props.d.ts +0 -0
  1020. /package/cjs/{array_plus → array}/union_of_props.js +0 -0
  1021. /package/cjs/{array_plus → array}/union_of_values.d.ts +0 -0
  1022. /package/cjs/{array_plus → array}/union_of_values.js +0 -0
  1023. /package/cjs/{number_plus → number}/number_plus.js +0 -0
  1024. /package/esm/{array_plus → array}/array.js +0 -0
  1025. /package/esm/{array_plus → array}/array_plus.js +0 -0
  1026. /package/esm/{array_plus → array}/common_prop_keys.d.ts +0 -0
  1027. /package/esm/{array_plus → array}/common_prop_keys.js +0 -0
  1028. /package/esm/{array_plus → array}/create_tuple.js +0 -0
  1029. /package/esm/{array_plus → array}/drop.js +0 -0
  1030. /package/esm/{array_plus → array}/filter.js +0 -0
  1031. /package/esm/{array_plus → array}/find_first.d.ts +0 -0
  1032. /package/esm/{array_plus → array}/find_first.js +0 -0
  1033. /package/esm/{array_plus → array}/find_last.d.ts +0 -0
  1034. /package/esm/{array_plus → array}/find_last.js +0 -0
  1035. /package/esm/{array_plus → array}/head.d.ts +0 -0
  1036. /package/esm/{array_plus → array}/head.js +0 -0
  1037. /package/esm/{array_plus → array}/intersect_of_props.d.ts +0 -0
  1038. /package/esm/{array_plus → array}/intersect_of_props.js +0 -0
  1039. /package/esm/{array_plus → array}/last.d.ts +0 -0
  1040. /package/esm/{array_plus → array}/last.js +0 -0
  1041. /package/esm/{array_plus → array}/literal_array.d.ts +0 -0
  1042. /package/esm/{array_plus → array}/literal_array.js +0 -0
  1043. /package/esm/{array_plus → array}/pad_left.js +0 -0
  1044. /package/esm/{array_plus → array}/reduce_while.d.ts +0 -0
  1045. /package/esm/{array_plus → array}/reduce_while.js +0 -0
  1046. /package/esm/{array_plus → array}/reverse.d.ts +0 -0
  1047. /package/esm/{array_plus → array}/reverse.js +0 -0
  1048. /package/esm/{array_plus → array}/some.js +0 -0
  1049. /package/esm/{array_plus → array}/tail.d.ts +0 -0
  1050. /package/esm/{array_plus → array}/tail.js +0 -0
  1051. /package/esm/{array_plus → array}/union_of_props.d.ts +0 -0
  1052. /package/esm/{array_plus → array}/union_of_props.js +0 -0
  1053. /package/esm/{array_plus → array}/union_of_values.d.ts +0 -0
  1054. /package/esm/{array_plus → array}/union_of_values.js +0 -0
  1055. /package/esm/{number_plus → number}/number_plus.js +0 -0
  1056. /package/ts/{array_plus → array}/common_prop_keys.ts +0 -0
  1057. /package/ts/{array_plus → array}/find_first.ts +0 -0
  1058. /package/ts/{array_plus → array}/find_last.ts +0 -0
  1059. /package/ts/{array_plus → array}/head.ts +0 -0
  1060. /package/ts/{array_plus → array}/intersect_of_props.ts +0 -0
  1061. /package/ts/{array_plus → array}/last.ts +0 -0
  1062. /package/ts/{array_plus → array}/literal_array.ts +0 -0
  1063. /package/ts/{array_plus → array}/reduce_while.ts +0 -0
  1064. /package/ts/{array_plus → array}/reverse.ts +0 -0
  1065. /package/ts/{array_plus → array}/tail.ts +0 -0
  1066. /package/ts/{array_plus → array}/union_of_props.ts +0 -0
  1067. /package/ts/{array_plus → array}/union_of_values.ts +0 -0
  1068. /package/ts/function/{AnyFunction.ts → any_function.ts} +0 -0
  1069. /package/ts/{JSONTypes.ts → json.ts} +0 -0
  1070. /package/ts/{nominal-types/types.ts → nominal/constants.ts} +0 -0
  1071. /package/ts/{UnionToIntersection.ts → union/union_to_intersection.ts} +0 -0
  1072. /package/ts/{UnionKeys.ts → union_keys.ts} +0 -0
@@ -0,0 +1,84 @@
1
+ # Function
2
+
3
+ `Function` is a type to represent functions.
4
+
5
+ ## Type Checking
6
+
7
+ The `FunctionType<T>` and friends are used to check if a type is `Function` or not.
8
+
9
+ They are loose type checks, meaning they match `Function` and function signatures,
10
+ function overloads, as well as intersection types.
11
+
12
+ ```ts
13
+ import type { FunctionType } from 'type-plus'
14
+
15
+ type R = FunctionType<Function> // Function
16
+ type R = FunctionType<() => void> // () => void
17
+ type R = FunctionType<(() => void) | { a: 1 }> // (() => void) | { a: 1 }
18
+
19
+ type R = FunctionType<{ a: 1 }> // never
20
+ type R = FunctionType<never> // never
21
+ type R = FunctionType<unknown> // never
22
+ ```
23
+
24
+ - [`FunctionType<T, Then = T, Else = never>`](function_type.ts#L18): check if `T` is `Function` or Function literal.
25
+ - [`IsFunction<T, Then = true, Else = false`](function_type.ts#L39): is `T` `Function`.
26
+ - [`NotFunctionType<T, Then = T, Else = never>`](function_type.ts#L56): check if `T` is not `Function`.
27
+ - [`IsNotFunction<T, Then = true, Else = false>`](function_type.ts#L72): is `T` not `Function`.
28
+
29
+ ---
30
+
31
+ The `StrictFunctionType<T>` and friends are used to check if a type is exactly `Function` or not.
32
+
33
+ They are strict type checks, meaning they match only the type `Function` only.
34
+
35
+ ```ts
36
+ import type { StrictFunctionType } from 'type-plus'
37
+
38
+ * type R = StrictFunctionType<Function> // Function
39
+ *
40
+ * type R = StrictFunctionType<() => void> // never
41
+ * type R = StrictFunctionType<Function & { a: 1 }> // never
42
+ ```
43
+
44
+ - [`StrictFunctionType<T, Then = T, Else = never>`](strict_function_type.ts#L15): check if `T` is exactly `Function`.
45
+ - [`IsStrictFunction<T, Then = true, Else = false`](strict_function_type.ts#L33): is `T` exactly `Function`.
46
+ - [`NotStrictFunctionType<T, Then = T, Else = never>`](strict_function_type.ts#L47): check if `T` is not exactly `Function`.
47
+ - [`IsNotStrictFunction<T, Then = true, Else = false>`](strict_function_type.ts#L61): is `T` not exactly `Function`.
48
+
49
+ ---
50
+
51
+ `AnyFunction` is a type to represent any function.
52
+
53
+ You can also use it to build specific signatures.
54
+
55
+ ```ts
56
+ import type { AnyFunction } from 'type-plus'
57
+
58
+ type R = AnyFunction // (...args: any[]) => any
59
+ type R = AnyFunction<[a: string, b: number], boolean> // (a: string, b: number) => boolean
60
+ ```
61
+
62
+ ---
63
+
64
+ `ExtractFunction<T>` extracts the function type from a type.
65
+ Note that it does not work with function overloads.
66
+
67
+ ```ts
68
+ import type { ExtractFunction } from 'type-plus'
69
+
70
+ type R = ExtractFunction<{
71
+ () => void
72
+ a: 1
73
+ }> // () => void
74
+ ```
75
+
76
+ ---
77
+
78
+ `extractFunction` is the function form of `ExtractFunction<T>`.
79
+
80
+ ## References
81
+
82
+ - [mdn web docs: BigInt][mdn]
83
+
84
+ [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt
@@ -0,0 +1,61 @@
1
+ import type { IsAnyOrNever } from '../any/any_or_never.js'
2
+
3
+ /**
4
+ * Check if `T` is exactly `Function`.
5
+ *
6
+ * ```ts
7
+ * import type { StrictFunctionType } from 'type-plus'
8
+ *
9
+ * type R = StrictFunctionType<Function> // Function
10
+ *
11
+ * type R = StrictFunctionType<() => void> // never
12
+ * type R = StrictFunctionType<Function & { a: 1 }> // never
13
+ * ```
14
+ */
15
+ export type StrictFunctionType<T, Then = T, Else = never> = IsAnyOrNever<
16
+ T,
17
+ Else,
18
+ [T, Function] extends [Function, T] ? Then : Else
19
+ >
20
+
21
+ /**
22
+ * Check if `T` is not exactly `Function`.
23
+ *
24
+ * ```ts
25
+ * import type { NotStrictFunctionType } from 'type-plus'
26
+ *
27
+ * type R = NotStrictFunctionType<Function> // never
28
+ * type R = NotStrictFunctionType<() => void> // () => void
29
+ *
30
+ * type R = NotStrictFunctionType<Function & { a: 1 }> // Function & { a: 1 }
31
+ * ```
32
+ */
33
+ export type NotStrictFunctionType<T, Then = T, Else = never> = StrictFunctionType<T, Else, Then>
34
+
35
+ /**
36
+ * Is `T` exactly `Function`.
37
+ *
38
+ * ```ts
39
+ * import type { IsStrictFunction } from 'type-plus'
40
+ *
41
+ * type R = IsStrictFunction<Function> // true
42
+ *
43
+ * type R = IsStrictFunction<() => void> // false
44
+ * type R = IsStrictFunction<(() => void) & { a: 1 }> // false
45
+ * ```
46
+ */
47
+ export type IsStrictFunction<T, Then = true, Else = false> = StrictFunctionType<T, Then, Else>
48
+
49
+ /**
50
+ * Is `T` not exactly `Function`.
51
+ *
52
+ * ```ts
53
+ * import type { IsNotStrictFunction } from 'type-plus'
54
+ *
55
+ * type R = IsNotStrictFunction<Function> // false
56
+ *
57
+ * type R = IsNotStrictFunction<() => void> // true
58
+ * type R = IsNotStrictFunction<(() => void) & { a: 1 }> // true
59
+ * ```
60
+ */
61
+ export type IsNotStrictFunction<T, Then = true, Else = false> = StrictFunctionType<T, Else, Then>
@@ -1,5 +1,5 @@
1
- import type { Brand } from '../nominal-types/index.js'
2
- import type { Equal } from '../predicates/index.js'
1
+ import type { Brand } from '../nominal/index.js'
2
+ import type { Equal } from '../equal/equal.js'
3
3
  import type { Widen } from '../utils/index.js'
4
4
 
5
5
  export type Maybe<T> = Just<T> | None<T>
@@ -1,5 +1,5 @@
1
- import type { Head, Last } from '../array_plus/index.js'
2
- import type { AnyFunction } from '../function/AnyFunction.js'
1
+ import type { Head, Last } from '../array/index.js'
2
+ import type { AnyFunction } from '../function/any_function.js'
3
3
 
4
4
  /**
5
5
  * Compose functions to produce a new function.
package/ts/index.ts CHANGED
@@ -1,27 +1,100 @@
1
- // import * as types from './types/index.js'
2
1
  export { required, requiredDeep, unpartial } from 'unpartial'
3
- export type { ComposableTypes, NonComposableTypes } from './ComposableTypes.js'
4
- export type { JSONArray, JSONObject, JSONPrimitive, JSONTypes } from './JSONTypes.js'
5
- export type { IsNever, PrimitiveTypes } from './PrimitiveTypes.js'
6
- // export * from './types/optional.js'
7
- // export * from './types/required.js'
8
- export type { UnionKeys } from './UnionKeys.js'
9
- export * from './any_plus/index.js'
10
- export * as ArrayPlus from './array_plus/array_plus.js'
11
- export * from './array_plus/index.js'
12
- export * from './assertion/index.js'
2
+ export type { IsAnyOrNever } from './any/any_or_never.js'
3
+ export type { AnyType, IsAny, IsNotAny, NotAnyType } from './any/any_type.js'
4
+ export type { At, Concat } from './array/array.js'
5
+ export * as ArrayPlus from './array/array_plus.js'
6
+ export type { ArrayType, IsArray, IsNotArray, NotArrayType } from './array/array_type.js'
7
+ export * from './array/index.js'
8
+ export * from './assertion/assert_type.js'
9
+ export type { BigintType, IsBigint, IsNotBigint, NotBigintType } from './bigint/bigint_type.js'
10
+ export type {
11
+ IsNotStrictBigint,
12
+ IsStrictBigint,
13
+ NotStrictBigintType,
14
+ StrictBigintType
15
+ } from './bigint/strict_bigint_type.js'
16
+ export type { BooleanType, IsBoolean, IsNotBoolean, NotBooleanType } from './boolean/boolean_type.js'
17
+ export type { FalseType, IsFalse, IsNotFalse, NotFalseType } from './boolean/false_type.js'
18
+ export type {
19
+ IsNotStrictBoolean,
20
+ IsStrictBoolean,
21
+ NotStrictBooleanType,
22
+ StrictBooleanType
23
+ } from './boolean/strict_boolean_type.js'
24
+ export type { IsNotTrue, IsTrue, NotTrueType, TrueType } from './boolean/true_type.js'
13
25
  export * from './class/index.js'
14
- export * from './function/index.js'
26
+ export type { ComposableTypes, NonComposableTypes } from './composable_types.js'
27
+ export type { Equal, NotEqual } from './equal/equal.js'
28
+ export type { AnyFunction } from './function/any_function.js'
29
+ export * from './function/extract_function.js'
30
+ export type { FunctionType, IsFunction, IsNotFunction, NotFunctionType } from './function/function_type.js'
31
+ export type {
32
+ IsNotStrictFunction,
33
+ IsStrictFunction,
34
+ NotStrictFunctionType,
35
+ StrictFunctionType
36
+ } from './function/strict_function_type.js'
15
37
  export * from './functional/index.js'
16
- export type * from './math/index.js'
38
+ export type { JSONArray, JSONObject, JSONPrimitive, JSONTypes } from './json.js'
39
+ export type {
40
+ Abs,
41
+ Add,
42
+ Decrement,
43
+ Digit,
44
+ DigitArray,
45
+ GreaterThan,
46
+ Increment,
47
+ Max,
48
+ Subtract
49
+ } from './math/index.js'
50
+ export type { IsNever, IsNotNever, Is_Never, NeverType, NotNeverType, Not_Never } from './never/never_type.js'
17
51
  export * from './nodejs/index.js'
18
- export * from './nominal-types/index.js'
19
- export * from './number_plus/index.js'
20
- export * as NumberPlus from './number_plus/number_plus.js'
52
+ export * from './nominal/index.js'
53
+ export type { IsNotNull, IsNull, NotNullType, NullType } from './null/null_type.js'
54
+ export type { Integer, IsInteger, IsNotInteger, IsWhole, NotInteger } from './number/integer.js'
55
+ export type { IsNegative, IsNotNegative, Negative, NotNegative } from './number/negative.js'
56
+ export * as NumberPlus from './number/number_plus.js'
57
+ export type { IsNotNumber, IsNumber, NotNumberType, NumberType } from './number/number_type.js'
58
+ export type {
59
+ IsNotNumeric,
60
+ IsNumeric,
61
+ NotNumericType,
62
+ Numeric,
63
+ NumericType,
64
+ Zero
65
+ } from './number/numeric_type.js'
66
+ export type { IsNotPositive, IsPositive, NonPositive, Positive } from './number/positive.js'
67
+ export type {
68
+ IsNotStrictNumber,
69
+ IsStrictNumber,
70
+ NotStrictNumberType,
71
+ StrictNumberType
72
+ } from './number/strict_number_type.js'
21
73
  export * from './object/index.js'
74
+ export type { IsNotObject, IsObject, NotObjectType, ObjectType } from './object/object_type.js'
22
75
  export * from './predicates/index.js'
76
+ export type { PrimitiveTypes } from './primitive.js'
23
77
  export * from './promise/index.js'
24
- export * from './testing/index.js'
25
- export * from './tuple/index.js'
78
+ export type {
79
+ IsNotStrictString,
80
+ IsStrictString,
81
+ NotStrictStringType,
82
+ StrictStringType
83
+ } from './string/strict_string_type.js'
84
+ export type { IsNotString, IsString, NotStringType, StringType } from './string/string_type.js'
85
+ export type { IsNotSymbol, IsSymbol, NotSymbolType, SymbolType } from './symbol/symbol_type.js'
86
+ export * from './testing/stub.js'
87
+ export * from './testing/test_type.js'
88
+ export type { IsNotTuple, IsTuple, NotTupleType, TupleType } from './tuple/tuple_type.js'
89
+ export type { Failed, FailedT } from './type/failed.js'
90
+ export type {
91
+ IsNotUndefined,
92
+ IsUndefined,
93
+ NotUndefinedType,
94
+ UndefinedType
95
+ } from './undefined/undefined_type.js'
96
+ export type { UnionKeys } from './union_keys.js'
97
+ export type { IsNotUnknown, IsUnknown, NotUnknownType, UnknownType } from './unknown/unknown_type.js'
26
98
  export * from './utils/index.js'
27
- // export { types, types as T }
99
+ export type { IsNotVoid, IsVoid, NotVoidType, VoidType } from './void/void_type.js'
100
+
package/ts/math/Add.ts CHANGED
@@ -1,6 +1,7 @@
1
- import type { PadLeft } from '../array_plus/index.js'
1
+ import type { PadLeft } from '../array/index.js'
2
+ import type { IsInteger } from '../number/integer.js'
3
+ import type { IsPositive } from '../number/positive.js'
2
4
  import type { And } from '../predicates/index.js'
3
- import type { IsPositive, IsWhole } from '../number_plus/number.js'
4
5
  import type { Digit, DigitArray } from './Digit.js'
5
6
  import type { Max } from './Max.js'
6
7
 
@@ -8,8 +9,8 @@ import type { Max } from './Max.js'
8
9
  * Add two number literals.
9
10
  */
10
11
  export type Add<A extends number, B extends number, Fail = never> = And<
11
- And<IsPositive<A>, IsWhole<A>>,
12
- And<IsPositive<B>, IsWhole<B>>
12
+ And<IsPositive<A>, IsInteger<A>>,
13
+ And<IsPositive<B>, IsInteger<B>>
13
14
  > extends false
14
15
  ? Fail
15
16
  : DigitArray.FromNumber<A> extends infer DA
package/ts/math/Digit.ts CHANGED
@@ -1,5 +1,6 @@
1
- import type { Tail } from '../array_plus/index.js'
2
- import type { IsPositive, IsWhole } from '../number_plus/number.js'
1
+ import type { Tail } from '../array/tail.js'
2
+ import type { IsInteger } from '../number/integer.js'
3
+ import type { IsPositive } from '../number/positive.js'
3
4
  import type { And } from '../predicates/index.js'
4
5
 
5
6
  export namespace Digit {
@@ -66,7 +67,7 @@ export namespace DigitArray {
66
67
  export type FromNumberAbs<N extends number> = FromString<TrimMinusSign<`${N}`>>
67
68
  export type TrimMinusSign<N extends string> = N extends `-${infer rest}` ? rest : N
68
69
 
69
- export type NumberToString<N extends number> = And<IsPositive<N>, IsWhole<N>> extends true ? `${N}` : never
70
+ export type NumberToString<N extends number> = And<IsPositive<N>, IsInteger<N>> extends true ? `${N}` : never
70
71
 
71
72
  export type FromString<S extends string> = S extends `1${infer L}`
72
73
  ? [1, ...FromString<L>]
@@ -1,12 +1,14 @@
1
- import type { Head, PadLeft, Tail } from '../array_plus/index.js'
2
- import type { IsPositive, IsWhole } from '../number_plus/number.js'
3
- import type { And, Equal, Or, Xor } from '../predicates/index.js'
1
+ import type { Head, PadLeft, Tail } from '../array/index.js'
2
+ import type { Equal } from '../equal/equal.js'
3
+ import type { IsInteger } from '../number/integer.js'
4
+ import type { IsPositive } from '../number/positive.js'
5
+ import type { And, Or, Xor } from '../predicates/index.js'
4
6
  import type { Digit, DigitArray } from './Digit.js'
5
7
  import type { Max } from './Max.js'
6
8
 
7
9
  export type GreaterThan<A extends number, B extends number, Fail = never> = And<
8
- IsWhole<A>,
9
- IsWhole<B>
10
+ IsInteger<A>,
11
+ IsInteger<B>
10
12
  > extends false
11
13
  ? Fail
12
14
  : number extends A
package/ts/math/Max.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Equal } from '../predicates/index.js'
1
+ import { Equal } from '../equal/equal.js'
2
2
  import type { GreaterThan } from './GreaterThan.js'
3
3
 
4
4
  export type Max<A extends number, B extends number, Fail = never> = GreaterThan<A, B> extends infer Result
@@ -1,13 +1,13 @@
1
- import type { PadLeft, Some, Tail } from '../array_plus/index.js'
1
+ import type { PadLeft, Some, Tail } from '../array/index.js'
2
+ import type { IsInteger } from '../number/integer.js'
3
+ import type { IsPositive } from '../number/positive.js'
2
4
  import type { And } from '../predicates/index.js'
3
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
4
- import type { IsPositive, IsWhole } from '../number_plus/number.js'
5
5
  import type { Digit, DigitArray } from './Digit.js'
6
6
  import type { Max } from './Max.js'
7
7
 
8
8
  export type Subtract<A extends number, B extends number, Fail = never> = And<
9
- And<IsPositive<A>, IsWhole<A>>,
10
- And<IsPositive<B>, IsWhole<B>>
9
+ And<IsPositive<A>, IsInteger<A>>,
10
+ And<IsPositive<B>, IsInteger<B>>
11
11
  > extends true
12
12
  ? DigitArray.Shift10<DigitArray.FromNumber<A>> extends infer DA
13
13
  ? DA extends number[]
@@ -0,0 +1,65 @@
1
+ import type { Brand } from '../nominal/brand.js'
2
+
3
+
4
+ /**
5
+ * This is a unique type used in the `Else` branch of `NeverType`.
6
+ */
7
+ export type Not_Never = Brand<'not_never', symbol>
8
+
9
+ /**
10
+ * This is a unique type used in the `Else` branch of `NotNeverType`.
11
+ */
12
+ export type Is_Never = Brand<'is_never', symbol>
13
+
14
+ /**
15
+ * Check if `T` is `never`.
16
+ * If it is not, returns `Not_Never`.
17
+ *
18
+ * ```ts
19
+ * import type { NeverType } from 'type-plus'
20
+ *
21
+ * type R = NeverType<never> // never
22
+ *
23
+ * type R = NeverType<1> // 'not never'
24
+ * ```
25
+ */
26
+ export type NeverType<T, Then = T, Else = Not_Never> = [T, never] extends [never, T] ? Then : Else
27
+
28
+ /**
29
+ * Check if `T` is not `never`.
30
+ * If it is not, returns `Is_Never`.
31
+ *
32
+ * ```ts
33
+ * import type { NotNeverType } from 'type-plus'
34
+ *
35
+ * type R = NotNeverType<1> // 1
36
+ *
37
+ * type R = NotNeverType<never> // 'is_never'
38
+ * ```
39
+ */
40
+ export type NotNeverType<T, Then = T, Else = Is_Never> = NeverType<T, Else, Then>
41
+
42
+ /**
43
+ * Is `T` `never`.
44
+ *
45
+ * ```
46
+ * import type { IsNever } from 'type-plus'
47
+ *
48
+ * type R = IsNever<never> // true
49
+ *
50
+ * type R = IsNever<1> // false
51
+ * ```
52
+ */
53
+ export type IsNever<T, Then = true, Else = false> = NeverType<T, Then, Else>
54
+
55
+ /**
56
+ * Is `T` not `never`.
57
+ *
58
+ * ```
59
+ * import type { IsNotNever } from 'type-plus'
60
+ *
61
+ * type R = IsNotNever<1> // true
62
+ *
63
+ * type R = IsNotNever<never> // false
64
+ */
65
+ export type IsNotNever<T, Then = true, Else = false> = NeverType<T, Else, Then>
@@ -0,0 +1,37 @@
1
+ # never
2
+
3
+ `never` is a bottom type in TypeScript.
4
+ That means it is a subtype of all other types.
5
+
6
+ ## Type Checking
7
+
8
+ The `NeverType<T>` and friends are used to check if a type is exactly `never`.
9
+
10
+ Filter normally returns `never` in the `Else` clause.
11
+ But since we are checking for `never` here,
12
+ they have to return something other than `never`.
13
+
14
+ Therefore, `NeverType<T>` will return the `Not_Never` symbol when `T` is not `never`,
15
+ and `NotNeverType<T>` will return the `Is_Never` symbol when `T` is `never`.
16
+
17
+ ```ts
18
+ import type { NeverType } from 'type-plus'
19
+
20
+ type R = NeverType<never> // never
21
+
22
+ type R = NeverType<true> // Not_Never
23
+ type R = NeverType<false> // Not_Never
24
+ ```
25
+
26
+ - [`NeverType<T, Then = T, Else = Not_Never>`](never_type.ts#L16): check if `T` is exactly `never`.
27
+ - [`IsNever<T, Then = true, Else = false`](never_type.ts#L50): is `T` exactly `never`.
28
+ - [`NotNeverType<T, Then = T, Else = Is_Never>`](never_type.ts#L35): check if `T` is not exactly `never`.
29
+ - [`IsNotNever<T, Then = true, Else = false>`](never_type.ts#L65): is `T` not exactly `never`.
30
+
31
+ ## References
32
+
33
+ - [Handbook]
34
+ - [TypeScript Deep Dive][deep_dive]
35
+
36
+ [deep_dive]: https://basarat.gitbook.io/typescript/type-system/never
37
+ [handbook]: https://www.typescriptlang.org/docs/handbook/2/functions.html#never
@@ -0,0 +1,43 @@
1
+ // By Drew Colthorp, <https://spin.atomicobject.com/2018/01/15/typescript-flexible-nominal-typing/#comment-604580>
2
+ // <https://gist.github.com/dcolthorp/aa21cf87d847ae9942106435bf47565d>
3
+
4
+ import { isType } from '../predicates/isType.js'
5
+ import type { Widen } from '../utils/index.js'
6
+ import { typeSym, valueSym } from './constants.js'
7
+
8
+ /**
9
+ * Create a "branded" version of a type.
10
+ * TypeScript won't allow implicit conversion to this type
11
+ */
12
+ export type Brand<B extends string, T = never> = [T] extends [null] | [undefined] | [symbol] | [void]
13
+ ? Branded<B, T>
14
+ : Branded<B, T> & T
15
+
16
+ /**
17
+ * A branded type of `B` with value of `T`.
18
+ */
19
+ export interface Branded<B extends string, T> {
20
+ [typeSym]: B
21
+ [valueSym]: T
22
+ }
23
+
24
+ /**
25
+ * Creates a brand creator with the specified type.
26
+ */
27
+ export function brand<B extends string>(type: B): <T>(subject: T) => Brand<B, Widen<T>>
28
+ /**
29
+ * Creates a branded value of specified type.
30
+ */
31
+ export function brand<B extends string, T>(type: B, subject: T): Brand<B, Widen<T>>
32
+ export function brand(typeInput: string, subject?: unknown) {
33
+ if (subject === undefined)
34
+ return function <T>(subject: T) {
35
+ return brand(typeInput, subject)
36
+ }
37
+
38
+ if (isType<{ [typeSym]: string }>(subject, s => typeof s === 'object' && s !== null)) {
39
+ // if subject is not an object, the branding will exist only in type-level.
40
+ subject[typeSym] = typeInput
41
+ }
42
+ return subject
43
+ }
@@ -0,0 +1,53 @@
1
+ // By Drew Colthorp, <https://spin.atomicobject.com/2018/01/15/typescript-flexible-nominal-typing/#comment-604580>
2
+ // <https://gist.github.com/dcolthorp/aa21cf87d847ae9942106435bf47565d>
3
+
4
+ import { isType } from '../predicates/isType.js'
5
+ import type { Widen } from '../utils/index.js'
6
+ import { typeSym, valueSym } from './constants.js'
7
+
8
+ /**
9
+ * Create a "flavored" version of a type.
10
+ * TypeScript will disallow mixing flavors,
11
+ * but will allow unflavored values of that type to be passed in where a flavored version is expected.
12
+ * This is a less restrictive form of branding.
13
+ */
14
+ export type Flavor<F extends string, T> = [T] extends [null] | [undefined] | [symbol] | [void]
15
+ ? FlavoredUnit<F, T>
16
+ : Flavored<F> & T
17
+
18
+ /**
19
+ * A flavored type of `F`
20
+ */
21
+ export interface Flavored<F extends string> {
22
+ [typeSym]?: F
23
+ }
24
+
25
+ /**
26
+ * A special flavored type for special types.
27
+ */
28
+ export interface FlavoredUnit<F extends string, T> {
29
+ [typeSym]?: F
30
+ [valueSym]: T
31
+ }
32
+
33
+ /**
34
+ * Creates a brand creator with the specified type.
35
+ */
36
+ export function flavor<F extends string>(type: F): <T>(subject: T) => Flavor<F, Widen<T>>
37
+ /**
38
+ * Creates a branded value of specified type.
39
+ */
40
+ export function flavor<F extends string, T>(type: F, subject: T): Flavor<F, Widen<T>>
41
+ export function flavor(type: string, subject?: unknown) {
42
+ if (subject === undefined)
43
+ return function <T>(subject: T) {
44
+ return flavor(type, subject)
45
+ }
46
+
47
+ if (isType<{ [typeSym]: string }>(subject, s => typeof s === 'object' && s !== null)) {
48
+ // if subject is not an object, the branding will exist only in type-level.
49
+ subject[typeSym] = type
50
+ }
51
+
52
+ return subject
53
+ }
@@ -0,0 +1,3 @@
1
+ export * from './brand.js'
2
+ export * from './flavor.js'
3
+ export * from './nominal_match.js'
@@ -0,0 +1,22 @@
1
+ import type { Brand } from './brand.js'
2
+ import type { Flavor } from './flavor.js'
3
+ import { typeSym } from './constants.js'
4
+
5
+ export function nominalMatch<A extends string, B extends A>(
6
+ a: Brand<A, unknown>,
7
+ b: Brand<B, unknown>
8
+ ): boolean
9
+ export function nominalMatch<A extends string, B extends A>(
10
+ a: Flavor<A, unknown>,
11
+ b: Flavor<B, unknown>
12
+ ): boolean
13
+ export function nominalMatch<A extends string, B extends A>(
14
+ a: Brand<A, unknown> | Flavor<A, unknown>,
15
+ b: Brand<B, unknown> | Flavor<B, unknown>
16
+ ) {
17
+ if (typeof a === 'object' && a !== null && typeof b === 'object' && b !== null)
18
+ return a[typeSym] === b[typeSym]
19
+ else {
20
+ return true
21
+ }
22
+ }
@@ -0,0 +1,61 @@
1
+ import type { IsAny } from '../any/any_type.js'
2
+
3
+ /**
4
+ * Check if the type `T` is exactly `null`.
5
+ *
6
+ * ```
7
+ * import type { NullType } from 'type-plus'
8
+ *
9
+ * type R = NullType<null> // null
10
+ *
11
+ * type R = NullType<never> // never
12
+ * type R = NullType<unknown> // never
13
+ * type R = NullType<string | boolean> // never
14
+ * ```
15
+ */
16
+ export type NullType<T, Then = T, Else = never> = IsAny<T, Else, [T, null] extends [null, T] ? Then : Else>
17
+
18
+ /**
19
+ * Is the type `T` exactly `null`.
20
+ *
21
+ * ```
22
+ * import type { IsNull } from 'type-plus'
23
+ *
24
+ * type R = IsNull<null> // true
25
+ *
26
+ * type R = IsNull<never> // false
27
+ * type R = IsNull<unknown> // false
28
+ * type R = IsNull<string | boolean> // false
29
+ * ```
30
+ */
31
+ export type IsNull<T, Then = true, Else = false> = NullType<T, Then, Else>
32
+
33
+ /**
34
+ * Check if the type `T` is not exactly `null`.
35
+ *
36
+ * ```
37
+ * import type { NotNullType } from 'type-plus'
38
+ *
39
+ * type R = NotNullType<null> // never
40
+ *
41
+ * type R = NotNullType<never> // never
42
+ * type R = NotNullType<unknown> // unknown
43
+ * type R = NotNullType<string | boolean> // string | boolean
44
+ * ```
45
+ */
46
+ export type NotNullType<T, Then = T, Else = never> = NullType<T, Else, Then>
47
+
48
+ /**
49
+ * Is the type `T` not exactly `null`.
50
+ *
51
+ * ```
52
+ * import type { IsNotNull } from 'type-plus'
53
+ *
54
+ * type R = IsNotNull<null> // false
55
+ *
56
+ * type R = IsNotNull<never> // true
57
+ * type R = IsNotNull<unknown> // true
58
+ * type R = IsNotNull<string | boolean> // true
59
+ * ```
60
+ */
61
+ export type IsNotNull<T, Then = true, Else = false> = NullType<T, Else, Then>