type-plus 8.0.0-beta.2 → 8.0.0-beta.3

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 (395) hide show
  1. package/esm/any/is_any.d.ts.map +1 -1
  2. package/esm/any/is_not_any.d.ts.map +1 -1
  3. package/esm/array/array.at.d.ts.map +1 -1
  4. package/esm/array/array.entries.d.ts +1 -1
  5. package/esm/array/array.entries.d.ts.map +1 -1
  6. package/esm/array/array.find_last.d.ts +1 -1
  7. package/esm/array/array.find_last.d.ts.map +1 -1
  8. package/esm/array/array.reverse.d.ts.map +1 -1
  9. package/esm/array/array.some.d.ts +2 -2
  10. package/esm/array/array.some.d.ts.map +1 -1
  11. package/esm/array/array_plus.common_prop_keys.d.ts.map +1 -1
  12. package/esm/array/array_plus.drop_match.d.ts +1 -1
  13. package/esm/array/array_plus.drop_match.d.ts.map +1 -1
  14. package/esm/array/array_plus.element_match.d.ts +4 -2
  15. package/esm/array/array_plus.element_match.d.ts.map +1 -1
  16. package/esm/array/array_plus.filter.d.ts +4 -4
  17. package/esm/array/array_plus.filter.d.ts.map +1 -1
  18. package/esm/array/array_plus.find.d.ts +1 -1
  19. package/esm/array/array_plus.find.d.ts.map +1 -1
  20. package/esm/array/array_plus.index_at.d.ts.map +1 -1
  21. package/esm/array/array_plus.index_at.js.map +1 -1
  22. package/esm/array/array_plus.is_index_out_of_bound.d.ts.map +1 -1
  23. package/esm/array/array_plus.is_readonly.d.ts.map +1 -1
  24. package/esm/array/array_plus.pad_start.d.ts.map +1 -1
  25. package/esm/array/array_plus.split_at.d.ts +4 -4
  26. package/esm/array/array_plus.split_at.d.ts.map +1 -1
  27. package/esm/array/find_first.d.ts.map +1 -1
  28. package/esm/array/head.d.ts.map +1 -1
  29. package/esm/array/intersect_of_props.d.ts.map +1 -1
  30. package/esm/array/is_array.d.ts +2 -2
  31. package/esm/array/is_array.d.ts.map +1 -1
  32. package/esm/array/is_not_array.d.ts +2 -2
  33. package/esm/array/is_not_array.d.ts.map +1 -1
  34. package/esm/array/last.d.ts.map +1 -1
  35. package/esm/array/loose_array_type.d.ts.map +1 -1
  36. package/esm/array/pad_start.d.ts.map +1 -1
  37. package/esm/array/reverse.d.ts.map +1 -1
  38. package/esm/array/union_of_props.d.ts.map +1 -1
  39. package/esm/assertion/assert_type.js +6 -5
  40. package/esm/assertion/assert_type.js.map +1 -1
  41. package/esm/bigint/cast.d.ts.map +1 -1
  42. package/esm/bigint/is_bigint.d.ts +2 -4
  43. package/esm/bigint/is_bigint.d.ts.map +1 -1
  44. package/esm/bigint/is_bigint_literal.d.ts +2 -4
  45. package/esm/bigint/is_bigint_literal.d.ts.map +1 -1
  46. package/esm/bigint/is_not_bigint.d.ts +2 -4
  47. package/esm/bigint/is_not_bigint.d.ts.map +1 -1
  48. package/esm/bigint/is_not_bigint_literal.d.ts +2 -4
  49. package/esm/bigint/is_not_bigint_literal.d.ts.map +1 -1
  50. package/esm/boolean/is_boolean.d.ts +2 -8
  51. package/esm/boolean/is_boolean.d.ts.map +1 -1
  52. package/esm/boolean/is_false.d.ts.map +1 -1
  53. package/esm/boolean/is_not_boolean.d.ts +2 -8
  54. package/esm/boolean/is_not_boolean.d.ts.map +1 -1
  55. package/esm/boolean/is_not_false.d.ts.map +1 -1
  56. package/esm/boolean/is_not_true.d.ts.map +1 -1
  57. package/esm/boolean/is_true.d.ts.map +1 -1
  58. package/esm/class/isConstructor.js +1 -0
  59. package/esm/class/isConstructor.js.map +1 -1
  60. package/esm/equal/equal.d.ts.map +1 -1
  61. package/esm/equal/identity_equal.d.ts +1 -1
  62. package/esm/equal/identity_equal.d.ts.map +1 -1
  63. package/esm/function/extract_function.d.ts.map +1 -1
  64. package/esm/function/extract_function.js.map +1 -1
  65. package/esm/function/is_not_strict_function.d.ts +1 -1
  66. package/esm/function/is_not_strict_function.d.ts.map +1 -1
  67. package/esm/function/is_strict_function.d.ts.map +1 -1
  68. package/esm/functional/Maybe.d.ts.map +1 -1
  69. package/esm/functional/Maybe.js.map +1 -1
  70. package/esm/functional/compose.d.ts.map +1 -1
  71. package/esm/functional/compose.js.map +1 -1
  72. package/esm/functional/context.d.ts.map +1 -1
  73. package/esm/math/abs.d.ts.map +1 -1
  74. package/esm/math/math_plus.to_negative.d.ts.map +1 -1
  75. package/esm/math/max.d.ts.map +1 -1
  76. package/esm/math/numeric_struct.d.ts.map +1 -1
  77. package/esm/mix_types/box.d.ts.map +1 -1
  78. package/esm/mix_types/is_any_or_never.d.ts.map +1 -1
  79. package/esm/mix_types/merge.d.ts +9 -9
  80. package/esm/mix_types/merge.d.ts.map +1 -1
  81. package/esm/mix_types/merge.js +9 -9
  82. package/esm/mix_types/merge.js.map +1 -1
  83. package/esm/never/is_never.d.ts.map +1 -1
  84. package/esm/never/is_not_never.d.ts.map +1 -1
  85. package/esm/nodejs/isNodeError.d.ts.map +1 -1
  86. package/esm/nominal/brand.d.ts.map +1 -1
  87. package/esm/nominal/brand.js +1 -1
  88. package/esm/nominal/brand.js.map +1 -1
  89. package/esm/nominal/flavor.d.ts.map +1 -1
  90. package/esm/nominal/flavor.js +1 -1
  91. package/esm/nominal/flavor.js.map +1 -1
  92. package/esm/nominal/nominal_match.d.ts.map +1 -1
  93. package/esm/nominal/nominal_match.js.map +1 -1
  94. package/esm/null/is_not_null.d.ts.map +1 -1
  95. package/esm/null/is_null.d.ts.map +1 -1
  96. package/esm/number/cast.d.ts.map +1 -1
  97. package/esm/number/is_not_number.d.ts +2 -4
  98. package/esm/number/is_not_number.d.ts.map +1 -1
  99. package/esm/number/is_not_number_literal.d.ts +2 -4
  100. package/esm/number/is_not_number_literal.d.ts.map +1 -1
  101. package/esm/number/is_number.d.ts +2 -4
  102. package/esm/number/is_number.d.ts.map +1 -1
  103. package/esm/number/is_number_literal.d.ts +2 -4
  104. package/esm/number/is_number_literal.d.ts.map +1 -1
  105. package/esm/numeric/is_integer.d.ts +2 -2
  106. package/esm/numeric/is_integer.d.ts.map +1 -1
  107. package/esm/numeric/is_negative.d.ts +5 -5
  108. package/esm/numeric/is_negative.d.ts.map +1 -1
  109. package/esm/numeric/is_not_integer.d.ts +2 -2
  110. package/esm/numeric/is_not_integer.d.ts.map +1 -1
  111. package/esm/numeric/is_not_negative.d.ts +3 -3
  112. package/esm/numeric/is_not_negative.d.ts.map +1 -1
  113. package/esm/numeric/is_not_positive.d.ts +3 -3
  114. package/esm/numeric/is_not_positive.d.ts.map +1 -1
  115. package/esm/numeric/is_positive.d.ts +3 -3
  116. package/esm/numeric/is_positive.d.ts.map +1 -1
  117. package/esm/numeric/numeric_type.d.ts.map +1 -1
  118. package/esm/object/ANotB.d.ts.map +1 -1
  119. package/esm/object/IsDisjoint.d.ts.map +1 -1
  120. package/esm/object/KeysWithDiffType.d.ts.map +1 -1
  121. package/esm/object/KnownKeys.d.ts.map +1 -1
  122. package/esm/object/RecursiveIntersect.d.ts +1 -1
  123. package/esm/object/RecursiveIntersect.d.ts.map +1 -1
  124. package/esm/object/RecursiveRequired.d.ts.map +1 -1
  125. package/esm/object/SpreadRecord.d.ts.map +1 -1
  126. package/esm/object/facade.d.ts.map +1 -1
  127. package/esm/object/facade.js.map +1 -1
  128. package/esm/object/getField.d.ts.map +1 -1
  129. package/esm/object/getField.js.map +1 -1
  130. package/esm/object/hasKey.js +1 -1
  131. package/esm/object/hasKey.js.map +1 -1
  132. package/esm/object/is_not_object.d.ts +1 -3
  133. package/esm/object/is_not_object.d.ts.map +1 -1
  134. package/esm/object/is_object.d.ts.map +1 -1
  135. package/esm/object/left_join.d.ts.map +1 -1
  136. package/esm/object/merge.d.ts +6 -5
  137. package/esm/object/merge.d.ts.map +1 -1
  138. package/esm/object/omit.d.ts +7 -0
  139. package/esm/object/omit.d.ts.map +1 -1
  140. package/esm/object/omit.js.map +1 -1
  141. package/esm/object/optional_key.d.ts.map +1 -1
  142. package/esm/object/pick.d.ts.map +1 -1
  143. package/esm/object/pick.js.map +1 -1
  144. package/esm/object/recursive_partial.d.ts.map +1 -1
  145. package/esm/object/split.d.ts +1 -7
  146. package/esm/object/split.d.ts.map +1 -1
  147. package/esm/object/split.js +1 -1
  148. package/esm/object/split.js.map +1 -1
  149. package/esm/object/typeOverrideIncompatible.js.map +1 -1
  150. package/esm/predicates/CanAssign.d.ts.map +1 -1
  151. package/esm/predicates/CanAssign.js.map +1 -1
  152. package/esm/predicates/assignable.d.ts.map +1 -1
  153. package/esm/predicates/literal.d.ts.map +1 -1
  154. package/esm/predicates/logical.d.ts.map +1 -1
  155. package/esm/predicates/not_assignable.d.ts.map +1 -1
  156. package/esm/primitive.d.ts.map +1 -1
  157. package/esm/promise/index.d.ts.map +1 -1
  158. package/esm/promise/mapSeries.js +1 -1
  159. package/esm/promise/mapSeries.js.map +1 -1
  160. package/esm/string/$extract_manipulated_string.d.ts +5 -5
  161. package/esm/string/$extract_manipulated_string.d.ts.map +1 -1
  162. package/esm/string/_string_type.d.ts.map +1 -1
  163. package/esm/string/is_not_string.d.ts +2 -4
  164. package/esm/string/is_not_string.d.ts.map +1 -1
  165. package/esm/string/is_not_string_literal.d.ts +4 -8
  166. package/esm/string/is_not_string_literal.d.ts.map +1 -1
  167. package/esm/string/is_not_template_literal.d.ts.map +1 -1
  168. package/esm/string/is_string.d.ts +2 -4
  169. package/esm/string/is_string.d.ts.map +1 -1
  170. package/esm/string/is_string_literal.d.ts +4 -8
  171. package/esm/string/is_string_literal.d.ts.map +1 -1
  172. package/esm/string/is_template_literal.d.ts.map +1 -1
  173. package/esm/string/string.d.ts.map +1 -1
  174. package/esm/string/string_plus.d.ts.map +1 -1
  175. package/esm/symbol/is_not_symbol.d.ts.map +1 -1
  176. package/esm/symbol/is_symbol.d.ts.map +1 -1
  177. package/esm/testing/test_type.d.ts.map +1 -1
  178. package/esm/tuple/common_prop_keys.d.ts.map +1 -1
  179. package/esm/tuple/create_tuple.d.ts.map +1 -1
  180. package/esm/tuple/drop.d.ts.map +1 -1
  181. package/esm/tuple/drop.js +1 -1
  182. package/esm/tuple/drop.js.map +1 -1
  183. package/esm/tuple/is_not_tuple.d.ts +2 -2
  184. package/esm/tuple/is_not_tuple.d.ts.map +1 -1
  185. package/esm/tuple/is_tuple.d.ts +2 -2
  186. package/esm/tuple/is_tuple.d.ts.map +1 -1
  187. package/esm/tuple/tail.d.ts +1 -1
  188. package/esm/tuple/tail.d.ts.map +1 -1
  189. package/esm/tuple/tuple_plus.common_prop_keys.d.ts +1 -1
  190. package/esm/tuple/tuple_plus.common_prop_keys.d.ts.map +1 -1
  191. package/esm/tuple/tuple_plus.drop_match.d.ts.map +1 -1
  192. package/esm/tuple/tuple_plus.filter.d.ts +1 -1
  193. package/esm/tuple/tuple_plus.filter.d.ts.map +1 -1
  194. package/esm/tuple/tuple_plus.find.d.ts +2 -2
  195. package/esm/tuple/tuple_plus.find.d.ts.map +1 -1
  196. package/esm/tuple/tuple_plus.pad_start.d.ts +1 -4
  197. package/esm/tuple/tuple_plus.pad_start.d.ts.map +1 -1
  198. package/esm/type_plus/$equality.d.ts.map +1 -1
  199. package/esm/type_plus/$infer_error.d.ts.map +1 -1
  200. package/esm/type_plus/$merge_options.d.ts.map +1 -1
  201. package/esm/type_plus/$resolve_options.d.ts +1 -1
  202. package/esm/type_plus/$resolve_options.d.ts.map +1 -1
  203. package/esm/type_plus/$special_type.d.ts +1 -7
  204. package/esm/type_plus/$special_type.d.ts.map +1 -1
  205. package/esm/type_plus/$type.d.ts.map +1 -1
  206. package/esm/type_plus/branch/$branch.d.ts.map +1 -1
  207. package/esm/type_plus/branch/$exact.d.ts +4 -1
  208. package/esm/type_plus/branch/$exact.d.ts.map +1 -1
  209. package/esm/type_plus/branch/$input_options.d.ts.map +1 -1
  210. package/esm/type_plus/branch/$is_distributive.d.ts.map +1 -1
  211. package/esm/type_plus/branch/$resolve_branch.d.ts +8 -9
  212. package/esm/type_plus/branch/$resolve_branch.d.ts.map +1 -1
  213. package/esm/type_plus/branch/$select.d.ts +1 -3
  214. package/esm/type_plus/branch/$select.d.ts.map +1 -1
  215. package/esm/type_plus/branch/$select_invert.d.ts +1 -3
  216. package/esm/type_plus/branch/$select_invert.d.ts.map +1 -1
  217. package/esm/type_plus/branch/$select_invert_strict.d.ts +1 -4
  218. package/esm/type_plus/branch/$select_invert_strict.d.ts.map +1 -1
  219. package/esm/type_plus/branch/$select_strict.d.ts +1 -4
  220. package/esm/type_plus/branch/$select_strict.d.ts.map +1 -1
  221. package/esm/type_plus/branch/$selection.d.ts.map +1 -1
  222. package/esm/type_plus/branch/$selection_options.d.ts.map +1 -1
  223. package/esm/undefined/has_undefined.d.ts +3 -1
  224. package/esm/undefined/has_undefined.d.ts.map +1 -1
  225. package/esm/undefined/is_not_undefined.d.ts.map +1 -1
  226. package/esm/undefined/is_undefined.d.ts.map +1 -1
  227. package/esm/union/union.d.ts.map +1 -1
  228. package/esm/union/union_to_intersection.d.ts.map +1 -1
  229. package/esm/union/union_to_intersection.js.map +1 -1
  230. package/esm/unknown/is_not_unknown.d.ts.map +1 -1
  231. package/esm/unknown/is_unknown.d.ts.map +1 -1
  232. package/esm/unknown/not_unknown_or.d.ts.map +1 -1
  233. package/esm/unknown/unknown.d.ts.map +1 -1
  234. package/esm/utils/index.d.ts.map +1 -1
  235. package/esm/void/is_not_void.d.ts.map +1 -1
  236. package/esm/void/is_void.d.ts.map +1 -1
  237. package/package.json +3 -4
  238. package/src/any/is_any.ts +8 -8
  239. package/src/any/is_not_any.ts +8 -8
  240. package/src/array/array.at.ts +22 -19
  241. package/src/array/array.entries.ts +3 -3
  242. package/src/array/array.find_last.ts +6 -6
  243. package/src/array/array.reverse.ts +3 -2
  244. package/src/array/array.some.ts +4 -4
  245. package/src/array/array_plus.common_prop_keys.ts +5 -6
  246. package/src/array/array_plus.drop_match.ts +7 -7
  247. package/src/array/array_plus.element_match.ts +25 -22
  248. package/src/array/array_plus.filter.ts +11 -12
  249. package/src/array/array_plus.find.ts +9 -11
  250. package/src/array/array_plus.index_at.ts +29 -35
  251. package/src/array/array_plus.is_index_out_of_bound.ts +1 -1
  252. package/src/array/array_plus.is_readonly.ts +17 -21
  253. package/src/array/array_plus.pad_start.ts +3 -7
  254. package/src/array/array_plus.split_at.ts +17 -19
  255. package/src/array/find_first.ts +6 -5
  256. package/src/array/head.ts +9 -8
  257. package/src/array/intersect_of_props.ts +5 -5
  258. package/src/array/is_array.ts +31 -32
  259. package/src/array/is_not_array.ts +32 -32
  260. package/src/array/last.ts +14 -9
  261. package/src/array/loose_array_type.ts +2 -2
  262. package/src/array/pad_start.ts +1 -3
  263. package/src/array/reverse.ts +8 -8
  264. package/src/array/union_of_props.ts +2 -2
  265. package/src/assertion/assert_type.ts +5 -3
  266. package/src/bigint/cast.ts +2 -2
  267. package/src/bigint/is_bigint.ts +17 -20
  268. package/src/bigint/is_bigint_literal.ts +12 -14
  269. package/src/bigint/is_not_bigint.ts +14 -16
  270. package/src/bigint/is_not_bigint_literal.ts +17 -16
  271. package/src/boolean/is_boolean.ts +48 -36
  272. package/src/boolean/is_false.ts +5 -3
  273. package/src/boolean/is_not_boolean.ts +23 -25
  274. package/src/boolean/is_not_false.ts +5 -3
  275. package/src/boolean/is_not_true.ts +5 -3
  276. package/src/boolean/is_true.ts +5 -3
  277. package/src/class/isConstructor.ts +1 -1
  278. package/src/equal/equal.ts +22 -27
  279. package/src/equal/identity_equal.ts +5 -3
  280. package/src/function/extract_function.ts +1 -3
  281. package/src/function/is_not_strict_function.ts +12 -12
  282. package/src/function/is_strict_function.ts +12 -14
  283. package/src/functional/Maybe.ts +1 -3
  284. package/src/functional/compose.ts +2 -4
  285. package/src/functional/context.ts +1 -1
  286. package/src/index.ts +0 -1
  287. package/src/math/abs.ts +18 -8
  288. package/src/math/math_plus.to_negative.ts +6 -6
  289. package/src/math/max.ts +2 -2
  290. package/src/math/numeric_struct.ts +225 -231
  291. package/src/mix_types/box.ts +34 -37
  292. package/src/mix_types/is_any_or_never.ts +6 -6
  293. package/src/mix_types/merge.ts +24 -28
  294. package/src/never/is_never.ts +13 -10
  295. package/src/never/is_not_never.ts +13 -10
  296. package/src/nodejs/isNodeError.ts +13 -13
  297. package/src/nominal/brand.ts +3 -4
  298. package/src/nominal/flavor.ts +3 -4
  299. package/src/nominal/nominal_match.ts +3 -10
  300. package/src/null/is_not_null.ts +5 -4
  301. package/src/null/is_null.ts +9 -8
  302. package/src/number/cast.ts +6 -6
  303. package/src/number/is_not_number.ts +15 -17
  304. package/src/number/is_not_number_literal.ts +17 -16
  305. package/src/number/is_number.ts +15 -17
  306. package/src/number/is_number_literal.ts +12 -14
  307. package/src/numeric/is_integer.ts +33 -27
  308. package/src/numeric/is_negative.ts +23 -23
  309. package/src/numeric/is_not_integer.ts +31 -26
  310. package/src/numeric/is_not_negative.ts +19 -19
  311. package/src/numeric/is_not_positive.ts +19 -19
  312. package/src/numeric/is_positive.ts +21 -21
  313. package/src/numeric/numeric_plus.ts +0 -1
  314. package/src/numeric/numeric_type.ts +0 -1
  315. package/src/object/ANotB.ts +2 -2
  316. package/src/object/IsDisjoint.ts +1 -4
  317. package/src/object/KeysWithDiffType.ts +2 -2
  318. package/src/object/KnownKeys.ts +7 -7
  319. package/src/object/RecursiveIntersect.ts +8 -8
  320. package/src/object/RecursiveRequired.ts +2 -2
  321. package/src/object/SpreadRecord.ts +1 -4
  322. package/src/object/facade.ts +1 -9
  323. package/src/object/getField.ts +1 -4
  324. package/src/object/hasKey.ts +1 -1
  325. package/src/object/is_not_object.ts +23 -16
  326. package/src/object/is_object.ts +23 -15
  327. package/src/object/left_join.ts +2 -2
  328. package/src/object/merge.ts +53 -72
  329. package/src/object/omit.ts +16 -25
  330. package/src/object/optional_key.ts +1 -4
  331. package/src/object/pick.ts +8 -19
  332. package/src/object/recursive_partial.ts +6 -6
  333. package/src/object/split.ts +3 -14
  334. package/src/object/typeOverrideIncompatible.ts +3 -3
  335. package/src/predicates/CanAssign.ts +9 -5
  336. package/src/predicates/assignable.ts +23 -24
  337. package/src/predicates/literal.ts +8 -8
  338. package/src/predicates/logical.ts +4 -4
  339. package/src/predicates/not_assignable.ts +23 -22
  340. package/src/primitive.ts +1 -10
  341. package/src/promise/index.ts +1 -1
  342. package/src/promise/mapSeries.ts +1 -1
  343. package/src/string/$extract_manipulated_string.ts +25 -20
  344. package/src/string/_string_type.ts +6 -6
  345. package/src/string/is_not_string.ts +13 -15
  346. package/src/string/is_not_string_literal.ts +29 -34
  347. package/src/string/is_not_template_literal.ts +18 -21
  348. package/src/string/is_string.ts +17 -20
  349. package/src/string/is_string_literal.ts +29 -34
  350. package/src/string/is_template_literal.ts +18 -20
  351. package/src/string/string.ts +2 -2
  352. package/src/string/string_plus.ts +6 -7
  353. package/src/symbol/is_not_symbol.ts +5 -3
  354. package/src/symbol/is_symbol.ts +5 -3
  355. package/src/testing/test_type.ts +89 -89
  356. package/src/tuple/common_prop_keys.ts +2 -5
  357. package/src/tuple/create_tuple.ts +18 -18
  358. package/src/tuple/drop.ts +20 -22
  359. package/src/tuple/is_not_tuple.ts +19 -21
  360. package/src/tuple/is_tuple.ts +23 -26
  361. package/src/tuple/tail.ts +5 -3
  362. package/src/tuple/tuple_plus.common_prop_keys.ts +6 -12
  363. package/src/tuple/tuple_plus.drop_match.ts +11 -11
  364. package/src/tuple/tuple_plus.filter.ts +5 -12
  365. package/src/tuple/tuple_plus.find.ts +14 -24
  366. package/src/tuple/tuple_plus.pad_start.ts +12 -27
  367. package/src/type_plus/$equality.ts +1 -3
  368. package/src/type_plus/$infer_error.ts +3 -1
  369. package/src/type_plus/$merge_options.ts +3 -4
  370. package/src/type_plus/$resolve_options.ts +6 -5
  371. package/src/type_plus/$special_type.ts +7 -5
  372. package/src/type_plus/$type.ts +3 -3
  373. package/src/type_plus/branch/$branch.ts +1 -2
  374. package/src/type_plus/branch/$exact.ts +9 -5
  375. package/src/type_plus/branch/$input_options.ts +1 -2
  376. package/src/type_plus/branch/$is_distributive.ts +7 -4
  377. package/src/type_plus/branch/$resolve_branch.ts +29 -39
  378. package/src/type_plus/branch/$select.ts +15 -16
  379. package/src/type_plus/branch/$select_invert.ts +11 -16
  380. package/src/type_plus/branch/$select_invert_strict.ts +14 -19
  381. package/src/type_plus/branch/$select_strict.ts +11 -13
  382. package/src/type_plus/branch/$selection.ts +8 -9
  383. package/src/type_plus/branch/$selection_options.ts +3 -3
  384. package/src/undefined/has_undefined.ts +4 -3
  385. package/src/undefined/is_not_undefined.ts +9 -9
  386. package/src/undefined/is_undefined.ts +9 -8
  387. package/src/union/union.ts +1 -4
  388. package/src/union/union_to_intersection.ts +1 -3
  389. package/src/unknown/is_not_unknown.ts +8 -8
  390. package/src/unknown/is_unknown.ts +8 -8
  391. package/src/unknown/not_unknown_or.ts +7 -3
  392. package/src/unknown/unknown.ts +0 -1
  393. package/src/utils/index.ts +17 -17
  394. package/src/void/is_not_void.ts +14 -14
  395. package/src/void/is_void.ts +14 -14
@@ -11,19 +11,12 @@
11
11
  */
12
12
  export type Filter<T extends readonly unknown[], Criteria = true> = T['length'] extends 0
13
13
  ? []
14
- : (
15
- T extends readonly [infer Head, ...infer Tail]
16
- ? (
17
- Tail['length'] extends 0
18
- ? (
19
- Head extends Criteria
14
+ : T extends readonly [infer Head, ...infer Tail]
15
+ ? Tail['length'] extends 0
16
+ ? Head extends Criteria
20
17
  ? [Head]
21
- : [])
22
- : (
23
- Head extends Criteria
18
+ : []
19
+ : Head extends Criteria
24
20
  ? [Head, ...Filter<Tail, Criteria>]
25
21
  : Filter<Tail, Criteria>
26
- )
27
- )
28
22
  : never
29
- )
@@ -54,36 +54,26 @@ export type Find<
54
54
  Options extends Find.Options = Find.DefaultOptions<Criteria>
55
55
  > = TypePlusOptions.Merge<Options, Find.DefaultOptions<Criteria>> extends infer O extends Find.Options
56
56
  ? IsTuple<
57
- A,
58
- {
59
- $then: A['length'] extends 0
60
- ? O['$emptyTuple']
61
- : Find.Device<A, Criteria, O>,
62
- $else: O['$array']
63
- }
64
- >
57
+ A,
58
+ {
59
+ $then: A['length'] extends 0 ? O['$emptyTuple'] : Find.Device<A, Criteria, O>
60
+ $else: O['$array']
61
+ }
62
+ >
65
63
  : never
66
64
  export namespace Find {
67
- export type Device<
68
- A extends readonly unknown[],
69
- Criteria,
70
- Options extends Find.Options
71
- > = A['length'] extends 0
65
+ export type Device<A extends readonly unknown[], Criteria, Options extends Find.Options> = A['length'] extends 0
72
66
  ? Options['$notMatch']
73
- : (A extends readonly [infer Head, ...infer Tail]
74
- ? ElementMatch<
75
- Head,
76
- Criteria,
77
- TypePlusOptions.Merge<{ $notMatch: Device<Tail, Criteria, Options> }, Options>
78
- >
79
- : never)
67
+ : A extends readonly [infer Head, ...infer Tail]
68
+ ? ElementMatch<Head, Criteria, TypePlusOptions.Merge<{ $notMatch: Device<Tail, Criteria, Options> }, Options>>
69
+ : never
80
70
  export interface Options extends ElementMatch.Options, $Never.$Options {
81
- $array?: unknown,
82
- $emptyTuple?: unknown,
71
+ $array?: unknown
72
+ $emptyTuple?: unknown
83
73
  }
84
74
 
85
75
  export interface DefaultOptions<Criteria> extends ElementMatch.DefaultOptions<Criteria>, $Never.$Default {
86
- $array: 'does not support array. Please use `FindFirst` or `ArrayPlus.Find` instead.',
87
- $emptyTuple: never,
76
+ $array: 'does not support array. Please use `FindFirst` or `ArrayPlus.Find` instead.'
77
+ $emptyTuple: never
88
78
  }
89
79
  }
@@ -17,15 +17,12 @@
17
17
  * PadStart<[1, 2, 3], 5> // [unknown, unknown, 1, 2, 3]
18
18
  * ```
19
19
  */
20
- export type PadStart<
21
- Tuple extends readonly unknown[],
22
- MaxLength extends number,
23
- PadWith = unknown> = PadStart.Device<
24
- Tuple,
25
- MaxLength,
26
- PadWith,
27
- []
28
- >
20
+ export type PadStart<Tuple extends readonly unknown[], MaxLength extends number, PadWith = unknown> = PadStart.Device<
21
+ Tuple,
22
+ MaxLength,
23
+ PadWith,
24
+ []
25
+ >
29
26
 
30
27
  export namespace PadStart {
31
28
  export type Device<
@@ -33,29 +30,17 @@ export namespace PadStart {
33
30
  MaxLength extends number,
34
31
  PadWith,
35
32
  Result extends unknown[]
36
- > =
37
- Result['length'] extends MaxLength
38
- ? (
39
- Source extends []
33
+ > = Result['length'] extends MaxLength
34
+ ? Source extends []
40
35
  ? Result
41
- : (
42
- Source extends readonly [...infer Head, infer Tail]
43
- ? (
44
- [Tail, ...Result] extends infer R extends unknown[]
36
+ : Source extends readonly [...infer Head, infer Tail]
37
+ ? [Tail, ...Result] extends infer R extends unknown[]
45
38
  ? Device<Head, R['length'], PadWith, R>
46
39
  : never
47
- )
48
40
  : never
49
- )
50
- )
51
- : (
52
- Source extends []
41
+ : Source extends []
53
42
  ? Device<Source, MaxLength, PadWith, [PadWith, ...Result]>
54
- : (
55
- Source extends readonly [...infer Head, infer Tail]
43
+ : Source extends readonly [...infer Head, infer Tail]
56
44
  ? Device<Head, MaxLength, PadWith, [Tail, ...Result]>
57
45
  : Source
58
- )
59
- )
60
-
61
46
  }
@@ -7,8 +7,6 @@ import type { $SelectionBranch } from './branch/$selection.js'
7
7
  import type { $SelectionOptions } from './branch/$selection_options.js'
8
8
 
9
9
  export namespace $Equality {
10
- export type $Options = $SelectionOptions &
11
- $DistributiveOptions &
12
- $InputOptions<$Any | $Unknown | $Never>
10
+ export type $Options = $SelectionOptions & $DistributiveOptions & $InputOptions<$Any | $Unknown | $Never>
13
11
  export type $Branch<$O extends $SelectionOptions = {}> = $SelectionBranch<$O>
14
12
  }
@@ -18,4 +18,6 @@ import type { $Type } from './$type.js'
18
18
  * : InferError<'some message', T>
19
19
  * ```
20
20
  */
21
- export type $InferError<M extends string, T = unknown> = M extends any ? $Type<'error', `Unable to infer: ${M}`, T> : never
21
+ export type $InferError<M extends string, T = unknown> = M extends any
22
+ ? $Type<'error', `Unable to infer: ${M}`, T>
23
+ : never
@@ -3,7 +3,6 @@
3
3
  *
4
4
  * Merge type options.
5
5
  */
6
- export type $MergeOptions<
7
- $O extends Record<string, any>,
8
- $V extends { [k in keyof $O]?: unknown }
9
- > = { [k in Exclude<keyof $O, keyof $V>]: $O[k] } & $V
6
+ export type $MergeOptions<$O extends Record<string, any>, $V extends { [k in keyof $O]?: unknown }> = {
7
+ [k in Exclude<keyof $O, keyof $V>]: $O[k]
8
+ } & $V
@@ -8,9 +8,10 @@ import type { $InferError } from './$infer_error.js'
8
8
  * The `Values` are assumed to be a tuple with at least one value.
9
9
  * These checks are not performed for performance considerations.
10
10
  */
11
- export type $ResolveOptions<V extends unknown[]> =
12
- V extends [infer T]
11
+ export type $ResolveOptions<V extends unknown[]> = V extends [infer T]
13
12
  ? T
14
- : (V extends [infer T, ...infer U]
15
- ? ([T, unknown] extends [unknown, T] ? $ResolveOptions<U> : T)
16
- : $InferError<'cannot [infer T, ...infer U] from', V>)
13
+ : V extends [infer T, ...infer U]
14
+ ? [T, unknown] extends [unknown, T]
15
+ ? $ResolveOptions<U>
16
+ : T
17
+ : $InferError<'cannot [infer T, ...infer U] from', V>
@@ -12,11 +12,13 @@ import type { $SelectionOptions } from './branch/$selection_options.js'
12
12
  *
13
13
  * A type utility to handle special types: `any`, `unknown`, and `never`.
14
14
  */
15
- export type $SpecialType<T, $O extends $SpecialType.$Options> =
16
- 0 extends 1 & T ? $ResolveBranch<T, $O, [$Any, $Then]> :
17
- [T, unknown] extends [unknown, T] ? $ResolveBranch<T, $O, [$Unknown, $Then]> :
18
- [T, never] extends [never, T] ? $ResolveBranch<T, $O, [$Never, $Then]> :
19
- $ResolveBranch<T, $O, [$Else]>
15
+ export type $SpecialType<T, $O extends $SpecialType.$Options> = 0 extends 1 & T
16
+ ? $ResolveBranch<T, $O, [$Any, $Then]>
17
+ : [T, unknown] extends [unknown, T]
18
+ ? $ResolveBranch<T, $O, [$Unknown, $Then]>
19
+ : [T, never] extends [never, T]
20
+ ? $ResolveBranch<T, $O, [$Never, $Then]>
21
+ : $ResolveBranch<T, $O, [$Else]>
20
22
 
21
23
  export namespace $SpecialType {
22
24
  export type $Options = $SelectionOptions & $InputOptions<$Any | $Unknown | $Never>
@@ -4,7 +4,7 @@
4
4
  * Special `type-plus` interface to represent unique types with messages.
5
5
  */
6
6
  export interface $Type<T extends string, M extends string = '', V = unknown> {
7
- type: T,
8
- message: M,
9
- value: V,
7
+ type: T
8
+ message: M
9
+ value: V
10
10
  }
@@ -23,5 +23,4 @@ export type $Branch<P extends `$${string}`> = $Type<'branch', P, P>
23
23
  * type $YourOptions = $BranchOptions<$Then | $Else> // { $then: $Then, $else: $Else }
24
24
  * ```
25
25
  */
26
- export type $BranchOptions<$B extends $Branch<any>> =
27
- { [k in $B['value']]: $B extends { value: k } ? $B : never }
26
+ export type $BranchOptions<$B extends $Branch<any>> = { [k in $B['value']]: $B extends { value: k } ? $B : never }
@@ -26,9 +26,13 @@ export namespace $Exact {
26
26
  exact: false
27
27
  }
28
28
 
29
- export type $IsExact<$Opt extends $Options,
30
- $O extends $InputOptions<$Then | $Else> = {}
31
- > = $ResolveOptions<[$Opt['exact'], $Exact.$Default]> extends true
32
- ? '$then' extends keyof $O ? $O['$then'] : true
33
- : '$else' extends keyof $O ? $O['$else'] : false
29
+ export type $IsExact<$Opt extends $Options, $O extends $InputOptions<$Then | $Else> = {}> = $ResolveOptions<
30
+ [$Opt['exact'], $Exact.$Default]
31
+ > extends true
32
+ ? '$then' extends keyof $O
33
+ ? $O['$then']
34
+ : true
35
+ : '$else' extends keyof $O
36
+ ? $O['$else']
37
+ : false
34
38
  }
@@ -5,5 +5,4 @@ import type { $Branch } from './$branch.js'
5
5
  *
6
6
  * Define branch input options.
7
7
  */
8
- export type $InputOptions<$B extends $Branch<any>> =
9
- { [k in $B['value']]?: unknown }
8
+ export type $InputOptions<$B extends $Branch<any>> = { [k in $B['value']]?: unknown }
@@ -6,7 +6,10 @@ import type { $Else, $Then } from './$selection.js'
6
6
  export type $IsDistributive<
7
7
  $Options extends $DistributiveOptions,
8
8
  $O extends $InputOptions<$Then | $Else> = {}
9
- > =
10
- $ResolveOptions<[$Options['distributive'], $DistributiveDefault['distributive']]> extends true
11
- ? '$then' extends keyof $O ? $O['$then'] : true
12
- : '$else' extends keyof $O ? $O['$else'] : false
9
+ > = $ResolveOptions<[$Options['distributive'], $DistributiveDefault['distributive']]> extends true
10
+ ? '$then' extends keyof $O
11
+ ? $O['$then']
12
+ : true
13
+ : '$else' extends keyof $O
14
+ ? $O['$else']
15
+ : false
@@ -17,65 +17,55 @@ import type { $Else, $Then } from './$selection.js'
17
17
  * @typeparam $B Tuple of branches with at least one entry.
18
18
  * @typeparam $D When specified, resolve the branch in override mode.
19
19
  * If no branch in `$B` is resolved to `$Override<X>`, `$D` will be returned.
20
- */
20
+ */
21
21
  export type $ResolveBranch<
22
22
  T,
23
23
  $O extends Record<string, any>,
24
24
  $B extends Array<$Branch<any> | unknown>,
25
25
  $D = unknown
26
- > =
27
- [unknown, $D] extends [$D, unknown]
28
- ? (
29
- $B extends [infer B]
26
+ > = [unknown, $D] extends [$D, unknown]
27
+ ? $B extends [infer B]
30
28
  ? $ResolveBranch._Last<T, $O, B>
31
- : (
32
- $B extends [infer B, ...infer Bs extends Array<$Branch<any> | unknown>]
29
+ : $B extends [infer B, ...infer Bs extends Array<$Branch<any> | unknown>]
33
30
  ? $ResolveBranch._<$ResolveBranch<T, $O, Bs>, $O, B>
34
31
  : never
35
- )
36
- )
37
32
  : $ResolveBranch._Override<$D, $O, $B>
38
33
 
39
34
  export namespace $ResolveBranch {
40
- export type _Override<
41
- $D,
42
- $O extends Record<string, any>,
43
- $B extends Array<$Branch<any> | unknown>,
44
- > = $B extends [infer B]
35
+ export type _Override<$D, $O extends Record<string, any>, $B extends Array<$Branch<any> | unknown>> = $B extends [
36
+ infer B
37
+ ]
45
38
  ? _OLast<$D, $O, B>
46
- : (
47
- $B extends [infer B, ...infer Bs extends Array<$Branch<any> | unknown>]
39
+ : $B extends [infer B, ...infer Bs extends Array<$Branch<any> | unknown>]
48
40
  ? _OLast<_Override<$D, $O, Bs>, $O, B>
49
41
  : never
50
- )
51
42
 
52
- export type _OLast<
53
- $D,
54
- $O extends Record<string, any>,
55
- $B extends $Branch<any> | unknown,
56
- > = $B extends $Branch<any>
57
- ? (
58
- $B['value'] extends keyof $O
59
- ? ($O[$B['value']] extends infer R extends $Override<any>
60
- ? ([R, never] extends [never, R] ? $D : R['value'])
43
+ export type _OLast<$D, $O extends Record<string, any>, $B extends $Branch<any> | unknown> = $B extends $Branch<any>
44
+ ? $B['value'] extends keyof $O
45
+ ? $O[$B['value']] extends infer R extends $Override<any>
46
+ ? [R, never] extends [never, R]
47
+ ? $D
48
+ : R['value']
61
49
  : $D
62
- )
63
50
  : $D
64
- )
65
51
  : $D
66
52
 
67
- export type _<T, $O extends Record<string, any>, $B> =
68
- $B extends $Branch<any> ?
69
- ($B['value'] extends keyof $O ? $Override.$Unwrap<$O[$B['value']]> : T)
53
+ export type _<T, $O extends Record<string, any>, $B> = $B extends $Branch<any>
54
+ ? $B['value'] extends keyof $O
55
+ ? $Override.$Unwrap<$O[$B['value']]>
56
+ : T
70
57
  : T
71
- export type _Last<T, $O extends Record<string, any>, $B> =
72
- $B extends $Then
73
- ? ('$then' extends keyof $O
58
+ export type _Last<T, $O extends Record<string, any>, $B> = $B extends $Then
59
+ ? '$then' extends keyof $O
74
60
  ? $Override.$Unwrap<$O['$then']>
75
- : $O['selection'] extends 'filter' ? T : true)
61
+ : $O['selection'] extends 'filter'
62
+ ? T
63
+ : true
76
64
  : $B extends $Else
77
- ? ('$else' extends keyof $O
78
- ? $Override.$Unwrap<$O['$else']>
79
- : $O['selection'] extends 'filter' ? never : false)
80
- : _<T, $O, $B>
65
+ ? '$else' extends keyof $O
66
+ ? $Override.$Unwrap<$O['$else']>
67
+ : $O['selection'] extends 'filter'
68
+ ? never
69
+ : false
70
+ : _<T, $O, $B>
81
71
  }
@@ -61,30 +61,29 @@ import type { $SelectionOptions } from './$selection_options.js'
61
61
  * type R = $Select<string, undefined, $SelectionBranch> // $Else
62
62
  * ```
63
63
  */
64
- export type $Select<
65
- T,
66
- U,
67
- $O extends $Select.$Options = {}
68
- > = $SpecialType<
64
+ export type $Select<T, U, $O extends $Select.$Options = {}> = $SpecialType<
69
65
  T,
70
66
  {
71
- $any: $ResolveBranch<T, $O, [$Any, $Else]>,
72
- $unknown: $ResolveBranch<T, $O, [$Unknown, $Else]>,
73
- $never: $ResolveBranch<T, $O, [$Never, $Else]>,
67
+ $any: $ResolveBranch<T, $O, [$Any, $Else]>
68
+ $unknown: $ResolveBranch<T, $O, [$Unknown, $Else]>
69
+ $never: $ResolveBranch<T, $O, [$Never, $Else]>
74
70
  $else: $ResolveBranch<T, $O, [$Else], $Select._<T, U, $O>>
75
71
  }
76
72
  >
77
73
 
78
74
  export namespace $Select {
79
- export type $Options = $SelectionOptions & $DistributiveOptions & $InputOptions<$Any | $Unknown | $Never> & $Exact.$Options
75
+ export type $Options = $SelectionOptions &
76
+ $DistributiveOptions &
77
+ $InputOptions<$Any | $Unknown | $Never> &
78
+ $Exact.$Options
80
79
  export type $Default = $SelectionPredicate & $DistributiveDefault
81
80
  export type $Branch<$O extends $DistributiveOptions = $DistributiveDefault> = $SelectionBranch & $O
82
- export type _<T, U, $O extends $Select.$Options> = $IsDistributive<$O> extends true
83
- ? _D<T, U, $O>
84
- : _N<T, U, $O>
81
+ export type _<T, U, $O extends $Select.$Options> = $IsDistributive<$O> extends true ? _D<T, U, $O> : _N<T, U, $O>
85
82
 
86
- export type _D<T, U, $O extends $Select.$Options> =
87
- T extends U ? $ResolveBranch<T, $O, [$Then]> : $ResolveBranch<T, $O, [$Else]>
88
- export type _N<T, U, $O extends $Select.$Options> =
89
- [T] extends [U] ? $ResolveBranch<T, $O, [$Then]> : $ResolveBranch<T, $O, [$Else]>
83
+ export type _D<T, U, $O extends $Select.$Options> = T extends U
84
+ ? $ResolveBranch<T, $O, [$Then]>
85
+ : $ResolveBranch<T, $O, [$Else]>
86
+ export type _N<T, U, $O extends $Select.$Options> = [T] extends [U]
87
+ ? $ResolveBranch<T, $O, [$Then]>
88
+ : $ResolveBranch<T, $O, [$Else]>
90
89
  }
@@ -60,19 +60,13 @@ import type { $SelectionOptions } from './$selection_options.js'
60
60
  * type R = $SelectInvert<string, undefined, $SelectionBranch> // $Else
61
61
  * ```
62
62
  */
63
- export type $SelectInvert<
64
- T,
65
- U,
66
- $O extends $SelectInvert.$Options = {}
67
- > = $SpecialType<
63
+ export type $SelectInvert<T, U, $O extends $SelectInvert.$Options = {}> = $SpecialType<
68
64
  T,
69
65
  {
70
- $any: $ResolveBranch<T, $O, [$Any, $Then]>,
71
- $unknown: $ResolveBranch<T, $O, [$Unknown, $Then]>,
72
- $never: $ResolveBranch<T, $O, [$Never, $Then]>,
73
- $else: $IsDistributive<$O> extends true
74
- ? $SelectInvert._D<T, U, $O>
75
- : $SelectInvert._N<T, U, $O>
66
+ $any: $ResolveBranch<T, $O, [$Any, $Then]>
67
+ $unknown: $ResolveBranch<T, $O, [$Unknown, $Then]>
68
+ $never: $ResolveBranch<T, $O, [$Never, $Then]>
69
+ $else: $IsDistributive<$O> extends true ? $SelectInvert._D<T, U, $O> : $SelectInvert._N<T, U, $O>
76
70
  }
77
71
  >
78
72
 
@@ -80,9 +74,10 @@ export namespace $SelectInvert {
80
74
  export type $Options = $SelectionOptions & $DistributiveOptions & $InputOptions<$Any | $Unknown | $Never>
81
75
  export type $Default = $SelectionPredicate & $DistributiveDefault
82
76
  export type $Branch = $SelectionBranch & $DistributiveDefault
83
- export type _D<T, U, $O extends $SelectInvert.$Options> =
84
- T extends U ? $ResolveBranch<T, $O, [$Else]> : $ResolveBranch<T, $O, [$Then]>
85
- export type _N<T, U, $O extends $SelectInvert.$Options> =
86
- [T] extends [U] ? $ResolveBranch<T, $O, [$Else]> : $ResolveBranch<T, $O, [$Then]>
87
-
77
+ export type _D<T, U, $O extends $SelectInvert.$Options> = T extends U
78
+ ? $ResolveBranch<T, $O, [$Else]>
79
+ : $ResolveBranch<T, $O, [$Then]>
80
+ export type _N<T, U, $O extends $SelectInvert.$Options> = [T] extends [U]
81
+ ? $ResolveBranch<T, $O, [$Else]>
82
+ : $ResolveBranch<T, $O, [$Then]>
88
83
  }
@@ -60,29 +60,24 @@ import type { $SelectionOptions } from './$selection_options.js'
60
60
  * type R = $SelectInvertStrict<string, undefined, $SelectionBranch> // $Else
61
61
  * ```
62
62
  */
63
- export type $SelectInvertStrict<
63
+ export type $SelectInvertStrict<T, U, $O extends $SelectInvertStrict.$Options = {}> = $SpecialType<
64
64
  T,
65
- U,
66
- $O extends $SelectInvertStrict.$Options = {}
67
- > =
68
- $SpecialType<
69
- T,
70
- {
71
- $any: $ResolveBranch<T, $O, [$Any, $Then]>,
72
- $unknown: $ResolveBranch<T, $O, [$Unknown, $Then]>,
73
- $never: $ResolveBranch<T, $O, [$Never, $Then]>,
74
- $else: $IsDistributive<$O> extends true
75
- ? $SelectInvertStrict._D<T, U, $O>
76
- : $SelectInvertStrict._N<T, U, $O>
77
- }
78
- >
65
+ {
66
+ $any: $ResolveBranch<T, $O, [$Any, $Then]>
67
+ $unknown: $ResolveBranch<T, $O, [$Unknown, $Then]>
68
+ $never: $ResolveBranch<T, $O, [$Never, $Then]>
69
+ $else: $IsDistributive<$O> extends true ? $SelectInvertStrict._D<T, U, $O> : $SelectInvertStrict._N<T, U, $O>
70
+ }
71
+ >
79
72
 
80
73
  export namespace $SelectInvertStrict {
81
74
  export type $Options = $SelectionOptions & $DistributiveOptions & $InputOptions<$Any | $Unknown | $Never>
82
75
  export type $Default = $SelectionPredicate & $DistributiveDefault
83
76
  export type $Branch = $SelectionBranch & $DistributiveDefault
84
- export type _D<T, U, $O extends $SelectInvertStrict.$Options> =
85
- T extends U ? $ResolveBranch<T, $O, [$Else]> : $ResolveBranch<T, $O, [$Then]>
86
- export type _N<T, U, $O extends $SelectInvertStrict.$Options> =
87
- [T, U] extends [U, T] ? $ResolveBranch<T, $O, [$Else]> : $ResolveBranch<T, $O, [$Then]>
77
+ export type _D<T, U, $O extends $SelectInvertStrict.$Options> = T extends U
78
+ ? $ResolveBranch<T, $O, [$Else]>
79
+ : $ResolveBranch<T, $O, [$Then]>
80
+ export type _N<T, U, $O extends $SelectInvertStrict.$Options> = [T, U] extends [U, T]
81
+ ? $ResolveBranch<T, $O, [$Else]>
82
+ : $ResolveBranch<T, $O, [$Then]>
88
83
  }
@@ -60,15 +60,12 @@ import type { $SelectionOptions } from './$selection_options.js'
60
60
  * type R = $SelectStrict<string, undefined, $SelectionBranch> // $Else
61
61
  * ```
62
62
  */
63
- export type $SelectStrict<
63
+ export type $SelectStrict<T, U, $O extends $SelectStrict.$Options = {}> = $SpecialType<
64
64
  T,
65
- U,
66
- $O extends $SelectStrict.$Options = {}
67
- > = $SpecialType<
68
- T, {
69
- $any: $ResolveBranch<T, $O, [$Any, $Else]>,
70
- $unknown: $ResolveBranch<T, $O, [$Unknown, $Else]>,
71
- $never: $ResolveBranch<T, $O, [$Never, $Else]>,
65
+ {
66
+ $any: $ResolveBranch<T, $O, [$Any, $Else]>
67
+ $unknown: $ResolveBranch<T, $O, [$Unknown, $Else]>
68
+ $never: $ResolveBranch<T, $O, [$Never, $Else]>
72
69
  $else: $SelectStrict._Else<T, U, $O>
73
70
  }
74
71
  >
@@ -80,11 +77,12 @@ export namespace $SelectStrict {
80
77
  export type _Else<T, U, $O extends $SelectStrict.$Options> = $IsDistributive<$O> extends true
81
78
  ? _D<T, U, $O>
82
79
  : _N<T, U, $O>
83
- export type _D<T, U, $O extends $SelectStrict.$Options> =
84
- T extends U ? U extends T
85
- ? $ResolveBranch<T, $O, [$Then]>
80
+ export type _D<T, U, $O extends $SelectStrict.$Options> = T extends U
81
+ ? U extends T
82
+ ? $ResolveBranch<T, $O, [$Then]>
83
+ : $ResolveBranch<T, $O, [$Else]>
86
84
  : $ResolveBranch<T, $O, [$Else]>
85
+ export type _N<T, U, $O extends $SelectStrict.$Options> = [T, U] extends [U, T]
86
+ ? $ResolveBranch<T, $O, [$Then]>
87
87
  : $ResolveBranch<T, $O, [$Else]>
88
- export type _N<T, U, $O extends $SelectStrict.$Options> =
89
- [T, U] extends [U, T] ? $ResolveBranch<T, $O, [$Then]> : $ResolveBranch<T, $O, [$Else]>
90
88
  }
@@ -25,8 +25,7 @@ export namespace $Else {
25
25
  * - `$Then` -> `$Else`
26
26
  * - `$Else` -> `$Then`
27
27
  */
28
- export type $InvertSelection<Branch extends $Then | $Else> =
29
- Branch extends $Then ? $Else : $Then
28
+ export type $InvertSelection<Branch extends $Then | $Else> = Branch extends $Then ? $Else : $Then
30
29
 
31
30
  /**
32
31
  * 🧰 *type util*
@@ -57,8 +56,8 @@ export type $InvertSelection<Branch extends $Then | $Else> =
57
56
  * ```
58
57
  */
59
58
  export type $SelectionBranch<$O extends $SelectionOptions = {}> = {
60
- $then: $Then,
61
- $else: $Else,
59
+ $then: $Then
60
+ $else: $Else
62
61
  } & $O
63
62
 
64
63
  /**
@@ -85,9 +84,9 @@ export type $SelectionBranch<$O extends $SelectionOptions = {}> = {
85
84
  * ```
86
85
  */
87
86
  export type $SelectionFilter<T> = {
88
- selection: 'filter',
89
- $then: T,
90
- $else: never,
87
+ selection: 'filter'
88
+ $then: T
89
+ $else: never
91
90
  }
92
91
 
93
92
  /**
@@ -113,7 +112,7 @@ export type $SelectionFilter<T> = {
113
112
  * ```
114
113
  */
115
114
  export type $SelectionPredicate = {
116
- $then: true,
115
+ $then: true
117
116
  $else: false
118
117
  }
119
118
 
@@ -130,6 +129,6 @@ export type $SelectionPredicate = {
130
129
  * ```
131
130
  */
132
131
  export type $FlipSelection<$Options extends $SelectionOptions> = {
133
- $then: $Options['$else'],
132
+ $then: $Options['$else']
134
133
  $else: $Options['$then']
135
134
  } & Omit<$Options, '$then' | '$else'>
@@ -30,7 +30,7 @@ export type $SelectionOptions = {
30
30
  *
31
31
  * Note that setting `$then` and `$else` overrides the default selection logic.
32
32
  */
33
- selection?: 'predicate' | 'filter' | undefined,
34
- $then?: unknown,
35
- $else?: unknown,
33
+ selection?: 'predicate' | 'filter' | undefined
34
+ $then?: unknown
35
+ $else?: unknown
36
36
  }
@@ -38,7 +38,8 @@ import type { IsUndefined } from './is_undefined.js'
38
38
  * type R = HasUndefined<string, $SelectionBranch> // $Else
39
39
  * ```
40
40
  */
41
- export type HasUndefined<
41
+ export type HasUndefined<T, $O extends $SelectionOptions = {}> = $ResolveBranch<
42
42
  T,
43
- $O extends $SelectionOptions = {}
44
- > = $ResolveBranch<T, $O, [IsUndefined<T> extends false ? $Else : $Then]>
43
+ $O,
44
+ [IsUndefined<T> extends false ? $Else : $Then]
45
+ >
@@ -52,16 +52,16 @@ import type { $Then } from '../type_plus/branch/$selection.js'
52
52
  * type R = IsNotUndefined<undefined, $SelectionBranch> // $Else
53
53
  * ```
54
54
  */
55
- export type IsNotUndefined<T, $O extends IsNotUndefined.$Options = {}> =
56
- $SpecialType<T,
57
- $MergeOptions<$O,
58
- {
59
- $then: $ResolveBranch<T, $O, [$Then]>,
60
- $else: IsNotUndefined.$<T, $O>
61
- }
62
- >
55
+ export type IsNotUndefined<T, $O extends IsNotUndefined.$Options = {}> = $SpecialType<
56
+ T,
57
+ $MergeOptions<
58
+ $O,
59
+ {
60
+ $then: $ResolveBranch<T, $O, [$Then]>
61
+ $else: IsNotUndefined.$<T, $O>
62
+ }
63
63
  >
64
-
64
+ >
65
65
 
66
66
  export namespace IsNotUndefined {
67
67
  export type $Options = $Equality.$Options