@depup/sinclair__typebox 0.34.48-depup.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 +25 -0
  2. package/build/cjs/compiler/compiler.d.ts +55 -0
  3. package/build/cjs/compiler/compiler.js +670 -0
  4. package/build/cjs/compiler/index.d.ts +2 -0
  5. package/build/cjs/compiler/index.js +22 -0
  6. package/build/cjs/errors/errors.d.ts +91 -0
  7. package/build/cjs/errors/errors.js +599 -0
  8. package/build/cjs/errors/function.d.ts +21 -0
  9. package/build/cjs/errors/function.js +153 -0
  10. package/build/cjs/errors/index.d.ts +2 -0
  11. package/build/cjs/errors/index.js +19 -0
  12. package/build/cjs/index.d.ts +71 -0
  13. package/build/cjs/index.js +97 -0
  14. package/build/cjs/parser/index.d.ts +2 -0
  15. package/build/cjs/parser/index.js +39 -0
  16. package/build/cjs/parser/runtime/guard.d.ts +23 -0
  17. package/build/cjs/parser/runtime/guard.js +86 -0
  18. package/build/cjs/parser/runtime/index.d.ts +5 -0
  19. package/build/cjs/parser/runtime/index.js +45 -0
  20. package/build/cjs/parser/runtime/module.d.ts +9 -0
  21. package/build/cjs/parser/runtime/module.js +22 -0
  22. package/build/cjs/parser/runtime/parse.d.ts +9 -0
  23. package/build/cjs/parser/runtime/parse.js +160 -0
  24. package/build/cjs/parser/runtime/token.d.ts +8 -0
  25. package/build/cjs/parser/runtime/token.js +230 -0
  26. package/build/cjs/parser/runtime/types.d.ts +98 -0
  27. package/build/cjs/parser/runtime/types.js +71 -0
  28. package/build/cjs/parser/static/index.d.ts +3 -0
  29. package/build/cjs/parser/static/index.js +43 -0
  30. package/build/cjs/parser/static/parse.d.ts +20 -0
  31. package/build/cjs/parser/static/parse.js +3 -0
  32. package/build/cjs/parser/static/token.d.ts +108 -0
  33. package/build/cjs/parser/static/token.js +3 -0
  34. package/build/cjs/parser/static/types.d.ts +69 -0
  35. package/build/cjs/parser/static/types.js +3 -0
  36. package/build/cjs/syntax/index.d.ts +1 -0
  37. package/build/cjs/syntax/index.js +18 -0
  38. package/build/cjs/syntax/mapping.d.ts +167 -0
  39. package/build/cjs/syntax/mapping.js +491 -0
  40. package/build/cjs/syntax/parser.d.ts +162 -0
  41. package/build/cjs/syntax/parser.js +191 -0
  42. package/build/cjs/syntax/syntax.d.ts +12 -0
  43. package/build/cjs/syntax/syntax.js +54 -0
  44. package/build/cjs/system/index.d.ts +2 -0
  45. package/build/cjs/system/index.js +19 -0
  46. package/build/cjs/system/policy.d.ts +29 -0
  47. package/build/cjs/system/policy.js +58 -0
  48. package/build/cjs/system/system.d.ts +16 -0
  49. package/build/cjs/system/system.js +43 -0
  50. package/build/cjs/type/any/any.d.ts +8 -0
  51. package/build/cjs/type/any/any.js +10 -0
  52. package/build/cjs/type/any/index.d.ts +1 -0
  53. package/build/cjs/type/any/index.js +18 -0
  54. package/build/cjs/type/argument/argument.d.ts +9 -0
  55. package/build/cjs/type/argument/argument.js +10 -0
  56. package/build/cjs/type/argument/index.d.ts +1 -0
  57. package/build/cjs/type/argument/index.js +18 -0
  58. package/build/cjs/type/array/array.d.ts +28 -0
  59. package/build/cjs/type/array/array.js +10 -0
  60. package/build/cjs/type/array/index.d.ts +1 -0
  61. package/build/cjs/type/array/index.js +18 -0
  62. package/build/cjs/type/async-iterator/async-iterator.d.ts +11 -0
  63. package/build/cjs/type/async-iterator/async-iterator.js +10 -0
  64. package/build/cjs/type/async-iterator/index.d.ts +1 -0
  65. package/build/cjs/type/async-iterator/index.js +18 -0
  66. package/build/cjs/type/awaited/awaited.d.ts +14 -0
  67. package/build/cjs/type/awaited/awaited.js +41 -0
  68. package/build/cjs/type/awaited/index.d.ts +1 -0
  69. package/build/cjs/type/awaited/index.js +18 -0
  70. package/build/cjs/type/bigint/bigint.d.ts +16 -0
  71. package/build/cjs/type/bigint/bigint.js +10 -0
  72. package/build/cjs/type/bigint/index.d.ts +1 -0
  73. package/build/cjs/type/bigint/index.js +18 -0
  74. package/build/cjs/type/boolean/boolean.d.ts +9 -0
  75. package/build/cjs/type/boolean/boolean.js +10 -0
  76. package/build/cjs/type/boolean/index.d.ts +1 -0
  77. package/build/cjs/type/boolean/index.js +18 -0
  78. package/build/cjs/type/clone/index.d.ts +2 -0
  79. package/build/cjs/type/clone/index.js +19 -0
  80. package/build/cjs/type/clone/type.d.ts +5 -0
  81. package/build/cjs/type/clone/type.js +14 -0
  82. package/build/cjs/type/clone/value.d.ts +2 -0
  83. package/build/cjs/type/clone/value.js +73 -0
  84. package/build/cjs/type/composite/composite.d.ts +18 -0
  85. package/build/cjs/type/composite/composite.js +46 -0
  86. package/build/cjs/type/composite/index.d.ts +1 -0
  87. package/build/cjs/type/composite/index.js +18 -0
  88. package/build/cjs/type/computed/computed.d.ts +9 -0
  89. package/build/cjs/type/computed/computed.js +10 -0
  90. package/build/cjs/type/computed/index.d.ts +1 -0
  91. package/build/cjs/type/computed/index.js +18 -0
  92. package/build/cjs/type/const/const.d.ts +27 -0
  93. package/build/cjs/type/const/const.js +58 -0
  94. package/build/cjs/type/const/index.d.ts +1 -0
  95. package/build/cjs/type/const/index.js +18 -0
  96. package/build/cjs/type/constructor/constructor.d.ts +23 -0
  97. package/build/cjs/type/constructor/constructor.js +10 -0
  98. package/build/cjs/type/constructor/index.d.ts +1 -0
  99. package/build/cjs/type/constructor/index.js +18 -0
  100. package/build/cjs/type/constructor-parameters/constructor-parameters.d.ts +7 -0
  101. package/build/cjs/type/constructor-parameters/constructor-parameters.js +44 -0
  102. package/build/cjs/type/constructor-parameters/index.d.ts +1 -0
  103. package/build/cjs/type/constructor-parameters/index.js +18 -0
  104. package/build/cjs/type/create/immutable.d.ts +2 -0
  105. package/build/cjs/type/create/immutable.js +70 -0
  106. package/build/cjs/type/create/index.d.ts +1 -0
  107. package/build/cjs/type/create/index.js +18 -0
  108. package/build/cjs/type/create/type.d.ts +3 -0
  109. package/build/cjs/type/create/type.js +19 -0
  110. package/build/cjs/type/date/date.d.ts +21 -0
  111. package/build/cjs/type/date/date.js +10 -0
  112. package/build/cjs/type/date/index.d.ts +1 -0
  113. package/build/cjs/type/date/index.js +18 -0
  114. package/build/cjs/type/discard/discard.d.ts +2 -0
  115. package/build/cjs/type/discard/discard.js +12 -0
  116. package/build/cjs/type/discard/index.d.ts +1 -0
  117. package/build/cjs/type/discard/index.js +18 -0
  118. package/build/cjs/type/enum/enum.d.ts +14 -0
  119. package/build/cjs/type/enum/enum.js +22 -0
  120. package/build/cjs/type/enum/index.d.ts +1 -0
  121. package/build/cjs/type/enum/index.js +18 -0
  122. package/build/cjs/type/error/error.d.ts +4 -0
  123. package/build/cjs/type/error/error.js +11 -0
  124. package/build/cjs/type/error/index.d.ts +1 -0
  125. package/build/cjs/type/error/index.js +18 -0
  126. package/build/cjs/type/exclude/exclude-from-mapped-result.d.ts +11 -0
  127. package/build/cjs/type/exclude/exclude-from-mapped-result.js +22 -0
  128. package/build/cjs/type/exclude/exclude-from-template-literal.d.ts +5 -0
  129. package/build/cjs/type/exclude/exclude-from-template-literal.js +9 -0
  130. package/build/cjs/type/exclude/exclude.d.ts +21 -0
  131. package/build/cjs/type/exclude/exclude.js +29 -0
  132. package/build/cjs/type/exclude/index.d.ts +3 -0
  133. package/build/cjs/type/exclude/index.js +20 -0
  134. package/build/cjs/type/extends/extends-check.d.ts +10 -0
  135. package/build/cjs/type/extends/extends-check.js +641 -0
  136. package/build/cjs/type/extends/extends-from-mapped-key.d.ts +14 -0
  137. package/build/cjs/type/extends/extends-from-mapped-key.js +29 -0
  138. package/build/cjs/type/extends/extends-from-mapped-result.d.ts +11 -0
  139. package/build/cjs/type/extends/extends-from-mapped-result.js +23 -0
  140. package/build/cjs/type/extends/extends-undefined.d.ts +3 -0
  141. package/build/cjs/type/extends/extends-undefined.js +24 -0
  142. package/build/cjs/type/extends/extends.d.ts +16 -0
  143. package/build/cjs/type/extends/extends.js +27 -0
  144. package/build/cjs/type/extends/index.d.ts +5 -0
  145. package/build/cjs/type/extends/index.js +22 -0
  146. package/build/cjs/type/extract/extract-from-mapped-result.d.ts +11 -0
  147. package/build/cjs/type/extract/extract-from-mapped-result.js +22 -0
  148. package/build/cjs/type/extract/extract-from-template-literal.d.ts +5 -0
  149. package/build/cjs/type/extract/extract-from-template-literal.js +9 -0
  150. package/build/cjs/type/extract/extract.d.ts +21 -0
  151. package/build/cjs/type/extract/extract.js +29 -0
  152. package/build/cjs/type/extract/index.d.ts +3 -0
  153. package/build/cjs/type/extract/index.js +20 -0
  154. package/build/cjs/type/function/function.d.ts +23 -0
  155. package/build/cjs/type/function/function.js +10 -0
  156. package/build/cjs/type/function/index.d.ts +1 -0
  157. package/build/cjs/type/function/index.js +18 -0
  158. package/build/cjs/type/guard/index.d.ts +3 -0
  159. package/build/cjs/type/guard/index.js +40 -0
  160. package/build/cjs/type/guard/kind.d.ts +147 -0
  161. package/build/cjs/type/guard/kind.js +320 -0
  162. package/build/cjs/type/guard/type.d.ts +152 -0
  163. package/build/cjs/type/guard/type.js +597 -0
  164. package/build/cjs/type/guard/value.d.ts +34 -0
  165. package/build/cjs/type/guard/value.js +89 -0
  166. package/build/cjs/type/helpers/helpers.d.ts +42 -0
  167. package/build/cjs/type/helpers/helpers.js +8 -0
  168. package/build/cjs/type/helpers/index.d.ts +1 -0
  169. package/build/cjs/type/helpers/index.js +18 -0
  170. package/build/cjs/type/index.d.ts +71 -0
  171. package/build/cjs/type/index.js +88 -0
  172. package/build/cjs/type/indexed/index.d.ts +4 -0
  173. package/build/cjs/type/indexed/index.js +21 -0
  174. package/build/cjs/type/indexed/indexed-from-mapped-key.d.ts +13 -0
  175. package/build/cjs/type/indexed/indexed-from-mapped-key.js +26 -0
  176. package/build/cjs/type/indexed/indexed-from-mapped-result.d.ts +12 -0
  177. package/build/cjs/type/indexed/indexed-from-mapped-result.js +24 -0
  178. package/build/cjs/type/indexed/indexed-property-keys.d.ts +14 -0
  179. package/build/cjs/type/indexed/indexed-property-keys.js +36 -0
  180. package/build/cjs/type/indexed/indexed.d.ts +52 -0
  181. package/build/cjs/type/indexed/indexed.js +98 -0
  182. package/build/cjs/type/instance-type/index.d.ts +1 -0
  183. package/build/cjs/type/instance-type/index.js +18 -0
  184. package/build/cjs/type/instance-type/instance-type.d.ts +6 -0
  185. package/build/cjs/type/instance-type/instance-type.js +44 -0
  186. package/build/cjs/type/instantiate/index.d.ts +1 -0
  187. package/build/cjs/type/instantiate/index.js +18 -0
  188. package/build/cjs/type/instantiate/instantiate.d.ts +50 -0
  189. package/build/cjs/type/instantiate/instantiate.js +153 -0
  190. package/build/cjs/type/integer/index.d.ts +1 -0
  191. package/build/cjs/type/integer/index.js +18 -0
  192. package/build/cjs/type/integer/integer.d.ts +16 -0
  193. package/build/cjs/type/integer/integer.js +10 -0
  194. package/build/cjs/type/intersect/index.d.ts +3 -0
  195. package/build/cjs/type/intersect/index.js +20 -0
  196. package/build/cjs/type/intersect/intersect-create.d.ts +3 -0
  197. package/build/cjs/type/intersect/intersect-create.js +23 -0
  198. package/build/cjs/type/intersect/intersect-evaluated.d.ts +13 -0
  199. package/build/cjs/type/intersect/intersect-evaluated.js +42 -0
  200. package/build/cjs/type/intersect/intersect-type.d.ts +15 -0
  201. package/build/cjs/type/intersect/intersect-type.js +4 -0
  202. package/build/cjs/type/intersect/intersect.d.ts +6 -0
  203. package/build/cjs/type/intersect/intersect.js +21 -0
  204. package/build/cjs/type/intrinsic/capitalize.d.ts +5 -0
  205. package/build/cjs/type/intrinsic/capitalize.js +9 -0
  206. package/build/cjs/type/intrinsic/index.d.ts +6 -0
  207. package/build/cjs/type/intrinsic/index.js +23 -0
  208. package/build/cjs/type/intrinsic/intrinsic-from-mapped-key.d.ts +14 -0
  209. package/build/cjs/type/intrinsic/intrinsic-from-mapped-key.js +30 -0
  210. package/build/cjs/type/intrinsic/intrinsic.d.ts +16 -0
  211. package/build/cjs/type/intrinsic/intrinsic.js +68 -0
  212. package/build/cjs/type/intrinsic/lowercase.d.ts +5 -0
  213. package/build/cjs/type/intrinsic/lowercase.js +9 -0
  214. package/build/cjs/type/intrinsic/uncapitalize.d.ts +5 -0
  215. package/build/cjs/type/intrinsic/uncapitalize.js +9 -0
  216. package/build/cjs/type/intrinsic/uppercase.d.ts +5 -0
  217. package/build/cjs/type/intrinsic/uppercase.js +9 -0
  218. package/build/cjs/type/iterator/index.d.ts +1 -0
  219. package/build/cjs/type/iterator/index.js +18 -0
  220. package/build/cjs/type/iterator/iterator.d.ts +11 -0
  221. package/build/cjs/type/iterator/iterator.js +10 -0
  222. package/build/cjs/type/keyof/index.d.ts +4 -0
  223. package/build/cjs/type/keyof/index.js +21 -0
  224. package/build/cjs/type/keyof/keyof-from-mapped-result.d.ts +12 -0
  225. package/build/cjs/type/keyof/keyof-from-mapped-result.js +23 -0
  226. package/build/cjs/type/keyof/keyof-property-entries.d.ts +7 -0
  227. package/build/cjs/type/keyof/keyof-property-entries.js +16 -0
  228. package/build/cjs/type/keyof/keyof-property-keys.d.ts +24 -0
  229. package/build/cjs/type/keyof/keyof-property-keys.js +78 -0
  230. package/build/cjs/type/keyof/keyof.d.ts +21 -0
  231. package/build/cjs/type/keyof/keyof.js +40 -0
  232. package/build/cjs/type/literal/index.d.ts +1 -0
  233. package/build/cjs/type/literal/index.js +18 -0
  234. package/build/cjs/type/literal/literal.d.ts +10 -0
  235. package/build/cjs/type/literal/literal.js +14 -0
  236. package/build/cjs/type/mapped/index.d.ts +3 -0
  237. package/build/cjs/type/mapped/index.js +20 -0
  238. package/build/cjs/type/mapped/mapped-key.d.ts +8 -0
  239. package/build/cjs/type/mapped/mapped-key.js +13 -0
  240. package/build/cjs/type/mapped/mapped-result.d.ts +9 -0
  241. package/build/cjs/type/mapped/mapped-result.js +13 -0
  242. package/build/cjs/type/mapped/mapped.d.ts +47 -0
  243. package/build/cjs/type/mapped/mapped.js +107 -0
  244. package/build/cjs/type/module/compute.d.ts +59 -0
  245. package/build/cjs/type/module/compute.js +205 -0
  246. package/build/cjs/type/module/index.d.ts +1 -0
  247. package/build/cjs/type/module/index.js +18 -0
  248. package/build/cjs/type/module/infer.d.ts +49 -0
  249. package/build/cjs/type/module/infer.js +3 -0
  250. package/build/cjs/type/module/module.d.ts +27 -0
  251. package/build/cjs/type/module/module.js +38 -0
  252. package/build/cjs/type/never/index.d.ts +1 -0
  253. package/build/cjs/type/never/index.js +18 -0
  254. package/build/cjs/type/never/never.d.ts +9 -0
  255. package/build/cjs/type/never/never.js +10 -0
  256. package/build/cjs/type/not/index.d.ts +1 -0
  257. package/build/cjs/type/not/index.js +18 -0
  258. package/build/cjs/type/not/not.d.ts +10 -0
  259. package/build/cjs/type/not/not.js +10 -0
  260. package/build/cjs/type/null/index.d.ts +1 -0
  261. package/build/cjs/type/null/index.js +18 -0
  262. package/build/cjs/type/null/null.d.ts +9 -0
  263. package/build/cjs/type/null/null.js +10 -0
  264. package/build/cjs/type/number/index.d.ts +1 -0
  265. package/build/cjs/type/number/index.js +18 -0
  266. package/build/cjs/type/number/number.d.ts +16 -0
  267. package/build/cjs/type/number/number.js +10 -0
  268. package/build/cjs/type/object/index.d.ts +1 -0
  269. package/build/cjs/type/object/index.js +18 -0
  270. package/build/cjs/type/object/object.d.ts +51 -0
  271. package/build/cjs/type/object/object.js +22 -0
  272. package/build/cjs/type/omit/index.d.ts +3 -0
  273. package/build/cjs/type/omit/index.js +20 -0
  274. package/build/cjs/type/omit/omit-from-mapped-key.d.ts +12 -0
  275. package/build/cjs/type/omit/omit-from-mapped-key.js +26 -0
  276. package/build/cjs/type/omit/omit-from-mapped-result.d.ts +12 -0
  277. package/build/cjs/type/omit/omit-from-mapped-result.js +23 -0
  278. package/build/cjs/type/omit/omit.d.ts +36 -0
  279. package/build/cjs/type/omit/omit.js +75 -0
  280. package/build/cjs/type/optional/index.d.ts +2 -0
  281. package/build/cjs/type/optional/index.js +19 -0
  282. package/build/cjs/type/optional/optional-from-mapped-result.d.ts +10 -0
  283. package/build/cjs/type/optional/optional-from-mapped-result.js +22 -0
  284. package/build/cjs/type/optional/optional.d.ts +20 -0
  285. package/build/cjs/type/optional/optional.js +26 -0
  286. package/build/cjs/type/parameters/index.d.ts +1 -0
  287. package/build/cjs/type/parameters/index.js +18 -0
  288. package/build/cjs/type/parameters/parameters.d.ts +7 -0
  289. package/build/cjs/type/parameters/parameters.js +44 -0
  290. package/build/cjs/type/partial/index.d.ts +2 -0
  291. package/build/cjs/type/partial/index.js +19 -0
  292. package/build/cjs/type/partial/partial-from-mapped-result.d.ts +12 -0
  293. package/build/cjs/type/partial/partial-from-mapped-result.js +23 -0
  294. package/build/cjs/type/partial/partial.d.ts +35 -0
  295. package/build/cjs/type/partial/partial.js +111 -0
  296. package/build/cjs/type/patterns/index.d.ts +1 -0
  297. package/build/cjs/type/patterns/index.js +18 -0
  298. package/build/cjs/type/patterns/patterns.d.ts +8 -0
  299. package/build/cjs/type/patterns/patterns.js +12 -0
  300. package/build/cjs/type/pick/index.d.ts +3 -0
  301. package/build/cjs/type/pick/index.js +20 -0
  302. package/build/cjs/type/pick/pick-from-mapped-key.d.ts +12 -0
  303. package/build/cjs/type/pick/pick-from-mapped-key.js +28 -0
  304. package/build/cjs/type/pick/pick-from-mapped-result.d.ts +12 -0
  305. package/build/cjs/type/pick/pick-from-mapped-result.js +23 -0
  306. package/build/cjs/type/pick/pick.d.ts +36 -0
  307. package/build/cjs/type/pick/pick.js +70 -0
  308. package/build/cjs/type/promise/index.d.ts +1 -0
  309. package/build/cjs/type/promise/index.js +18 -0
  310. package/build/cjs/type/promise/promise.d.ts +11 -0
  311. package/build/cjs/type/promise/promise.js +10 -0
  312. package/build/cjs/type/readonly/index.d.ts +2 -0
  313. package/build/cjs/type/readonly/index.js +19 -0
  314. package/build/cjs/type/readonly/readonly-from-mapped-result.d.ts +10 -0
  315. package/build/cjs/type/readonly/readonly-from-mapped-result.js +22 -0
  316. package/build/cjs/type/readonly/readonly.d.ts +20 -0
  317. package/build/cjs/type/readonly/readonly.js +26 -0
  318. package/build/cjs/type/readonly-optional/index.d.ts +1 -0
  319. package/build/cjs/type/readonly-optional/index.js +18 -0
  320. package/build/cjs/type/readonly-optional/readonly-optional.d.ts +6 -0
  321. package/build/cjs/type/readonly-optional/readonly-optional.js +10 -0
  322. package/build/cjs/type/record/index.d.ts +1 -0
  323. package/build/cjs/type/record/index.js +18 -0
  324. package/build/cjs/type/record/record.d.ts +71 -0
  325. package/build/cjs/type/record/record.js +123 -0
  326. package/build/cjs/type/recursive/index.d.ts +1 -0
  327. package/build/cjs/type/recursive/index.js +18 -0
  328. package/build/cjs/type/recursive/recursive.d.ts +16 -0
  329. package/build/cjs/type/recursive/recursive.js +19 -0
  330. package/build/cjs/type/ref/index.d.ts +1 -0
  331. package/build/cjs/type/ref/index.js +18 -0
  332. package/build/cjs/type/ref/ref.d.ts +41 -0
  333. package/build/cjs/type/ref/ref.js +14 -0
  334. package/build/cjs/type/regexp/index.d.ts +1 -0
  335. package/build/cjs/type/regexp/index.js +18 -0
  336. package/build/cjs/type/regexp/regexp.d.ts +20 -0
  337. package/build/cjs/type/regexp/regexp.js +12 -0
  338. package/build/cjs/type/registry/format.d.ts +13 -0
  339. package/build/cjs/type/registry/format.js +35 -0
  340. package/build/cjs/type/registry/index.d.ts +2 -0
  341. package/build/cjs/type/registry/index.js +39 -0
  342. package/build/cjs/type/registry/type.d.ts +13 -0
  343. package/build/cjs/type/registry/type.js +35 -0
  344. package/build/cjs/type/required/index.d.ts +2 -0
  345. package/build/cjs/type/required/index.js +19 -0
  346. package/build/cjs/type/required/required-from-mapped-result.d.ts +12 -0
  347. package/build/cjs/type/required/required-from-mapped-result.js +22 -0
  348. package/build/cjs/type/required/required.d.ts +35 -0
  349. package/build/cjs/type/required/required.js +110 -0
  350. package/build/cjs/type/rest/index.d.ts +1 -0
  351. package/build/cjs/type/rest/index.js +18 -0
  352. package/build/cjs/type/rest/rest.d.ts +10 -0
  353. package/build/cjs/type/rest/rest.js +19 -0
  354. package/build/cjs/type/return-type/index.d.ts +1 -0
  355. package/build/cjs/type/return-type/index.js +18 -0
  356. package/build/cjs/type/return-type/return-type.d.ts +6 -0
  357. package/build/cjs/type/return-type/return-type.js +44 -0
  358. package/build/cjs/type/schema/anyschema.d.ts +33 -0
  359. package/build/cjs/type/schema/anyschema.js +3 -0
  360. package/build/cjs/type/schema/index.d.ts +2 -0
  361. package/build/cjs/type/schema/index.js +19 -0
  362. package/build/cjs/type/schema/schema.d.ts +29 -0
  363. package/build/cjs/type/schema/schema.js +4 -0
  364. package/build/cjs/type/sets/index.d.ts +1 -0
  365. package/build/cjs/type/sets/index.js +18 -0
  366. package/build/cjs/type/sets/set.d.ts +28 -0
  367. package/build/cjs/type/sets/set.js +59 -0
  368. package/build/cjs/type/static/index.d.ts +1 -0
  369. package/build/cjs/type/static/index.js +18 -0
  370. package/build/cjs/type/static/static.d.ts +39 -0
  371. package/build/cjs/type/static/static.js +3 -0
  372. package/build/cjs/type/string/index.d.ts +1 -0
  373. package/build/cjs/type/string/index.js +18 -0
  374. package/build/cjs/type/string/string.d.ts +25 -0
  375. package/build/cjs/type/string/string.js +10 -0
  376. package/build/cjs/type/symbol/index.d.ts +1 -0
  377. package/build/cjs/type/symbol/index.js +18 -0
  378. package/build/cjs/type/symbol/symbol.d.ts +10 -0
  379. package/build/cjs/type/symbol/symbol.js +10 -0
  380. package/build/cjs/type/symbols/index.d.ts +1 -0
  381. package/build/cjs/type/symbols/index.js +18 -0
  382. package/build/cjs/type/symbols/symbols.d.ts +10 -0
  383. package/build/cjs/type/symbols/symbols.js +14 -0
  384. package/build/cjs/type/template-literal/finite.d.ts +19 -0
  385. package/build/cjs/type/template-literal/finite.js +56 -0
  386. package/build/cjs/type/template-literal/generate.d.ts +21 -0
  387. package/build/cjs/type/template-literal/generate.js +60 -0
  388. package/build/cjs/type/template-literal/index.d.ts +7 -0
  389. package/build/cjs/type/template-literal/index.js +24 -0
  390. package/build/cjs/type/template-literal/parse.d.ts +20 -0
  391. package/build/cjs/type/template-literal/parse.js +174 -0
  392. package/build/cjs/type/template-literal/pattern.d.ts +5 -0
  393. package/build/cjs/type/template-literal/pattern.js +39 -0
  394. package/build/cjs/type/template-literal/syntax.d.ts +20 -0
  395. package/build/cjs/type/template-literal/syntax.js +59 -0
  396. package/build/cjs/type/template-literal/template-literal.d.ts +30 -0
  397. package/build/cjs/type/template-literal/template-literal.js +17 -0
  398. package/build/cjs/type/template-literal/union.d.ts +9 -0
  399. package/build/cjs/type/template-literal/union.js +13 -0
  400. package/build/cjs/type/transform/index.d.ts +1 -0
  401. package/build/cjs/type/transform/index.js +18 -0
  402. package/build/cjs/type/transform/transform.d.ts +30 -0
  403. package/build/cjs/type/transform/transform.js +47 -0
  404. package/build/cjs/type/tuple/index.d.ts +1 -0
  405. package/build/cjs/type/tuple/index.js +18 -0
  406. package/build/cjs/type/tuple/tuple.d.ts +16 -0
  407. package/build/cjs/type/tuple/tuple.js +13 -0
  408. package/build/cjs/type/type/index.d.ts +6 -0
  409. package/build/cjs/type/type/index.js +51 -0
  410. package/build/cjs/type/type/javascript.d.ts +64 -0
  411. package/build/cjs/type/type/javascript.js +104 -0
  412. package/build/cjs/type/type/json.d.ts +208 -0
  413. package/build/cjs/type/type/json.js +226 -0
  414. package/build/cjs/type/type/type.d.ts +59 -0
  415. package/build/cjs/type/type/type.js +129 -0
  416. package/build/cjs/type/uint8array/index.d.ts +1 -0
  417. package/build/cjs/type/uint8array/index.js +18 -0
  418. package/build/cjs/type/uint8array/uint8array.d.ts +13 -0
  419. package/build/cjs/type/uint8array/uint8array.js +10 -0
  420. package/build/cjs/type/undefined/index.d.ts +1 -0
  421. package/build/cjs/type/undefined/index.js +18 -0
  422. package/build/cjs/type/undefined/undefined.d.ts +9 -0
  423. package/build/cjs/type/undefined/undefined.js +10 -0
  424. package/build/cjs/type/union/index.d.ts +3 -0
  425. package/build/cjs/type/union/index.js +20 -0
  426. package/build/cjs/type/union/union-create.d.ts +3 -0
  427. package/build/cjs/type/union/union-create.js +9 -0
  428. package/build/cjs/type/union/union-evaluated.d.ts +13 -0
  429. package/build/cjs/type/union/union-evaluated.js +40 -0
  430. package/build/cjs/type/union/union-type.d.ts +12 -0
  431. package/build/cjs/type/union/union-type.js +4 -0
  432. package/build/cjs/type/union/union.d.ts +6 -0
  433. package/build/cjs/type/union/union.js +14 -0
  434. package/build/cjs/type/unknown/index.d.ts +1 -0
  435. package/build/cjs/type/unknown/index.js +18 -0
  436. package/build/cjs/type/unknown/unknown.d.ts +8 -0
  437. package/build/cjs/type/unknown/unknown.js +10 -0
  438. package/build/cjs/type/unsafe/index.d.ts +1 -0
  439. package/build/cjs/type/unsafe/index.js +18 -0
  440. package/build/cjs/type/unsafe/unsafe.d.ts +11 -0
  441. package/build/cjs/type/unsafe/unsafe.js +10 -0
  442. package/build/cjs/type/void/index.d.ts +1 -0
  443. package/build/cjs/type/void/index.js +18 -0
  444. package/build/cjs/type/void/void.d.ts +9 -0
  445. package/build/cjs/type/void/void.js +10 -0
  446. package/build/cjs/value/assert/assert.d.ts +15 -0
  447. package/build/cjs/value/assert/assert.js +55 -0
  448. package/build/cjs/value/assert/index.d.ts +1 -0
  449. package/build/cjs/value/assert/index.js +18 -0
  450. package/build/cjs/value/cast/cast.d.ts +11 -0
  451. package/build/cjs/value/cast/cast.js +241 -0
  452. package/build/cjs/value/cast/index.d.ts +1 -0
  453. package/build/cjs/value/cast/index.js +18 -0
  454. package/build/cjs/value/check/check.d.ts +11 -0
  455. package/build/cjs/value/check/check.js +476 -0
  456. package/build/cjs/value/check/index.d.ts +1 -0
  457. package/build/cjs/value/check/index.js +18 -0
  458. package/build/cjs/value/clean/clean.d.ts +5 -0
  459. package/build/cjs/value/clean/clean.js +149 -0
  460. package/build/cjs/value/clean/index.d.ts +1 -0
  461. package/build/cjs/value/clean/index.js +18 -0
  462. package/build/cjs/value/clone/clone.d.ts +2 -0
  463. package/build/cjs/value/clone/clone.js +60 -0
  464. package/build/cjs/value/clone/index.d.ts +1 -0
  465. package/build/cjs/value/clone/index.js +18 -0
  466. package/build/cjs/value/convert/convert.d.ts +5 -0
  467. package/build/cjs/value/convert/convert.js +264 -0
  468. package/build/cjs/value/convert/index.d.ts +1 -0
  469. package/build/cjs/value/convert/index.js +18 -0
  470. package/build/cjs/value/create/create.d.ts +11 -0
  471. package/build/cjs/value/create/create.js +474 -0
  472. package/build/cjs/value/create/index.d.ts +1 -0
  473. package/build/cjs/value/create/index.js +18 -0
  474. package/build/cjs/value/decode/decode.d.ts +6 -0
  475. package/build/cjs/value/decode/decode.js +14 -0
  476. package/build/cjs/value/decode/index.d.ts +1 -0
  477. package/build/cjs/value/decode/index.js +18 -0
  478. package/build/cjs/value/default/default.d.ts +5 -0
  479. package/build/cjs/value/default/default.js +176 -0
  480. package/build/cjs/value/default/index.d.ts +1 -0
  481. package/build/cjs/value/default/index.js +18 -0
  482. package/build/cjs/value/delta/delta.d.ts +32 -0
  483. package/build/cjs/value/delta/delta.js +178 -0
  484. package/build/cjs/value/delta/index.d.ts +1 -0
  485. package/build/cjs/value/delta/index.js +18 -0
  486. package/build/cjs/value/deref/deref.d.ts +12 -0
  487. package/build/cjs/value/deref/deref.js +36 -0
  488. package/build/cjs/value/deref/index.d.ts +1 -0
  489. package/build/cjs/value/deref/index.js +18 -0
  490. package/build/cjs/value/encode/encode.d.ts +6 -0
  491. package/build/cjs/value/encode/encode.js +15 -0
  492. package/build/cjs/value/encode/index.d.ts +1 -0
  493. package/build/cjs/value/encode/index.js +18 -0
  494. package/build/cjs/value/equal/equal.d.ts +2 -0
  495. package/build/cjs/value/equal/equal.js +50 -0
  496. package/build/cjs/value/equal/index.d.ts +1 -0
  497. package/build/cjs/value/equal/index.js +18 -0
  498. package/build/cjs/value/guard/guard.d.ts +74 -0
  499. package/build/cjs/value/guard/guard.js +195 -0
  500. package/build/cjs/value/guard/index.d.ts +1 -0
  501. package/build/cjs/value/guard/index.js +18 -0
  502. package/build/cjs/value/hash/hash.d.ts +7 -0
  503. package/build/cjs/value/hash/hash.js +152 -0
  504. package/build/cjs/value/hash/index.d.ts +1 -0
  505. package/build/cjs/value/hash/index.js +18 -0
  506. package/build/cjs/value/index.d.ts +20 -0
  507. package/build/cjs/value/index.js +53 -0
  508. package/build/cjs/value/mutate/index.d.ts +1 -0
  509. package/build/cjs/value/mutate/index.js +18 -0
  510. package/build/cjs/value/mutate/mutate.d.ts +9 -0
  511. package/build/cjs/value/mutate/mutate.js +104 -0
  512. package/build/cjs/value/parse/index.d.ts +1 -0
  513. package/build/cjs/value/parse/index.js +18 -0
  514. package/build/cjs/value/parse/parse.d.ts +22 -0
  515. package/build/cjs/value/parse/parse.js +87 -0
  516. package/build/cjs/value/pointer/index.d.ts +1 -0
  517. package/build/cjs/value/pointer/index.js +38 -0
  518. package/build/cjs/value/pointer/pointer.d.ts +22 -0
  519. package/build/cjs/value/pointer/pointer.js +126 -0
  520. package/build/cjs/value/transform/decode.d.ts +22 -0
  521. package/build/cjs/value/transform/decode.js +214 -0
  522. package/build/cjs/value/transform/encode.d.ts +23 -0
  523. package/build/cjs/value/transform/encode.js +225 -0
  524. package/build/cjs/value/transform/has.d.ts +3 -0
  525. package/build/cjs/value/transform/has.js +133 -0
  526. package/build/cjs/value/transform/index.d.ts +3 -0
  527. package/build/cjs/value/transform/index.js +20 -0
  528. package/build/cjs/value/value/index.d.ts +1 -0
  529. package/build/cjs/value/value/index.js +38 -0
  530. package/build/cjs/value/value/value.d.ts +16 -0
  531. package/build/cjs/value/value/value.js +39 -0
  532. package/build/esm/compiler/compiler.d.mts +55 -0
  533. package/build/esm/compiler/compiler.mjs +663 -0
  534. package/build/esm/compiler/index.d.mts +2 -0
  535. package/build/esm/compiler/index.mjs +2 -0
  536. package/build/esm/errors/errors.d.mts +91 -0
  537. package/build/esm/errors/errors.mjs +592 -0
  538. package/build/esm/errors/function.d.mts +21 -0
  539. package/build/esm/errors/function.mjs +147 -0
  540. package/build/esm/errors/index.d.mts +2 -0
  541. package/build/esm/errors/index.mjs +2 -0
  542. package/build/esm/index.d.mts +71 -0
  543. package/build/esm/index.mjs +80 -0
  544. package/build/esm/parser/index.d.mts +2 -0
  545. package/build/esm/parser/index.mjs +2 -0
  546. package/build/esm/parser/runtime/guard.d.mts +23 -0
  547. package/build/esm/parser/runtime/guard.mjs +72 -0
  548. package/build/esm/parser/runtime/index.d.mts +5 -0
  549. package/build/esm/parser/runtime/index.mjs +5 -0
  550. package/build/esm/parser/runtime/module.d.mts +9 -0
  551. package/build/esm/parser/runtime/module.mjs +17 -0
  552. package/build/esm/parser/runtime/parse.d.mts +9 -0
  553. package/build/esm/parser/runtime/parse.mjs +123 -0
  554. package/build/esm/parser/runtime/token.d.mts +8 -0
  555. package/build/esm/parser/runtime/token.mjs +223 -0
  556. package/build/esm/parser/runtime/types.d.mts +98 -0
  557. package/build/esm/parser/runtime/types.mjs +55 -0
  558. package/build/esm/parser/static/index.d.mts +3 -0
  559. package/build/esm/parser/static/index.mjs +3 -0
  560. package/build/esm/parser/static/parse.d.mts +20 -0
  561. package/build/esm/parser/static/parse.mjs +1 -0
  562. package/build/esm/parser/static/token.d.mts +108 -0
  563. package/build/esm/parser/static/token.mjs +1 -0
  564. package/build/esm/parser/static/types.d.mts +69 -0
  565. package/build/esm/parser/static/types.mjs +1 -0
  566. package/build/esm/syntax/index.d.mts +1 -0
  567. package/build/esm/syntax/index.mjs +1 -0
  568. package/build/esm/syntax/mapping.d.mts +167 -0
  569. package/build/esm/syntax/mapping.mjs +386 -0
  570. package/build/esm/syntax/parser.d.mts +162 -0
  571. package/build/esm/syntax/parser.mjs +78 -0
  572. package/build/esm/syntax/syntax.d.mts +12 -0
  573. package/build/esm/syntax/syntax.mjs +16 -0
  574. package/build/esm/system/index.d.mts +2 -0
  575. package/build/esm/system/index.mjs +2 -0
  576. package/build/esm/system/policy.d.mts +29 -0
  577. package/build/esm/system/policy.mjs +54 -0
  578. package/build/esm/system/system.d.mts +16 -0
  579. package/build/esm/system/system.mjs +37 -0
  580. package/build/esm/type/any/any.d.mts +8 -0
  581. package/build/esm/type/any/any.mjs +6 -0
  582. package/build/esm/type/any/index.d.mts +1 -0
  583. package/build/esm/type/any/index.mjs +1 -0
  584. package/build/esm/type/argument/argument.d.mts +9 -0
  585. package/build/esm/type/argument/argument.mjs +6 -0
  586. package/build/esm/type/argument/index.d.mts +1 -0
  587. package/build/esm/type/argument/index.mjs +1 -0
  588. package/build/esm/type/array/array.d.mts +28 -0
  589. package/build/esm/type/array/array.mjs +6 -0
  590. package/build/esm/type/array/index.d.mts +1 -0
  591. package/build/esm/type/array/index.mjs +1 -0
  592. package/build/esm/type/async-iterator/async-iterator.d.mts +11 -0
  593. package/build/esm/type/async-iterator/async-iterator.mjs +6 -0
  594. package/build/esm/type/async-iterator/index.d.mts +1 -0
  595. package/build/esm/type/async-iterator/index.mjs +1 -0
  596. package/build/esm/type/awaited/awaited.d.mts +14 -0
  597. package/build/esm/type/awaited/awaited.mjs +37 -0
  598. package/build/esm/type/awaited/index.d.mts +1 -0
  599. package/build/esm/type/awaited/index.mjs +1 -0
  600. package/build/esm/type/bigint/bigint.d.mts +16 -0
  601. package/build/esm/type/bigint/bigint.mjs +6 -0
  602. package/build/esm/type/bigint/index.d.mts +1 -0
  603. package/build/esm/type/bigint/index.mjs +1 -0
  604. package/build/esm/type/boolean/boolean.d.mts +9 -0
  605. package/build/esm/type/boolean/boolean.mjs +6 -0
  606. package/build/esm/type/boolean/index.d.mts +1 -0
  607. package/build/esm/type/boolean/index.mjs +1 -0
  608. package/build/esm/type/clone/index.d.mts +2 -0
  609. package/build/esm/type/clone/index.mjs +2 -0
  610. package/build/esm/type/clone/type.d.mts +5 -0
  611. package/build/esm/type/clone/type.mjs +9 -0
  612. package/build/esm/type/clone/value.d.mts +2 -0
  613. package/build/esm/type/clone/value.mjs +36 -0
  614. package/build/esm/type/composite/composite.d.mts +18 -0
  615. package/build/esm/type/composite/composite.mjs +42 -0
  616. package/build/esm/type/composite/index.d.mts +1 -0
  617. package/build/esm/type/composite/index.mjs +1 -0
  618. package/build/esm/type/computed/computed.d.mts +9 -0
  619. package/build/esm/type/computed/computed.mjs +6 -0
  620. package/build/esm/type/computed/index.d.mts +1 -0
  621. package/build/esm/type/computed/index.mjs +1 -0
  622. package/build/esm/type/const/const.d.mts +27 -0
  623. package/build/esm/type/const/const.mjs +54 -0
  624. package/build/esm/type/const/index.d.mts +1 -0
  625. package/build/esm/type/const/index.mjs +1 -0
  626. package/build/esm/type/constructor/constructor.d.mts +23 -0
  627. package/build/esm/type/constructor/constructor.mjs +6 -0
  628. package/build/esm/type/constructor/index.d.mts +1 -0
  629. package/build/esm/type/constructor/index.mjs +1 -0
  630. package/build/esm/type/constructor-parameters/constructor-parameters.d.mts +7 -0
  631. package/build/esm/type/constructor-parameters/constructor-parameters.mjs +7 -0
  632. package/build/esm/type/constructor-parameters/index.d.mts +1 -0
  633. package/build/esm/type/constructor-parameters/index.mjs +1 -0
  634. package/build/esm/type/create/immutable.d.mts +2 -0
  635. package/build/esm/type/create/immutable.mjs +33 -0
  636. package/build/esm/type/create/index.d.mts +1 -0
  637. package/build/esm/type/create/index.mjs +1 -0
  638. package/build/esm/type/create/type.d.mts +3 -0
  639. package/build/esm/type/create/type.mjs +15 -0
  640. package/build/esm/type/date/date.d.mts +21 -0
  641. package/build/esm/type/date/date.mjs +6 -0
  642. package/build/esm/type/date/index.d.mts +1 -0
  643. package/build/esm/type/date/index.mjs +1 -0
  644. package/build/esm/type/discard/discard.d.mts +2 -0
  645. package/build/esm/type/discard/discard.mjs +8 -0
  646. package/build/esm/type/discard/index.d.mts +1 -0
  647. package/build/esm/type/discard/index.mjs +1 -0
  648. package/build/esm/type/enum/enum.d.mts +14 -0
  649. package/build/esm/type/enum/enum.mjs +18 -0
  650. package/build/esm/type/enum/index.d.mts +1 -0
  651. package/build/esm/type/enum/index.mjs +1 -0
  652. package/build/esm/type/error/error.d.mts +4 -0
  653. package/build/esm/type/error/error.mjs +6 -0
  654. package/build/esm/type/error/index.d.mts +1 -0
  655. package/build/esm/type/error/index.mjs +1 -0
  656. package/build/esm/type/exclude/exclude-from-mapped-result.d.mts +11 -0
  657. package/build/esm/type/exclude/exclude-from-mapped-result.mjs +18 -0
  658. package/build/esm/type/exclude/exclude-from-template-literal.d.mts +5 -0
  659. package/build/esm/type/exclude/exclude-from-template-literal.mjs +5 -0
  660. package/build/esm/type/exclude/exclude.d.mts +21 -0
  661. package/build/esm/type/exclude/exclude.mjs +25 -0
  662. package/build/esm/type/exclude/index.d.mts +3 -0
  663. package/build/esm/type/exclude/index.mjs +3 -0
  664. package/build/esm/type/extends/extends-check.d.mts +10 -0
  665. package/build/esm/type/extends/extends-check.mjs +635 -0
  666. package/build/esm/type/extends/extends-from-mapped-key.d.mts +14 -0
  667. package/build/esm/type/extends/extends-from-mapped-key.mjs +25 -0
  668. package/build/esm/type/extends/extends-from-mapped-result.d.mts +11 -0
  669. package/build/esm/type/extends/extends-from-mapped-result.mjs +19 -0
  670. package/build/esm/type/extends/extends-undefined.d.mts +3 -0
  671. package/build/esm/type/extends/extends-undefined.mjs +20 -0
  672. package/build/esm/type/extends/extends.d.mts +16 -0
  673. package/build/esm/type/extends/extends.mjs +23 -0
  674. package/build/esm/type/extends/index.d.mts +5 -0
  675. package/build/esm/type/extends/index.mjs +5 -0
  676. package/build/esm/type/extract/extract-from-mapped-result.d.mts +11 -0
  677. package/build/esm/type/extract/extract-from-mapped-result.mjs +18 -0
  678. package/build/esm/type/extract/extract-from-template-literal.d.mts +5 -0
  679. package/build/esm/type/extract/extract-from-template-literal.mjs +5 -0
  680. package/build/esm/type/extract/extract.d.mts +21 -0
  681. package/build/esm/type/extract/extract.mjs +25 -0
  682. package/build/esm/type/extract/index.d.mts +3 -0
  683. package/build/esm/type/extract/index.mjs +3 -0
  684. package/build/esm/type/function/function.d.mts +23 -0
  685. package/build/esm/type/function/function.mjs +6 -0
  686. package/build/esm/type/function/index.d.mts +1 -0
  687. package/build/esm/type/function/index.mjs +1 -0
  688. package/build/esm/type/guard/index.d.mts +3 -0
  689. package/build/esm/type/guard/index.mjs +3 -0
  690. package/build/esm/type/guard/kind.d.mts +147 -0
  691. package/build/esm/type/guard/kind.mjs +235 -0
  692. package/build/esm/type/guard/type.d.mts +152 -0
  693. package/build/esm/type/guard/type.mjs +509 -0
  694. package/build/esm/type/guard/value.d.mts +34 -0
  695. package/build/esm/type/guard/value.mjs +70 -0
  696. package/build/esm/type/helpers/helpers.d.mts +42 -0
  697. package/build/esm/type/helpers/helpers.mjs +4 -0
  698. package/build/esm/type/helpers/index.d.mts +1 -0
  699. package/build/esm/type/helpers/index.mjs +1 -0
  700. package/build/esm/type/index.d.mts +71 -0
  701. package/build/esm/type/index.mjs +71 -0
  702. package/build/esm/type/indexed/index.d.mts +4 -0
  703. package/build/esm/type/indexed/index.mjs +4 -0
  704. package/build/esm/type/indexed/indexed-from-mapped-key.d.mts +13 -0
  705. package/build/esm/type/indexed/indexed-from-mapped-key.mjs +22 -0
  706. package/build/esm/type/indexed/indexed-from-mapped-result.d.mts +12 -0
  707. package/build/esm/type/indexed/indexed-from-mapped-result.mjs +20 -0
  708. package/build/esm/type/indexed/indexed-property-keys.d.mts +14 -0
  709. package/build/esm/type/indexed/indexed-property-keys.mjs +32 -0
  710. package/build/esm/type/indexed/indexed.d.mts +52 -0
  711. package/build/esm/type/indexed/indexed.mjs +91 -0
  712. package/build/esm/type/instance-type/index.d.mts +1 -0
  713. package/build/esm/type/instance-type/index.mjs +1 -0
  714. package/build/esm/type/instance-type/instance-type.d.mts +6 -0
  715. package/build/esm/type/instance-type/instance-type.mjs +7 -0
  716. package/build/esm/type/instantiate/index.d.mts +1 -0
  717. package/build/esm/type/instantiate/index.mjs +1 -0
  718. package/build/esm/type/instantiate/instantiate.d.mts +50 -0
  719. package/build/esm/type/instantiate/instantiate.mjs +115 -0
  720. package/build/esm/type/integer/index.d.mts +1 -0
  721. package/build/esm/type/integer/index.mjs +1 -0
  722. package/build/esm/type/integer/integer.d.mts +16 -0
  723. package/build/esm/type/integer/integer.mjs +6 -0
  724. package/build/esm/type/intersect/index.d.mts +3 -0
  725. package/build/esm/type/intersect/index.mjs +3 -0
  726. package/build/esm/type/intersect/intersect-create.d.mts +3 -0
  727. package/build/esm/type/intersect/intersect-create.mjs +19 -0
  728. package/build/esm/type/intersect/intersect-evaluated.d.mts +13 -0
  729. package/build/esm/type/intersect/intersect-evaluated.mjs +38 -0
  730. package/build/esm/type/intersect/intersect-type.d.mts +15 -0
  731. package/build/esm/type/intersect/intersect-type.mjs +1 -0
  732. package/build/esm/type/intersect/intersect.d.mts +6 -0
  733. package/build/esm/type/intersect/intersect.mjs +17 -0
  734. package/build/esm/type/intrinsic/capitalize.d.mts +5 -0
  735. package/build/esm/type/intrinsic/capitalize.mjs +5 -0
  736. package/build/esm/type/intrinsic/index.d.mts +6 -0
  737. package/build/esm/type/intrinsic/index.mjs +6 -0
  738. package/build/esm/type/intrinsic/intrinsic-from-mapped-key.d.mts +14 -0
  739. package/build/esm/type/intrinsic/intrinsic-from-mapped-key.mjs +26 -0
  740. package/build/esm/type/intrinsic/intrinsic.d.mts +16 -0
  741. package/build/esm/type/intrinsic/intrinsic.mjs +64 -0
  742. package/build/esm/type/intrinsic/lowercase.d.mts +5 -0
  743. package/build/esm/type/intrinsic/lowercase.mjs +5 -0
  744. package/build/esm/type/intrinsic/uncapitalize.d.mts +5 -0
  745. package/build/esm/type/intrinsic/uncapitalize.mjs +5 -0
  746. package/build/esm/type/intrinsic/uppercase.d.mts +5 -0
  747. package/build/esm/type/intrinsic/uppercase.mjs +5 -0
  748. package/build/esm/type/iterator/index.d.mts +1 -0
  749. package/build/esm/type/iterator/index.mjs +1 -0
  750. package/build/esm/type/iterator/iterator.d.mts +11 -0
  751. package/build/esm/type/iterator/iterator.mjs +6 -0
  752. package/build/esm/type/keyof/index.d.mts +4 -0
  753. package/build/esm/type/keyof/index.mjs +4 -0
  754. package/build/esm/type/keyof/keyof-from-mapped-result.d.mts +12 -0
  755. package/build/esm/type/keyof/keyof-from-mapped-result.mjs +19 -0
  756. package/build/esm/type/keyof/keyof-property-entries.d.mts +7 -0
  757. package/build/esm/type/keyof/keyof-property-entries.mjs +12 -0
  758. package/build/esm/type/keyof/keyof-property-keys.d.mts +24 -0
  759. package/build/esm/type/keyof/keyof-property-keys.mjs +73 -0
  760. package/build/esm/type/keyof/keyof.d.mts +21 -0
  761. package/build/esm/type/keyof/keyof.mjs +35 -0
  762. package/build/esm/type/literal/index.d.mts +1 -0
  763. package/build/esm/type/literal/index.mjs +1 -0
  764. package/build/esm/type/literal/literal.d.mts +10 -0
  765. package/build/esm/type/literal/literal.mjs +10 -0
  766. package/build/esm/type/mapped/index.d.mts +3 -0
  767. package/build/esm/type/mapped/index.mjs +3 -0
  768. package/build/esm/type/mapped/mapped-key.d.mts +8 -0
  769. package/build/esm/type/mapped/mapped-key.mjs +9 -0
  770. package/build/esm/type/mapped/mapped-result.d.mts +9 -0
  771. package/build/esm/type/mapped/mapped-result.mjs +9 -0
  772. package/build/esm/type/mapped/mapped.d.mts +47 -0
  773. package/build/esm/type/mapped/mapped.mjs +102 -0
  774. package/build/esm/type/module/compute.d.mts +59 -0
  775. package/build/esm/type/module/compute.mjs +166 -0
  776. package/build/esm/type/module/index.d.mts +1 -0
  777. package/build/esm/type/module/index.mjs +1 -0
  778. package/build/esm/type/module/infer.d.mts +49 -0
  779. package/build/esm/type/module/infer.mjs +1 -0
  780. package/build/esm/type/module/module.d.mts +27 -0
  781. package/build/esm/type/module/module.mjs +32 -0
  782. package/build/esm/type/never/index.d.mts +1 -0
  783. package/build/esm/type/never/index.mjs +1 -0
  784. package/build/esm/type/never/never.d.mts +9 -0
  785. package/build/esm/type/never/never.mjs +6 -0
  786. package/build/esm/type/not/index.d.mts +1 -0
  787. package/build/esm/type/not/index.mjs +1 -0
  788. package/build/esm/type/not/not.d.mts +10 -0
  789. package/build/esm/type/not/not.mjs +6 -0
  790. package/build/esm/type/null/index.d.mts +1 -0
  791. package/build/esm/type/null/index.mjs +1 -0
  792. package/build/esm/type/null/null.d.mts +9 -0
  793. package/build/esm/type/null/null.mjs +6 -0
  794. package/build/esm/type/number/index.d.mts +1 -0
  795. package/build/esm/type/number/index.mjs +1 -0
  796. package/build/esm/type/number/number.d.mts +16 -0
  797. package/build/esm/type/number/number.mjs +6 -0
  798. package/build/esm/type/object/index.d.mts +1 -0
  799. package/build/esm/type/object/index.mjs +1 -0
  800. package/build/esm/type/object/object.d.mts +51 -0
  801. package/build/esm/type/object/object.mjs +18 -0
  802. package/build/esm/type/omit/index.d.mts +3 -0
  803. package/build/esm/type/omit/index.mjs +3 -0
  804. package/build/esm/type/omit/omit-from-mapped-key.d.mts +12 -0
  805. package/build/esm/type/omit/omit-from-mapped-key.mjs +22 -0
  806. package/build/esm/type/omit/omit-from-mapped-result.d.mts +12 -0
  807. package/build/esm/type/omit/omit-from-mapped-result.mjs +19 -0
  808. package/build/esm/type/omit/omit.d.mts +36 -0
  809. package/build/esm/type/omit/omit.mjs +71 -0
  810. package/build/esm/type/optional/index.d.mts +2 -0
  811. package/build/esm/type/optional/index.mjs +2 -0
  812. package/build/esm/type/optional/optional-from-mapped-result.d.mts +10 -0
  813. package/build/esm/type/optional/optional-from-mapped-result.mjs +18 -0
  814. package/build/esm/type/optional/optional.d.mts +20 -0
  815. package/build/esm/type/optional/optional.mjs +22 -0
  816. package/build/esm/type/parameters/index.d.mts +1 -0
  817. package/build/esm/type/parameters/index.mjs +1 -0
  818. package/build/esm/type/parameters/parameters.d.mts +7 -0
  819. package/build/esm/type/parameters/parameters.mjs +7 -0
  820. package/build/esm/type/partial/index.d.mts +2 -0
  821. package/build/esm/type/partial/index.mjs +2 -0
  822. package/build/esm/type/partial/partial-from-mapped-result.d.mts +12 -0
  823. package/build/esm/type/partial/partial-from-mapped-result.mjs +19 -0
  824. package/build/esm/type/partial/partial.d.mts +35 -0
  825. package/build/esm/type/partial/partial.mjs +74 -0
  826. package/build/esm/type/patterns/index.d.mts +1 -0
  827. package/build/esm/type/patterns/index.mjs +1 -0
  828. package/build/esm/type/patterns/patterns.d.mts +8 -0
  829. package/build/esm/type/patterns/patterns.mjs +8 -0
  830. package/build/esm/type/pick/index.d.mts +3 -0
  831. package/build/esm/type/pick/index.mjs +3 -0
  832. package/build/esm/type/pick/pick-from-mapped-key.d.mts +12 -0
  833. package/build/esm/type/pick/pick-from-mapped-key.mjs +24 -0
  834. package/build/esm/type/pick/pick-from-mapped-result.d.mts +12 -0
  835. package/build/esm/type/pick/pick-from-mapped-result.mjs +19 -0
  836. package/build/esm/type/pick/pick.d.mts +36 -0
  837. package/build/esm/type/pick/pick.mjs +66 -0
  838. package/build/esm/type/promise/index.d.mts +1 -0
  839. package/build/esm/type/promise/index.mjs +1 -0
  840. package/build/esm/type/promise/promise.d.mts +11 -0
  841. package/build/esm/type/promise/promise.mjs +6 -0
  842. package/build/esm/type/readonly/index.d.mts +2 -0
  843. package/build/esm/type/readonly/index.mjs +2 -0
  844. package/build/esm/type/readonly/readonly-from-mapped-result.d.mts +10 -0
  845. package/build/esm/type/readonly/readonly-from-mapped-result.mjs +18 -0
  846. package/build/esm/type/readonly/readonly.d.mts +20 -0
  847. package/build/esm/type/readonly/readonly.mjs +22 -0
  848. package/build/esm/type/readonly-optional/index.d.mts +1 -0
  849. package/build/esm/type/readonly-optional/index.mjs +1 -0
  850. package/build/esm/type/readonly-optional/readonly-optional.d.mts +6 -0
  851. package/build/esm/type/readonly-optional/readonly-optional.mjs +6 -0
  852. package/build/esm/type/record/index.d.mts +1 -0
  853. package/build/esm/type/record/index.mjs +1 -0
  854. package/build/esm/type/record/record.d.mts +71 -0
  855. package/build/esm/type/record/record.mjs +116 -0
  856. package/build/esm/type/recursive/index.d.mts +1 -0
  857. package/build/esm/type/recursive/index.mjs +1 -0
  858. package/build/esm/type/recursive/recursive.d.mts +16 -0
  859. package/build/esm/type/recursive/recursive.mjs +15 -0
  860. package/build/esm/type/ref/index.d.mts +1 -0
  861. package/build/esm/type/ref/index.mjs +1 -0
  862. package/build/esm/type/ref/ref.d.mts +41 -0
  863. package/build/esm/type/ref/ref.mjs +10 -0
  864. package/build/esm/type/regexp/index.d.mts +1 -0
  865. package/build/esm/type/regexp/index.mjs +1 -0
  866. package/build/esm/type/regexp/regexp.d.mts +20 -0
  867. package/build/esm/type/regexp/regexp.mjs +8 -0
  868. package/build/esm/type/registry/format.d.mts +13 -0
  869. package/build/esm/type/registry/format.mjs +26 -0
  870. package/build/esm/type/registry/index.d.mts +2 -0
  871. package/build/esm/type/registry/index.mjs +2 -0
  872. package/build/esm/type/registry/type.d.mts +13 -0
  873. package/build/esm/type/registry/type.mjs +26 -0
  874. package/build/esm/type/required/index.d.mts +2 -0
  875. package/build/esm/type/required/index.mjs +2 -0
  876. package/build/esm/type/required/required-from-mapped-result.d.mts +12 -0
  877. package/build/esm/type/required/required-from-mapped-result.mjs +18 -0
  878. package/build/esm/type/required/required.d.mts +35 -0
  879. package/build/esm/type/required/required.mjs +73 -0
  880. package/build/esm/type/rest/index.d.mts +1 -0
  881. package/build/esm/type/rest/index.mjs +1 -0
  882. package/build/esm/type/rest/rest.d.mts +10 -0
  883. package/build/esm/type/rest/rest.mjs +15 -0
  884. package/build/esm/type/return-type/index.d.mts +1 -0
  885. package/build/esm/type/return-type/index.mjs +1 -0
  886. package/build/esm/type/return-type/return-type.d.mts +6 -0
  887. package/build/esm/type/return-type/return-type.mjs +7 -0
  888. package/build/esm/type/schema/anyschema.d.mts +33 -0
  889. package/build/esm/type/schema/anyschema.mjs +1 -0
  890. package/build/esm/type/schema/index.d.mts +2 -0
  891. package/build/esm/type/schema/index.mjs +2 -0
  892. package/build/esm/type/schema/schema.d.mts +29 -0
  893. package/build/esm/type/schema/schema.mjs +1 -0
  894. package/build/esm/type/sets/index.d.mts +1 -0
  895. package/build/esm/type/sets/index.mjs +1 -0
  896. package/build/esm/type/sets/set.d.mts +28 -0
  897. package/build/esm/type/sets/set.mjs +48 -0
  898. package/build/esm/type/static/index.d.mts +1 -0
  899. package/build/esm/type/static/index.mjs +1 -0
  900. package/build/esm/type/static/static.d.mts +39 -0
  901. package/build/esm/type/static/static.mjs +1 -0
  902. package/build/esm/type/string/index.d.mts +1 -0
  903. package/build/esm/type/string/index.mjs +1 -0
  904. package/build/esm/type/string/string.d.mts +25 -0
  905. package/build/esm/type/string/string.mjs +6 -0
  906. package/build/esm/type/symbol/index.d.mts +1 -0
  907. package/build/esm/type/symbol/index.mjs +1 -0
  908. package/build/esm/type/symbol/symbol.d.mts +10 -0
  909. package/build/esm/type/symbol/symbol.mjs +6 -0
  910. package/build/esm/type/symbols/index.d.mts +1 -0
  911. package/build/esm/type/symbols/index.mjs +1 -0
  912. package/build/esm/type/symbols/symbols.d.mts +10 -0
  913. package/build/esm/type/symbols/symbols.mjs +10 -0
  914. package/build/esm/type/template-literal/finite.d.mts +19 -0
  915. package/build/esm/type/template-literal/finite.mjs +49 -0
  916. package/build/esm/type/template-literal/generate.d.mts +21 -0
  917. package/build/esm/type/template-literal/generate.mjs +53 -0
  918. package/build/esm/type/template-literal/index.d.mts +7 -0
  919. package/build/esm/type/template-literal/index.mjs +7 -0
  920. package/build/esm/type/template-literal/parse.d.mts +20 -0
  921. package/build/esm/type/template-literal/parse.mjs +167 -0
  922. package/build/esm/type/template-literal/pattern.d.mts +5 -0
  923. package/build/esm/type/template-literal/pattern.mjs +33 -0
  924. package/build/esm/type/template-literal/syntax.d.mts +20 -0
  925. package/build/esm/type/template-literal/syntax.mjs +55 -0
  926. package/build/esm/type/template-literal/template-literal.d.mts +30 -0
  927. package/build/esm/type/template-literal/template-literal.mjs +13 -0
  928. package/build/esm/type/template-literal/union.d.mts +9 -0
  929. package/build/esm/type/template-literal/union.mjs +9 -0
  930. package/build/esm/type/transform/index.d.mts +1 -0
  931. package/build/esm/type/transform/index.mjs +1 -0
  932. package/build/esm/type/transform/transform.d.mts +30 -0
  933. package/build/esm/type/transform/transform.mjs +40 -0
  934. package/build/esm/type/tuple/index.d.mts +1 -0
  935. package/build/esm/type/tuple/index.mjs +1 -0
  936. package/build/esm/type/tuple/tuple.d.mts +16 -0
  937. package/build/esm/type/tuple/tuple.mjs +9 -0
  938. package/build/esm/type/type/index.d.mts +6 -0
  939. package/build/esm/type/type/index.mjs +13 -0
  940. package/build/esm/type/type/javascript.d.mts +64 -0
  941. package/build/esm/type/type/javascript.mjs +99 -0
  942. package/build/esm/type/type/json.d.mts +208 -0
  943. package/build/esm/type/type/json.mjs +221 -0
  944. package/build/esm/type/type/type.d.mts +59 -0
  945. package/build/esm/type/type/type.mjs +62 -0
  946. package/build/esm/type/uint8array/index.d.mts +1 -0
  947. package/build/esm/type/uint8array/index.mjs +1 -0
  948. package/build/esm/type/uint8array/uint8array.d.mts +13 -0
  949. package/build/esm/type/uint8array/uint8array.mjs +6 -0
  950. package/build/esm/type/undefined/index.d.mts +1 -0
  951. package/build/esm/type/undefined/index.mjs +1 -0
  952. package/build/esm/type/undefined/undefined.d.mts +9 -0
  953. package/build/esm/type/undefined/undefined.mjs +6 -0
  954. package/build/esm/type/union/index.d.mts +3 -0
  955. package/build/esm/type/union/index.mjs +3 -0
  956. package/build/esm/type/union/union-create.d.mts +3 -0
  957. package/build/esm/type/union/union-create.mjs +5 -0
  958. package/build/esm/type/union/union-evaluated.d.mts +13 -0
  959. package/build/esm/type/union/union-evaluated.mjs +36 -0
  960. package/build/esm/type/union/union-type.d.mts +12 -0
  961. package/build/esm/type/union/union-type.mjs +1 -0
  962. package/build/esm/type/union/union.d.mts +6 -0
  963. package/build/esm/type/union/union.mjs +10 -0
  964. package/build/esm/type/unknown/index.d.mts +1 -0
  965. package/build/esm/type/unknown/index.mjs +1 -0
  966. package/build/esm/type/unknown/unknown.d.mts +8 -0
  967. package/build/esm/type/unknown/unknown.mjs +6 -0
  968. package/build/esm/type/unsafe/index.d.mts +1 -0
  969. package/build/esm/type/unsafe/index.mjs +1 -0
  970. package/build/esm/type/unsafe/unsafe.d.mts +11 -0
  971. package/build/esm/type/unsafe/unsafe.mjs +6 -0
  972. package/build/esm/type/void/index.d.mts +1 -0
  973. package/build/esm/type/void/index.mjs +1 -0
  974. package/build/esm/type/void/void.d.mts +9 -0
  975. package/build/esm/type/void/void.mjs +6 -0
  976. package/build/esm/value/assert/assert.d.mts +15 -0
  977. package/build/esm/value/assert/assert.mjs +49 -0
  978. package/build/esm/value/assert/index.d.mts +1 -0
  979. package/build/esm/value/assert/index.mjs +1 -0
  980. package/build/esm/value/cast/cast.d.mts +11 -0
  981. package/build/esm/value/cast/cast.mjs +235 -0
  982. package/build/esm/value/cast/index.d.mts +1 -0
  983. package/build/esm/value/cast/index.mjs +1 -0
  984. package/build/esm/value/check/check.d.mts +11 -0
  985. package/build/esm/value/check/check.mjs +470 -0
  986. package/build/esm/value/check/index.d.mts +1 -0
  987. package/build/esm/value/check/index.mjs +1 -0
  988. package/build/esm/value/clean/clean.d.mts +5 -0
  989. package/build/esm/value/clean/clean.mjs +145 -0
  990. package/build/esm/value/clean/index.d.mts +1 -0
  991. package/build/esm/value/clean/index.mjs +1 -0
  992. package/build/esm/value/clone/clone.d.mts +2 -0
  993. package/build/esm/value/clone/clone.mjs +56 -0
  994. package/build/esm/value/clone/index.d.mts +1 -0
  995. package/build/esm/value/clone/index.mjs +1 -0
  996. package/build/esm/value/convert/convert.d.mts +5 -0
  997. package/build/esm/value/convert/convert.mjs +260 -0
  998. package/build/esm/value/convert/index.d.mts +1 -0
  999. package/build/esm/value/convert/index.mjs +1 -0
  1000. package/build/esm/value/create/create.d.mts +11 -0
  1001. package/build/esm/value/create/create.mjs +468 -0
  1002. package/build/esm/value/create/index.d.mts +1 -0
  1003. package/build/esm/value/create/index.mjs +1 -0
  1004. package/build/esm/value/decode/decode.d.mts +6 -0
  1005. package/build/esm/value/decode/decode.mjs +10 -0
  1006. package/build/esm/value/decode/index.d.mts +1 -0
  1007. package/build/esm/value/decode/index.mjs +1 -0
  1008. package/build/esm/value/default/default.d.mts +5 -0
  1009. package/build/esm/value/default/default.mjs +172 -0
  1010. package/build/esm/value/default/index.d.mts +1 -0
  1011. package/build/esm/value/default/index.mjs +1 -0
  1012. package/build/esm/value/delta/delta.d.mts +32 -0
  1013. package/build/esm/value/delta/delta.mjs +171 -0
  1014. package/build/esm/value/delta/index.d.mts +1 -0
  1015. package/build/esm/value/delta/index.mjs +1 -0
  1016. package/build/esm/value/deref/deref.d.mts +12 -0
  1017. package/build/esm/value/deref/deref.mjs +29 -0
  1018. package/build/esm/value/deref/index.d.mts +1 -0
  1019. package/build/esm/value/deref/index.mjs +1 -0
  1020. package/build/esm/value/encode/encode.d.mts +6 -0
  1021. package/build/esm/value/encode/encode.mjs +11 -0
  1022. package/build/esm/value/encode/index.d.mts +1 -0
  1023. package/build/esm/value/encode/index.mjs +1 -0
  1024. package/build/esm/value/equal/equal.d.mts +2 -0
  1025. package/build/esm/value/equal/equal.mjs +46 -0
  1026. package/build/esm/value/equal/index.d.mts +1 -0
  1027. package/build/esm/value/equal/index.mjs +1 -0
  1028. package/build/esm/value/guard/guard.d.mts +74 -0
  1029. package/build/esm/value/guard/guard.mjs +158 -0
  1030. package/build/esm/value/guard/index.d.mts +1 -0
  1031. package/build/esm/value/guard/index.mjs +1 -0
  1032. package/build/esm/value/hash/hash.d.mts +7 -0
  1033. package/build/esm/value/hash/hash.mjs +146 -0
  1034. package/build/esm/value/hash/index.d.mts +1 -0
  1035. package/build/esm/value/hash/index.mjs +1 -0
  1036. package/build/esm/value/index.d.mts +20 -0
  1037. package/build/esm/value/index.mjs +32 -0
  1038. package/build/esm/value/mutate/index.d.mts +1 -0
  1039. package/build/esm/value/mutate/index.mjs +1 -0
  1040. package/build/esm/value/mutate/mutate.d.mts +9 -0
  1041. package/build/esm/value/mutate/mutate.mjs +98 -0
  1042. package/build/esm/value/parse/index.d.mts +1 -0
  1043. package/build/esm/value/parse/index.mjs +1 -0
  1044. package/build/esm/value/parse/parse.d.mts +22 -0
  1045. package/build/esm/value/parse/parse.mjs +81 -0
  1046. package/build/esm/value/pointer/index.d.mts +1 -0
  1047. package/build/esm/value/pointer/index.mjs +1 -0
  1048. package/build/esm/value/pointer/pointer.d.mts +22 -0
  1049. package/build/esm/value/pointer/pointer.mjs +115 -0
  1050. package/build/esm/value/transform/decode.d.mts +22 -0
  1051. package/build/esm/value/transform/decode.mjs +207 -0
  1052. package/build/esm/value/transform/encode.d.mts +23 -0
  1053. package/build/esm/value/transform/encode.mjs +218 -0
  1054. package/build/esm/value/transform/has.d.mts +3 -0
  1055. package/build/esm/value/transform/has.mjs +129 -0
  1056. package/build/esm/value/transform/index.d.mts +3 -0
  1057. package/build/esm/value/transform/index.mjs +3 -0
  1058. package/build/esm/value/value/index.d.mts +1 -0
  1059. package/build/esm/value/value/index.mjs +1 -0
  1060. package/build/esm/value/value/value.d.mts +16 -0
  1061. package/build/esm/value/value/value.mjs +16 -0
  1062. package/changes.json +5 -0
  1063. package/compiler/package.json +4 -0
  1064. package/errors/package.json +4 -0
  1065. package/license +25 -0
  1066. package/package.json +128 -0
  1067. package/parser/package.json +4 -0
  1068. package/readme.md +1865 -0
  1069. package/syntax/package.json +4 -0
  1070. package/system/package.json +4 -0
  1071. package/type/package.json +4 -0
  1072. package/value/package.json +4 -0
@@ -0,0 +1,635 @@
1
+ import { Any } from '../any/index.mjs';
2
+ import { Function as FunctionType } from '../function/index.mjs';
3
+ import { Number } from '../number/index.mjs';
4
+ import { String } from '../string/index.mjs';
5
+ import { Unknown } from '../unknown/index.mjs';
6
+ import { TemplateLiteralToUnion } from '../template-literal/index.mjs';
7
+ import { PatternNumberExact, PatternStringExact } from '../patterns/index.mjs';
8
+ import { Kind, Hint } from '../symbols/index.mjs';
9
+ import { TypeBoxError } from '../error/index.mjs';
10
+ import { TypeGuard, ValueGuard } from '../guard/index.mjs';
11
+ export class ExtendsResolverError extends TypeBoxError {
12
+ }
13
+ export var ExtendsResult;
14
+ (function (ExtendsResult) {
15
+ ExtendsResult[ExtendsResult["Union"] = 0] = "Union";
16
+ ExtendsResult[ExtendsResult["True"] = 1] = "True";
17
+ ExtendsResult[ExtendsResult["False"] = 2] = "False";
18
+ })(ExtendsResult || (ExtendsResult = {}));
19
+ // ------------------------------------------------------------------
20
+ // IntoBooleanResult
21
+ // ------------------------------------------------------------------
22
+ // prettier-ignore
23
+ function IntoBooleanResult(result) {
24
+ return result === ExtendsResult.False ? result : ExtendsResult.True;
25
+ }
26
+ // ------------------------------------------------------------------
27
+ // Throw
28
+ // ------------------------------------------------------------------
29
+ // prettier-ignore
30
+ function Throw(message) {
31
+ throw new ExtendsResolverError(message);
32
+ }
33
+ // ------------------------------------------------------------------
34
+ // StructuralRight
35
+ // ------------------------------------------------------------------
36
+ // prettier-ignore
37
+ function IsStructuralRight(right) {
38
+ return (TypeGuard.IsNever(right) ||
39
+ TypeGuard.IsIntersect(right) ||
40
+ TypeGuard.IsUnion(right) ||
41
+ TypeGuard.IsUnknown(right) ||
42
+ TypeGuard.IsAny(right));
43
+ }
44
+ // prettier-ignore
45
+ function StructuralRight(left, right) {
46
+ return (TypeGuard.IsNever(right) ? FromNeverRight(left, right) :
47
+ TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) :
48
+ TypeGuard.IsUnion(right) ? FromUnionRight(left, right) :
49
+ TypeGuard.IsUnknown(right) ? FromUnknownRight(left, right) :
50
+ TypeGuard.IsAny(right) ? FromAnyRight(left, right) :
51
+ Throw('StructuralRight'));
52
+ }
53
+ // ------------------------------------------------------------------
54
+ // Any
55
+ // ------------------------------------------------------------------
56
+ // prettier-ignore
57
+ function FromAnyRight(left, right) {
58
+ return ExtendsResult.True;
59
+ }
60
+ // prettier-ignore
61
+ function FromAny(left, right) {
62
+ return (TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) :
63
+ (TypeGuard.IsUnion(right) && right.anyOf.some((schema) => TypeGuard.IsAny(schema) || TypeGuard.IsUnknown(schema))) ? ExtendsResult.True :
64
+ TypeGuard.IsUnion(right) ? ExtendsResult.Union :
65
+ TypeGuard.IsUnknown(right) ? ExtendsResult.True :
66
+ TypeGuard.IsAny(right) ? ExtendsResult.True :
67
+ ExtendsResult.Union);
68
+ }
69
+ // ------------------------------------------------------------------
70
+ // Array
71
+ // ------------------------------------------------------------------
72
+ // prettier-ignore
73
+ function FromArrayRight(left, right) {
74
+ return (TypeGuard.IsUnknown(left) ? ExtendsResult.False :
75
+ TypeGuard.IsAny(left) ? ExtendsResult.Union :
76
+ TypeGuard.IsNever(left) ? ExtendsResult.True :
77
+ ExtendsResult.False);
78
+ }
79
+ // prettier-ignore
80
+ function FromArray(left, right) {
81
+ return (TypeGuard.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True :
82
+ IsStructuralRight(right) ? StructuralRight(left, right) :
83
+ !TypeGuard.IsArray(right) ? ExtendsResult.False :
84
+ IntoBooleanResult(Visit(left.items, right.items)));
85
+ }
86
+ // ------------------------------------------------------------------
87
+ // AsyncIterator
88
+ // ------------------------------------------------------------------
89
+ // prettier-ignore
90
+ function FromAsyncIterator(left, right) {
91
+ return (IsStructuralRight(right) ? StructuralRight(left, right) :
92
+ !TypeGuard.IsAsyncIterator(right) ? ExtendsResult.False :
93
+ IntoBooleanResult(Visit(left.items, right.items)));
94
+ }
95
+ // ------------------------------------------------------------------
96
+ // BigInt
97
+ // ------------------------------------------------------------------
98
+ // prettier-ignore
99
+ function FromBigInt(left, right) {
100
+ return (IsStructuralRight(right) ? StructuralRight(left, right) :
101
+ TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
102
+ TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
103
+ TypeGuard.IsBigInt(right) ? ExtendsResult.True :
104
+ ExtendsResult.False);
105
+ }
106
+ // ------------------------------------------------------------------
107
+ // Boolean
108
+ // ------------------------------------------------------------------
109
+ // prettier-ignore
110
+ function FromBooleanRight(left, right) {
111
+ return (TypeGuard.IsLiteralBoolean(left) ? ExtendsResult.True :
112
+ TypeGuard.IsBoolean(left) ? ExtendsResult.True :
113
+ ExtendsResult.False);
114
+ }
115
+ // prettier-ignore
116
+ function FromBoolean(left, right) {
117
+ return (IsStructuralRight(right) ? StructuralRight(left, right) :
118
+ TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
119
+ TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
120
+ TypeGuard.IsBoolean(right) ? ExtendsResult.True :
121
+ ExtendsResult.False);
122
+ }
123
+ // ------------------------------------------------------------------
124
+ // Constructor
125
+ // ------------------------------------------------------------------
126
+ // prettier-ignore
127
+ function FromConstructor(left, right) {
128
+ return (IsStructuralRight(right) ? StructuralRight(left, right) :
129
+ TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
130
+ !TypeGuard.IsConstructor(right) ? ExtendsResult.False :
131
+ left.parameters.length > right.parameters.length ? ExtendsResult.False :
132
+ (!left.parameters.every((schema, index) => IntoBooleanResult(Visit(right.parameters[index], schema)) === ExtendsResult.True)) ? ExtendsResult.False :
133
+ IntoBooleanResult(Visit(left.returns, right.returns)));
134
+ }
135
+ // ------------------------------------------------------------------
136
+ // Date
137
+ // ------------------------------------------------------------------
138
+ // prettier-ignore
139
+ function FromDate(left, right) {
140
+ return (IsStructuralRight(right) ? StructuralRight(left, right) :
141
+ TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
142
+ TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
143
+ TypeGuard.IsDate(right) ? ExtendsResult.True :
144
+ ExtendsResult.False);
145
+ }
146
+ // ------------------------------------------------------------------
147
+ // Function
148
+ // ------------------------------------------------------------------
149
+ // prettier-ignore
150
+ function FromFunction(left, right) {
151
+ return (IsStructuralRight(right) ? StructuralRight(left, right) :
152
+ TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
153
+ !TypeGuard.IsFunction(right) ? ExtendsResult.False :
154
+ left.parameters.length > right.parameters.length ? ExtendsResult.False :
155
+ (!left.parameters.every((schema, index) => IntoBooleanResult(Visit(right.parameters[index], schema)) === ExtendsResult.True)) ? ExtendsResult.False :
156
+ IntoBooleanResult(Visit(left.returns, right.returns)));
157
+ }
158
+ // ------------------------------------------------------------------
159
+ // Integer
160
+ // ------------------------------------------------------------------
161
+ // prettier-ignore
162
+ function FromIntegerRight(left, right) {
163
+ return (TypeGuard.IsLiteral(left) && ValueGuard.IsNumber(left.const) ? ExtendsResult.True :
164
+ TypeGuard.IsNumber(left) || TypeGuard.IsInteger(left) ? ExtendsResult.True :
165
+ ExtendsResult.False);
166
+ }
167
+ // prettier-ignore
168
+ function FromInteger(left, right) {
169
+ return (TypeGuard.IsInteger(right) || TypeGuard.IsNumber(right) ? ExtendsResult.True :
170
+ IsStructuralRight(right) ? StructuralRight(left, right) :
171
+ TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
172
+ TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
173
+ ExtendsResult.False);
174
+ }
175
+ // ------------------------------------------------------------------
176
+ // Intersect
177
+ // ------------------------------------------------------------------
178
+ // prettier-ignore
179
+ function FromIntersectRight(left, right) {
180
+ return right.allOf.every((schema) => Visit(left, schema) === ExtendsResult.True)
181
+ ? ExtendsResult.True
182
+ : ExtendsResult.False;
183
+ }
184
+ // prettier-ignore
185
+ function FromIntersect(left, right) {
186
+ return left.allOf.some((schema) => Visit(schema, right) === ExtendsResult.True)
187
+ ? ExtendsResult.True
188
+ : ExtendsResult.False;
189
+ }
190
+ // ------------------------------------------------------------------
191
+ // Iterator
192
+ // ------------------------------------------------------------------
193
+ // prettier-ignore
194
+ function FromIterator(left, right) {
195
+ return (IsStructuralRight(right) ? StructuralRight(left, right) :
196
+ !TypeGuard.IsIterator(right) ? ExtendsResult.False :
197
+ IntoBooleanResult(Visit(left.items, right.items)));
198
+ }
199
+ // ------------------------------------------------------------------
200
+ // Literal
201
+ // ------------------------------------------------------------------
202
+ // prettier-ignore
203
+ function FromLiteral(left, right) {
204
+ return (TypeGuard.IsLiteral(right) && right.const === left.const ? ExtendsResult.True :
205
+ IsStructuralRight(right) ? StructuralRight(left, right) :
206
+ TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
207
+ TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
208
+ TypeGuard.IsString(right) ? FromStringRight(left, right) :
209
+ TypeGuard.IsNumber(right) ? FromNumberRight(left, right) :
210
+ TypeGuard.IsInteger(right) ? FromIntegerRight(left, right) :
211
+ TypeGuard.IsBoolean(right) ? FromBooleanRight(left, right) :
212
+ ExtendsResult.False);
213
+ }
214
+ // ------------------------------------------------------------------
215
+ // Never
216
+ // ------------------------------------------------------------------
217
+ // prettier-ignore
218
+ function FromNeverRight(left, right) {
219
+ return ExtendsResult.False;
220
+ }
221
+ // prettier-ignore
222
+ function FromNever(left, right) {
223
+ return ExtendsResult.True;
224
+ }
225
+ // ------------------------------------------------------------------
226
+ // Not
227
+ // ------------------------------------------------------------------
228
+ // prettier-ignore
229
+ function UnwrapTNot(schema) {
230
+ let [current, depth] = [schema, 0];
231
+ while (true) {
232
+ if (!TypeGuard.IsNot(current))
233
+ break;
234
+ current = current.not;
235
+ depth += 1;
236
+ }
237
+ return depth % 2 === 0 ? current : Unknown();
238
+ }
239
+ // prettier-ignore
240
+ function FromNot(left, right) {
241
+ // TypeScript has no concept of negated types, and attempts to correctly check the negated
242
+ // type at runtime would put TypeBox at odds with TypeScripts ability to statically infer
243
+ // the type. Instead we unwrap to either unknown or T and continue evaluating.
244
+ // prettier-ignore
245
+ return (TypeGuard.IsNot(left) ? Visit(UnwrapTNot(left), right) :
246
+ TypeGuard.IsNot(right) ? Visit(left, UnwrapTNot(right)) :
247
+ Throw('Invalid fallthrough for Not'));
248
+ }
249
+ // ------------------------------------------------------------------
250
+ // Null
251
+ // ------------------------------------------------------------------
252
+ // prettier-ignore
253
+ function FromNull(left, right) {
254
+ return (IsStructuralRight(right) ? StructuralRight(left, right) :
255
+ TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
256
+ TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
257
+ TypeGuard.IsNull(right) ? ExtendsResult.True :
258
+ ExtendsResult.False);
259
+ }
260
+ // ------------------------------------------------------------------
261
+ // Number
262
+ // ------------------------------------------------------------------
263
+ // prettier-ignore
264
+ function FromNumberRight(left, right) {
265
+ return (TypeGuard.IsLiteralNumber(left) ? ExtendsResult.True :
266
+ TypeGuard.IsNumber(left) || TypeGuard.IsInteger(left) ? ExtendsResult.True :
267
+ ExtendsResult.False);
268
+ }
269
+ // prettier-ignore
270
+ function FromNumber(left, right) {
271
+ return (IsStructuralRight(right) ? StructuralRight(left, right) :
272
+ TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
273
+ TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
274
+ TypeGuard.IsInteger(right) || TypeGuard.IsNumber(right) ? ExtendsResult.True :
275
+ ExtendsResult.False);
276
+ }
277
+ // ------------------------------------------------------------------
278
+ // Object
279
+ // ------------------------------------------------------------------
280
+ // prettier-ignore
281
+ function IsObjectPropertyCount(schema, count) {
282
+ return Object.getOwnPropertyNames(schema.properties).length === count;
283
+ }
284
+ // prettier-ignore
285
+ function IsObjectStringLike(schema) {
286
+ return IsObjectArrayLike(schema);
287
+ }
288
+ // prettier-ignore
289
+ function IsObjectSymbolLike(schema) {
290
+ return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'description' in schema.properties && TypeGuard.IsUnion(schema.properties.description) && schema.properties.description.anyOf.length === 2 && ((TypeGuard.IsString(schema.properties.description.anyOf[0]) &&
291
+ TypeGuard.IsUndefined(schema.properties.description.anyOf[1])) || (TypeGuard.IsString(schema.properties.description.anyOf[1]) &&
292
+ TypeGuard.IsUndefined(schema.properties.description.anyOf[0]))));
293
+ }
294
+ // prettier-ignore
295
+ function IsObjectNumberLike(schema) {
296
+ return IsObjectPropertyCount(schema, 0);
297
+ }
298
+ // prettier-ignore
299
+ function IsObjectBooleanLike(schema) {
300
+ return IsObjectPropertyCount(schema, 0);
301
+ }
302
+ // prettier-ignore
303
+ function IsObjectBigIntLike(schema) {
304
+ return IsObjectPropertyCount(schema, 0);
305
+ }
306
+ // prettier-ignore
307
+ function IsObjectDateLike(schema) {
308
+ return IsObjectPropertyCount(schema, 0);
309
+ }
310
+ // prettier-ignore
311
+ function IsObjectUint8ArrayLike(schema) {
312
+ return IsObjectArrayLike(schema);
313
+ }
314
+ // prettier-ignore
315
+ function IsObjectFunctionLike(schema) {
316
+ const length = Number();
317
+ return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'length' in schema.properties && IntoBooleanResult(Visit(schema.properties['length'], length)) === ExtendsResult.True);
318
+ }
319
+ // prettier-ignore
320
+ function IsObjectConstructorLike(schema) {
321
+ return IsObjectPropertyCount(schema, 0);
322
+ }
323
+ // prettier-ignore
324
+ function IsObjectArrayLike(schema) {
325
+ const length = Number();
326
+ return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'length' in schema.properties && IntoBooleanResult(Visit(schema.properties['length'], length)) === ExtendsResult.True);
327
+ }
328
+ // prettier-ignore
329
+ function IsObjectPromiseLike(schema) {
330
+ const then = FunctionType([Any()], Any());
331
+ return IsObjectPropertyCount(schema, 0) || (IsObjectPropertyCount(schema, 1) && 'then' in schema.properties && IntoBooleanResult(Visit(schema.properties['then'], then)) === ExtendsResult.True);
332
+ }
333
+ // ------------------------------------------------------------------
334
+ // Property
335
+ // ------------------------------------------------------------------
336
+ // prettier-ignore
337
+ function Property(left, right) {
338
+ return (Visit(left, right) === ExtendsResult.False ? ExtendsResult.False :
339
+ TypeGuard.IsOptional(left) && !TypeGuard.IsOptional(right) ? ExtendsResult.False :
340
+ ExtendsResult.True);
341
+ }
342
+ // prettier-ignore
343
+ function FromObjectRight(left, right) {
344
+ return (TypeGuard.IsUnknown(left) ? ExtendsResult.False :
345
+ TypeGuard.IsAny(left) ? ExtendsResult.Union : (TypeGuard.IsNever(left) ||
346
+ (TypeGuard.IsLiteralString(left) && IsObjectStringLike(right)) ||
347
+ (TypeGuard.IsLiteralNumber(left) && IsObjectNumberLike(right)) ||
348
+ (TypeGuard.IsLiteralBoolean(left) && IsObjectBooleanLike(right)) ||
349
+ (TypeGuard.IsSymbol(left) && IsObjectSymbolLike(right)) ||
350
+ (TypeGuard.IsBigInt(left) && IsObjectBigIntLike(right)) ||
351
+ (TypeGuard.IsString(left) && IsObjectStringLike(right)) ||
352
+ (TypeGuard.IsSymbol(left) && IsObjectSymbolLike(right)) ||
353
+ (TypeGuard.IsNumber(left) && IsObjectNumberLike(right)) ||
354
+ (TypeGuard.IsInteger(left) && IsObjectNumberLike(right)) ||
355
+ (TypeGuard.IsBoolean(left) && IsObjectBooleanLike(right)) ||
356
+ (TypeGuard.IsUint8Array(left) && IsObjectUint8ArrayLike(right)) ||
357
+ (TypeGuard.IsDate(left) && IsObjectDateLike(right)) ||
358
+ (TypeGuard.IsConstructor(left) && IsObjectConstructorLike(right)) ||
359
+ (TypeGuard.IsFunction(left) && IsObjectFunctionLike(right))) ? ExtendsResult.True :
360
+ (TypeGuard.IsRecord(left) && TypeGuard.IsString(RecordKey(left))) ? (() => {
361
+ // When expressing a Record with literal key values, the Record is converted into a Object with
362
+ // the Hint assigned as `Record`. This is used to invert the extends logic.
363
+ return right[Hint] === 'Record' ? ExtendsResult.True : ExtendsResult.False;
364
+ })() :
365
+ (TypeGuard.IsRecord(left) && TypeGuard.IsNumber(RecordKey(left))) ? (() => {
366
+ return IsObjectPropertyCount(right, 0) ? ExtendsResult.True : ExtendsResult.False;
367
+ })() :
368
+ ExtendsResult.False);
369
+ }
370
+ // prettier-ignore
371
+ function FromObject(left, right) {
372
+ return (IsStructuralRight(right) ? StructuralRight(left, right) :
373
+ TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
374
+ !TypeGuard.IsObject(right) ? ExtendsResult.False :
375
+ (() => {
376
+ for (const key of Object.getOwnPropertyNames(right.properties)) {
377
+ if (!(key in left.properties) && !TypeGuard.IsOptional(right.properties[key])) {
378
+ return ExtendsResult.False;
379
+ }
380
+ if (TypeGuard.IsOptional(right.properties[key])) {
381
+ return ExtendsResult.True;
382
+ }
383
+ if (Property(left.properties[key], right.properties[key]) === ExtendsResult.False) {
384
+ return ExtendsResult.False;
385
+ }
386
+ }
387
+ return ExtendsResult.True;
388
+ })());
389
+ }
390
+ // ------------------------------------------------------------------
391
+ // Promise
392
+ // ------------------------------------------------------------------
393
+ // prettier-ignore
394
+ function FromPromise(left, right) {
395
+ return (IsStructuralRight(right) ? StructuralRight(left, right) :
396
+ TypeGuard.IsObject(right) && IsObjectPromiseLike(right) ? ExtendsResult.True :
397
+ !TypeGuard.IsPromise(right) ? ExtendsResult.False :
398
+ IntoBooleanResult(Visit(left.item, right.item)));
399
+ }
400
+ // ------------------------------------------------------------------
401
+ // Record
402
+ // ------------------------------------------------------------------
403
+ // prettier-ignore
404
+ function RecordKey(schema) {
405
+ return (PatternNumberExact in schema.patternProperties ? Number() :
406
+ PatternStringExact in schema.patternProperties ? String() :
407
+ Throw('Unknown record key pattern'));
408
+ }
409
+ // prettier-ignore
410
+ function RecordValue(schema) {
411
+ return (PatternNumberExact in schema.patternProperties ? schema.patternProperties[PatternNumberExact] :
412
+ PatternStringExact in schema.patternProperties ? schema.patternProperties[PatternStringExact] :
413
+ Throw('Unable to get record value schema'));
414
+ }
415
+ // prettier-ignore
416
+ function FromRecordRight(left, right) {
417
+ const [Key, Value] = [RecordKey(right), RecordValue(right)];
418
+ return ((TypeGuard.IsLiteralString(left) && TypeGuard.IsNumber(Key) && IntoBooleanResult(Visit(left, Value)) === ExtendsResult.True) ? ExtendsResult.True :
419
+ TypeGuard.IsUint8Array(left) && TypeGuard.IsNumber(Key) ? Visit(left, Value) :
420
+ TypeGuard.IsString(left) && TypeGuard.IsNumber(Key) ? Visit(left, Value) :
421
+ TypeGuard.IsArray(left) && TypeGuard.IsNumber(Key) ? Visit(left, Value) :
422
+ TypeGuard.IsObject(left) ? (() => {
423
+ for (const key of Object.getOwnPropertyNames(left.properties)) {
424
+ if (Property(Value, left.properties[key]) === ExtendsResult.False) {
425
+ return ExtendsResult.False;
426
+ }
427
+ }
428
+ return ExtendsResult.True;
429
+ })() :
430
+ ExtendsResult.False);
431
+ }
432
+ // prettier-ignore
433
+ function FromRecord(left, right) {
434
+ return (IsStructuralRight(right) ? StructuralRight(left, right) :
435
+ TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
436
+ !TypeGuard.IsRecord(right) ? ExtendsResult.False :
437
+ Visit(RecordValue(left), RecordValue(right)));
438
+ }
439
+ // ------------------------------------------------------------------
440
+ // RegExp
441
+ // ------------------------------------------------------------------
442
+ // prettier-ignore
443
+ function FromRegExp(left, right) {
444
+ // Note: RegExp types evaluate as strings, not RegExp objects.
445
+ // Here we remap either into string and continue evaluating.
446
+ const L = TypeGuard.IsRegExp(left) ? String() : left;
447
+ const R = TypeGuard.IsRegExp(right) ? String() : right;
448
+ return Visit(L, R);
449
+ }
450
+ // ------------------------------------------------------------------
451
+ // String
452
+ // ------------------------------------------------------------------
453
+ // prettier-ignore
454
+ function FromStringRight(left, right) {
455
+ return (TypeGuard.IsLiteral(left) && ValueGuard.IsString(left.const) ? ExtendsResult.True :
456
+ TypeGuard.IsString(left) ? ExtendsResult.True :
457
+ ExtendsResult.False);
458
+ }
459
+ // prettier-ignore
460
+ function FromString(left, right) {
461
+ return (IsStructuralRight(right) ? StructuralRight(left, right) :
462
+ TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
463
+ TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
464
+ TypeGuard.IsString(right) ? ExtendsResult.True :
465
+ ExtendsResult.False);
466
+ }
467
+ // ------------------------------------------------------------------
468
+ // Symbol
469
+ // ------------------------------------------------------------------
470
+ // prettier-ignore
471
+ function FromSymbol(left, right) {
472
+ return (IsStructuralRight(right) ? StructuralRight(left, right) :
473
+ TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
474
+ TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
475
+ TypeGuard.IsSymbol(right) ? ExtendsResult.True :
476
+ ExtendsResult.False);
477
+ }
478
+ // ------------------------------------------------------------------
479
+ // TemplateLiteral
480
+ // ------------------------------------------------------------------
481
+ // prettier-ignore
482
+ function FromTemplateLiteral(left, right) {
483
+ // TemplateLiteral types are resolved to either unions for finite expressions or string
484
+ // for infinite expressions. Here we call to TemplateLiteralResolver to resolve for
485
+ // either type and continue evaluating.
486
+ return (TypeGuard.IsTemplateLiteral(left) ? Visit(TemplateLiteralToUnion(left), right) :
487
+ TypeGuard.IsTemplateLiteral(right) ? Visit(left, TemplateLiteralToUnion(right)) :
488
+ Throw('Invalid fallthrough for TemplateLiteral'));
489
+ }
490
+ // ------------------------------------------------------------------
491
+ // Tuple
492
+ // ------------------------------------------------------------------
493
+ // prettier-ignore
494
+ function IsArrayOfTuple(left, right) {
495
+ return (TypeGuard.IsArray(right) &&
496
+ left.items !== undefined &&
497
+ left.items.every((schema) => Visit(schema, right.items) === ExtendsResult.True));
498
+ }
499
+ // prettier-ignore
500
+ function FromTupleRight(left, right) {
501
+ return (TypeGuard.IsNever(left) ? ExtendsResult.True :
502
+ TypeGuard.IsUnknown(left) ? ExtendsResult.False :
503
+ TypeGuard.IsAny(left) ? ExtendsResult.Union :
504
+ ExtendsResult.False);
505
+ }
506
+ // prettier-ignore
507
+ function FromTuple(left, right) {
508
+ return (IsStructuralRight(right) ? StructuralRight(left, right) :
509
+ TypeGuard.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True :
510
+ TypeGuard.IsArray(right) && IsArrayOfTuple(left, right) ? ExtendsResult.True :
511
+ !TypeGuard.IsTuple(right) ? ExtendsResult.False :
512
+ (ValueGuard.IsUndefined(left.items) && !ValueGuard.IsUndefined(right.items)) || (!ValueGuard.IsUndefined(left.items) && ValueGuard.IsUndefined(right.items)) ? ExtendsResult.False :
513
+ (ValueGuard.IsUndefined(left.items) && !ValueGuard.IsUndefined(right.items)) ? ExtendsResult.True :
514
+ left.items.every((schema, index) => Visit(schema, right.items[index]) === ExtendsResult.True) ? ExtendsResult.True :
515
+ ExtendsResult.False);
516
+ }
517
+ // ------------------------------------------------------------------
518
+ // Uint8Array
519
+ // ------------------------------------------------------------------
520
+ // prettier-ignore
521
+ function FromUint8Array(left, right) {
522
+ return (IsStructuralRight(right) ? StructuralRight(left, right) :
523
+ TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
524
+ TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
525
+ TypeGuard.IsUint8Array(right) ? ExtendsResult.True :
526
+ ExtendsResult.False);
527
+ }
528
+ // ------------------------------------------------------------------
529
+ // Undefined
530
+ // ------------------------------------------------------------------
531
+ // prettier-ignore
532
+ function FromUndefined(left, right) {
533
+ return (IsStructuralRight(right) ? StructuralRight(left, right) :
534
+ TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
535
+ TypeGuard.IsRecord(right) ? FromRecordRight(left, right) :
536
+ TypeGuard.IsVoid(right) ? FromVoidRight(left, right) :
537
+ TypeGuard.IsUndefined(right) ? ExtendsResult.True :
538
+ ExtendsResult.False);
539
+ }
540
+ // ------------------------------------------------------------------
541
+ // Union
542
+ // ------------------------------------------------------------------
543
+ // prettier-ignore
544
+ function FromUnionRight(left, right) {
545
+ return right.anyOf.some((schema) => Visit(left, schema) === ExtendsResult.True)
546
+ ? ExtendsResult.True
547
+ : ExtendsResult.False;
548
+ }
549
+ // prettier-ignore
550
+ function FromUnion(left, right) {
551
+ return left.anyOf.every((schema) => Visit(schema, right) === ExtendsResult.True)
552
+ ? ExtendsResult.True
553
+ : ExtendsResult.False;
554
+ }
555
+ // ------------------------------------------------------------------
556
+ // Unknown
557
+ // ------------------------------------------------------------------
558
+ // prettier-ignore
559
+ function FromUnknownRight(left, right) {
560
+ return ExtendsResult.True;
561
+ }
562
+ // prettier-ignore
563
+ function FromUnknown(left, right) {
564
+ return (TypeGuard.IsNever(right) ? FromNeverRight(left, right) :
565
+ TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) :
566
+ TypeGuard.IsUnion(right) ? FromUnionRight(left, right) :
567
+ TypeGuard.IsAny(right) ? FromAnyRight(left, right) :
568
+ TypeGuard.IsString(right) ? FromStringRight(left, right) :
569
+ TypeGuard.IsNumber(right) ? FromNumberRight(left, right) :
570
+ TypeGuard.IsInteger(right) ? FromIntegerRight(left, right) :
571
+ TypeGuard.IsBoolean(right) ? FromBooleanRight(left, right) :
572
+ TypeGuard.IsArray(right) ? FromArrayRight(left, right) :
573
+ TypeGuard.IsTuple(right) ? FromTupleRight(left, right) :
574
+ TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
575
+ TypeGuard.IsUnknown(right) ? ExtendsResult.True :
576
+ ExtendsResult.False);
577
+ }
578
+ // ------------------------------------------------------------------
579
+ // Void
580
+ // ------------------------------------------------------------------
581
+ // prettier-ignore
582
+ function FromVoidRight(left, right) {
583
+ return (TypeGuard.IsUndefined(left) ? ExtendsResult.True :
584
+ TypeGuard.IsUndefined(left) ? ExtendsResult.True :
585
+ ExtendsResult.False);
586
+ }
587
+ // prettier-ignore
588
+ function FromVoid(left, right) {
589
+ return (TypeGuard.IsIntersect(right) ? FromIntersectRight(left, right) :
590
+ TypeGuard.IsUnion(right) ? FromUnionRight(left, right) :
591
+ TypeGuard.IsUnknown(right) ? FromUnknownRight(left, right) :
592
+ TypeGuard.IsAny(right) ? FromAnyRight(left, right) :
593
+ TypeGuard.IsObject(right) ? FromObjectRight(left, right) :
594
+ TypeGuard.IsVoid(right) ? ExtendsResult.True :
595
+ ExtendsResult.False);
596
+ }
597
+ // prettier-ignore
598
+ function Visit(left, right) {
599
+ return (
600
+ // resolvable
601
+ (TypeGuard.IsTemplateLiteral(left) || TypeGuard.IsTemplateLiteral(right)) ? FromTemplateLiteral(left, right) :
602
+ (TypeGuard.IsRegExp(left) || TypeGuard.IsRegExp(right)) ? FromRegExp(left, right) :
603
+ (TypeGuard.IsNot(left) || TypeGuard.IsNot(right)) ? FromNot(left, right) :
604
+ // standard
605
+ TypeGuard.IsAny(left) ? FromAny(left, right) :
606
+ TypeGuard.IsArray(left) ? FromArray(left, right) :
607
+ TypeGuard.IsBigInt(left) ? FromBigInt(left, right) :
608
+ TypeGuard.IsBoolean(left) ? FromBoolean(left, right) :
609
+ TypeGuard.IsAsyncIterator(left) ? FromAsyncIterator(left, right) :
610
+ TypeGuard.IsConstructor(left) ? FromConstructor(left, right) :
611
+ TypeGuard.IsDate(left) ? FromDate(left, right) :
612
+ TypeGuard.IsFunction(left) ? FromFunction(left, right) :
613
+ TypeGuard.IsInteger(left) ? FromInteger(left, right) :
614
+ TypeGuard.IsIntersect(left) ? FromIntersect(left, right) :
615
+ TypeGuard.IsIterator(left) ? FromIterator(left, right) :
616
+ TypeGuard.IsLiteral(left) ? FromLiteral(left, right) :
617
+ TypeGuard.IsNever(left) ? FromNever(left, right) :
618
+ TypeGuard.IsNull(left) ? FromNull(left, right) :
619
+ TypeGuard.IsNumber(left) ? FromNumber(left, right) :
620
+ TypeGuard.IsObject(left) ? FromObject(left, right) :
621
+ TypeGuard.IsRecord(left) ? FromRecord(left, right) :
622
+ TypeGuard.IsString(left) ? FromString(left, right) :
623
+ TypeGuard.IsSymbol(left) ? FromSymbol(left, right) :
624
+ TypeGuard.IsTuple(left) ? FromTuple(left, right) :
625
+ TypeGuard.IsPromise(left) ? FromPromise(left, right) :
626
+ TypeGuard.IsUint8Array(left) ? FromUint8Array(left, right) :
627
+ TypeGuard.IsUndefined(left) ? FromUndefined(left, right) :
628
+ TypeGuard.IsUnion(left) ? FromUnion(left, right) :
629
+ TypeGuard.IsUnknown(left) ? FromUnknown(left, right) :
630
+ TypeGuard.IsVoid(left) ? FromVoid(left, right) :
631
+ Throw(`Unknown left type operand '${left[Kind]}'`));
632
+ }
633
+ export function ExtendsCheck(left, right) {
634
+ return Visit(left, right);
635
+ }
@@ -0,0 +1,14 @@
1
+ import type { TSchema, SchemaOptions } from '../schema/index.mjs';
2
+ import type { TProperties } from '../object/index.mjs';
3
+ import type { Assert } from '../helpers/index.mjs';
4
+ import { type TMappedResult, type TMappedKey } from '../mapped/index.mjs';
5
+ import { type TLiteral, type TLiteralValue } from '../literal/index.mjs';
6
+ import { type TExtends } from './extends.mjs';
7
+ type TFromPropertyKey<K extends PropertyKey, U extends TSchema, L extends TSchema, R extends TSchema> = {
8
+ [_ in K]: TExtends<TLiteral<Assert<K, TLiteralValue>>, U, L, R>;
9
+ };
10
+ type TFromPropertyKeys<K extends PropertyKey[], U extends TSchema, L extends TSchema, R extends TSchema, Acc extends TProperties = {}> = (K extends [infer LK extends PropertyKey, ...infer RK extends PropertyKey[]] ? TFromPropertyKeys<RK, U, L, R, Acc & TFromPropertyKey<LK, U, L, R>> : Acc);
11
+ type TFromMappedKey<K extends TMappedKey, U extends TSchema, L extends TSchema, R extends TSchema> = (TFromPropertyKeys<K['keys'], U, L, R>);
12
+ export type TExtendsFromMappedKey<T extends TMappedKey, U extends TSchema, L extends TSchema, R extends TSchema, P extends TProperties = TFromMappedKey<T, U, L, R>> = (TMappedResult<P>);
13
+ export declare function ExtendsFromMappedKey<T extends TMappedKey, U extends TSchema, L extends TSchema, R extends TSchema, P extends TProperties = TFromMappedKey<T, U, L, R>>(T: T, U: U, L: L, R: R, options?: SchemaOptions): TMappedResult<P>;
14
+ export {};
@@ -0,0 +1,25 @@
1
+ import { MappedResult } from '../mapped/index.mjs';
2
+ import { Literal } from '../literal/index.mjs';
3
+ import { Extends } from './extends.mjs';
4
+ import { Clone } from '../clone/value.mjs';
5
+ // prettier-ignore
6
+ function FromPropertyKey(K, U, L, R, options) {
7
+ return {
8
+ [K]: Extends(Literal(K), U, L, R, Clone(options))
9
+ };
10
+ }
11
+ // prettier-ignore
12
+ function FromPropertyKeys(K, U, L, R, options) {
13
+ return K.reduce((Acc, LK) => {
14
+ return { ...Acc, ...FromPropertyKey(LK, U, L, R, options) };
15
+ }, {});
16
+ }
17
+ // prettier-ignore
18
+ function FromMappedKey(K, U, L, R, options) {
19
+ return FromPropertyKeys(K.keys, U, L, R, options);
20
+ }
21
+ // prettier-ignore
22
+ export function ExtendsFromMappedKey(T, U, L, R, options) {
23
+ const P = FromMappedKey(T, U, L, R, options);
24
+ return MappedResult(P);
25
+ }