@depup/typebox 1.1.23-depup.0 → 1.3.9-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.
- package/README.md +2 -2
- package/build/compile/code.mjs +2 -2
- package/build/compile/validator.d.mts +7 -14
- package/build/compile/validator.mjs +32 -57
- package/build/error/errors.d.mts +1 -7
- package/build/format/_idna.mjs +36 -6
- package/build/format/_puny.mjs +4 -1
- package/build/format/_registry.mjs +9 -9
- package/build/format/format.d.mts +9 -9
- package/build/format/format.mjs +9 -9
- package/build/format/uuid.d.mts +2 -2
- package/build/format/uuid.mjs +3 -3
- package/build/guard/emit.d.mts +3 -5
- package/build/guard/emit.mjs +12 -13
- package/build/guard/guard.d.mts +15 -7
- package/build/guard/guard.mjs +40 -15
- package/build/guard/string.mjs +16 -4
- package/build/schema/build.d.mts +11 -7
- package/build/schema/build.mjs +28 -9
- package/build/schema/check.d.mts +3 -3
- package/build/schema/compile.d.mts +4 -4
- package/build/schema/compile.mjs +9 -9
- package/build/schema/engine/_context.mjs +3 -3
- package/build/schema/engine/_functions.mjs +34 -16
- package/build/schema/engine/_refine.mjs +4 -4
- package/build/schema/engine/_stack.d.mts +4 -4
- package/build/schema/engine/_stack.mjs +52 -18
- package/build/schema/engine/additionalItems.mjs +17 -7
- package/build/schema/engine/additionalProperties.mjs +1 -1
- package/build/schema/engine/boolean.d.mts +3 -3
- package/build/schema/engine/boolean.mjs +4 -4
- package/build/schema/engine/contains.mjs +18 -6
- package/build/schema/engine/dynamicRef.d.mts +6 -0
- package/build/schema/engine/dynamicRef.mjs +25 -0
- package/build/schema/engine/enum.mjs +1 -1
- package/build/schema/engine/index.d.mts +0 -1
- package/build/schema/engine/index.mjs +0 -1
- package/build/schema/engine/items.mjs +26 -6
- package/build/schema/engine/maxContains.mjs +3 -3
- package/build/schema/engine/minContains.mjs +14 -4
- package/build/schema/engine/not.mjs +4 -2
- package/build/schema/engine/oneOf.mjs +7 -6
- package/build/schema/engine/recursiveRef.mjs +3 -3
- package/build/schema/engine/ref.mjs +4 -10
- package/build/schema/engine/schema.mjs +15 -15
- package/build/schema/engine/type.mjs +15 -19
- package/build/schema/parse.d.mts +3 -3
- package/build/schema/pointer/index.d.mts +1 -1
- package/build/schema/pointer/index.mjs +1 -1
- package/build/schema/pointer/pointer.mjs +11 -1
- package/build/schema/resolve/ref.d.mts +1 -0
- package/build/schema/resolve/ref.mjs +61 -11
- package/build/schema/static/_canonical.d.mts +7 -0
- package/build/schema/static/{~elements.d.mts → _elements.d.mts} +3 -3
- package/build/schema/static/items.d.mts +1 -1
- package/build/schema/static/prefixItems.d.mts +1 -1
- package/build/schema/static/properties.d.mts +27 -6
- package/build/schema/static/ref.d.mts +1 -1
- package/build/schema/static/required.d.mts +1 -11
- package/build/schema/static/schema.d.mts +3 -2
- package/build/schema/static/static.d.mts +2 -2
- package/build/schema/types/_refine.d.mts +2 -2
- package/build/schema/types/_refine.mjs +4 -4
- package/build/schema/types/dependencies.mjs +1 -1
- package/build/schema/types/index.d.mts +0 -1
- package/build/schema/types/index.mjs +0 -1
- package/build/schema/types/schema.d.mts +1 -1
- package/build/schema/types/schema.mjs +2 -2
- package/build/system/locale/_config.d.mts +1 -1
- package/build/system/locale/ar_001.d.mts +1 -1
- package/build/system/locale/ar_001.mjs +0 -1
- package/build/system/locale/bn_BD.d.mts +1 -1
- package/build/system/locale/bn_BD.mjs +0 -1
- package/build/system/locale/cs_CZ.d.mts +1 -1
- package/build/system/locale/cs_CZ.mjs +0 -1
- package/build/system/locale/de_DE.d.mts +1 -1
- package/build/system/locale/de_DE.mjs +0 -1
- package/build/system/locale/el_GR.d.mts +1 -1
- package/build/system/locale/el_GR.mjs +0 -1
- package/build/system/locale/en_US.d.mts +1 -1
- package/build/system/locale/en_US.mjs +0 -1
- package/build/system/locale/es_419.d.mts +1 -1
- package/build/system/locale/es_419.mjs +0 -1
- package/build/system/locale/es_AR.d.mts +1 -1
- package/build/system/locale/es_AR.mjs +0 -1
- package/build/system/locale/es_ES.d.mts +1 -1
- package/build/system/locale/es_ES.mjs +0 -1
- package/build/system/locale/es_MX.d.mts +1 -1
- package/build/system/locale/es_MX.mjs +0 -1
- package/build/system/locale/fa_IR.d.mts +1 -1
- package/build/system/locale/fa_IR.mjs +0 -1
- package/build/system/locale/fil_PH.d.mts +1 -1
- package/build/system/locale/fil_PH.mjs +0 -1
- package/build/system/locale/fr_CA.d.mts +1 -1
- package/build/system/locale/fr_CA.mjs +0 -1
- package/build/system/locale/fr_FR.d.mts +1 -1
- package/build/system/locale/fr_FR.mjs +0 -1
- package/build/system/locale/ha_NG.d.mts +1 -1
- package/build/system/locale/ha_NG.mjs +0 -1
- package/build/system/locale/hi_IN.d.mts +1 -1
- package/build/system/locale/hi_IN.mjs +0 -1
- package/build/system/locale/hu_HU.d.mts +1 -1
- package/build/system/locale/hu_HU.mjs +0 -1
- package/build/system/locale/id_ID.d.mts +1 -1
- package/build/system/locale/id_ID.mjs +0 -1
- package/build/system/locale/it_IT.d.mts +1 -1
- package/build/system/locale/it_IT.mjs +0 -1
- package/build/system/locale/ja_JP.d.mts +1 -1
- package/build/system/locale/ja_JP.mjs +0 -1
- package/build/system/locale/ko_KR.d.mts +1 -1
- package/build/system/locale/ko_KR.mjs +0 -1
- package/build/system/locale/ms_MY.d.mts +1 -1
- package/build/system/locale/ms_MY.mjs +0 -1
- package/build/system/locale/nl_NL.d.mts +1 -1
- package/build/system/locale/nl_NL.mjs +0 -1
- package/build/system/locale/pl_PL.d.mts +1 -1
- package/build/system/locale/pl_PL.mjs +0 -1
- package/build/system/locale/pt_BR.d.mts +1 -1
- package/build/system/locale/pt_BR.mjs +0 -1
- package/build/system/locale/pt_PT.d.mts +1 -1
- package/build/system/locale/pt_PT.mjs +0 -1
- package/build/system/locale/ro_RO.d.mts +1 -1
- package/build/system/locale/ro_RO.mjs +0 -1
- package/build/system/locale/ru_RU.d.mts +1 -1
- package/build/system/locale/ru_RU.mjs +0 -1
- package/build/system/locale/sv_SE.d.mts +1 -1
- package/build/system/locale/sv_SE.mjs +0 -1
- package/build/system/locale/sw_TZ.d.mts +1 -1
- package/build/system/locale/sw_TZ.mjs +0 -1
- package/build/system/locale/th_TH.d.mts +1 -1
- package/build/system/locale/th_TH.mjs +0 -1
- package/build/system/locale/tr_TR.d.mts +1 -1
- package/build/system/locale/tr_TR.mjs +0 -1
- package/build/system/locale/uk_UA.d.mts +1 -1
- package/build/system/locale/uk_UA.mjs +0 -1
- package/build/system/locale/ur_PK.d.mts +1 -1
- package/build/system/locale/ur_PK.mjs +0 -1
- package/build/system/locale/vi_VN.d.mts +1 -1
- package/build/system/locale/vi_VN.mjs +0 -1
- package/build/system/locale/yo_NG.d.mts +1 -1
- package/build/system/locale/yo_NG.mjs +0 -1
- package/build/system/locale/zh_Hans.d.mts +1 -1
- package/build/system/locale/zh_Hans.mjs +0 -1
- package/build/system/locale/zh_Hant.d.mts +1 -1
- package/build/system/locale/zh_Hant.mjs +0 -1
- package/build/system/memory/clone.d.mts +2 -3
- package/build/system/memory/clone.mjs +73 -26
- package/build/system/settings/settings.d.mts +15 -0
- package/build/system/settings/settings.mjs +3 -1
- package/build/type/action/_add_immutable.d.mts +11 -0
- package/build/type/action/_add_immutable.mjs +11 -0
- package/build/type/action/_add_optional.d.mts +11 -0
- package/build/type/action/_add_optional.mjs +11 -0
- package/build/type/action/_add_readonly.d.mts +11 -0
- package/build/type/action/_add_readonly.mjs +11 -0
- package/build/type/action/_remove_immutable.d.mts +11 -0
- package/build/type/action/_remove_immutable.mjs +11 -0
- package/build/type/action/_remove_optional.d.mts +11 -0
- package/build/type/action/_remove_optional.mjs +11 -0
- package/build/type/action/_remove_readonly.d.mts +11 -0
- package/build/type/action/_remove_readonly.mjs +11 -0
- package/build/type/action/capitalize.d.mts +2 -2
- package/build/type/action/capitalize.mjs +2 -3
- package/build/type/action/conditional.d.mts +3 -2
- package/build/type/action/conditional.mjs +3 -2
- package/build/type/action/{constructor-parameters.d.mts → constructor_parameters.d.mts} +2 -2
- package/build/type/action/{constructor-parameters.mjs → constructor_parameters.mjs} +2 -3
- package/build/type/action/evaluate.d.mts +2 -2
- package/build/type/action/evaluate.mjs +2 -3
- package/build/type/action/exclude.d.mts +2 -2
- package/build/type/action/exclude.mjs +2 -3
- package/build/type/action/extract.d.mts +2 -2
- package/build/type/action/extract.mjs +2 -3
- package/build/type/action/index.d.mts +12 -9
- package/build/type/action/index.mjs +12 -9
- package/build/type/action/indexed.d.mts +3 -3
- package/build/type/action/indexed.mjs +3 -4
- package/build/type/action/{instance-type.d.mts → instance_type.d.mts} +2 -2
- package/build/type/action/{instance-type.mjs → instance_type.mjs} +2 -3
- package/build/type/action/interface.d.mts +2 -2
- package/build/type/action/interface.mjs +5 -3
- package/build/type/action/keyof.d.mts +2 -2
- package/build/type/action/keyof.mjs +2 -3
- package/build/type/action/lowercase.d.mts +2 -2
- package/build/type/action/lowercase.mjs +2 -3
- package/build/type/action/mapped.d.mts +3 -2
- package/build/type/action/mapped.mjs +3 -2
- package/build/type/action/module.d.mts +8 -7
- package/build/type/action/module.mjs +7 -6
- package/build/type/action/{non-nullable.d.mts → non_nullable.d.mts} +2 -2
- package/build/type/action/{non-nullable.mjs → non_nullable.mjs} +2 -3
- package/build/type/action/omit.d.mts +3 -3
- package/build/type/action/omit.mjs +3 -4
- package/build/type/action/parameters.d.mts +2 -2
- package/build/type/action/parameters.mjs +2 -3
- package/build/type/action/partial.d.mts +3 -3
- package/build/type/action/partial.mjs +2 -3
- package/build/type/action/pick.d.mts +3 -3
- package/build/type/action/pick.mjs +3 -4
- package/build/type/action/readonly_object.d.mts +16 -0
- package/build/type/action/readonly_object.mjs +19 -0
- package/build/type/action/required.d.mts +2 -2
- package/build/type/action/required.mjs +2 -3
- package/build/type/action/{return-type.d.mts → return_type.d.mts} +2 -2
- package/build/type/action/{return-type.mjs → return_type.mjs} +2 -3
- package/build/type/action/uncapitalize.d.mts +2 -2
- package/build/type/action/uncapitalize.mjs +2 -3
- package/build/type/action/uppercase.d.mts +2 -2
- package/build/type/action/uppercase.mjs +2 -3
- package/build/type/action/with.d.mts +11 -0
- package/build/type/action/with.mjs +11 -0
- package/build/type/engine/call/{distribute-arguments.mjs → distribute_arguments.mjs} +1 -7
- package/build/type/engine/call/instantiate.d.mts +4 -6
- package/build/type/engine/call/instantiate.mjs +6 -5
- package/build/type/engine/call/{resolve-arguments.mjs → resolve_arguments.mjs} +3 -9
- package/build/type/engine/conditional/instantiate.d.mts +4 -2
- package/build/type/engine/conditional/instantiate.mjs +13 -9
- package/build/type/engine/constructor_parameters/instantiate.d.mts +14 -0
- package/build/type/engine/constructor_parameters/instantiate.mjs +25 -0
- package/build/type/engine/cyclic/candidates.d.mts +3 -4
- package/build/type/engine/cyclic/candidates.mjs +3 -6
- package/build/type/engine/cyclic/check.d.mts +6 -9
- package/build/type/engine/cyclic/check.mjs +13 -22
- package/build/type/engine/cyclic/dependencies.d.mts +1 -4
- package/build/type/engine/cyclic/dependencies.mjs +9 -15
- package/build/type/engine/cyclic/extends.d.mts +1 -4
- package/build/type/engine/cyclic/extends.mjs +8 -14
- package/build/type/engine/cyclic/instantiate.d.mts +2 -5
- package/build/type/engine/cyclic/instantiate.mjs +3 -2
- package/build/type/engine/enum/index.d.mts +1 -2
- package/build/type/engine/enum/index.mjs +1 -2
- package/build/type/engine/evaluate/broaden.d.mts +1 -2
- package/build/type/engine/evaluate/broaden.mjs +2 -6
- package/build/type/engine/evaluate/composite.d.mts +11 -7
- package/build/type/engine/evaluate/composite.mjs +11 -7
- package/build/type/engine/evaluate/distribute.d.mts +2 -1
- package/build/type/engine/evaluate/distribute.mjs +7 -17
- package/build/type/engine/evaluate/evaluate.d.mts +17 -5
- package/build/type/engine/evaluate/evaluate.mjs +34 -8
- package/build/type/engine/evaluate/flatten.d.mts +1 -1
- package/build/type/engine/evaluate/instantiate.d.mts +3 -3
- package/build/type/engine/evaluate/instantiate.mjs +5 -10
- package/build/type/engine/evaluate/narrow.d.mts +3 -3
- package/build/type/engine/exclude/instantiate.d.mts +4 -11
- package/build/type/engine/exclude/instantiate.mjs +7 -28
- package/build/type/engine/exclude/operation.d.mts +10 -0
- package/build/type/engine/exclude/operation.mjs +23 -0
- package/build/type/engine/extract/instantiate.d.mts +4 -11
- package/build/type/engine/extract/instantiate.mjs +7 -28
- package/build/type/engine/extract/operation.d.mts +10 -0
- package/build/type/engine/extract/operation.mjs +23 -0
- package/build/type/engine/helpers/index.d.mts +1 -1
- package/build/type/engine/helpers/index.mjs +1 -1
- package/build/type/engine/immutable/instantiate_add.d.mts +10 -0
- package/build/type/engine/immutable/instantiate_add.mjs +14 -0
- package/build/type/engine/immutable/instantiate_remove.d.mts +10 -0
- package/build/type/engine/immutable/instantiate_remove.mjs +14 -0
- package/build/type/engine/index.d.mts +8 -8
- package/build/type/engine/index.mjs +8 -8
- package/build/type/engine/indexable/{from-cyclic.d.mts → from_cyclic.d.mts} +1 -1
- package/build/type/engine/{object/from-cyclic.mjs → indexable/from_cyclic.mjs} +1 -1
- package/build/type/engine/indexable/from_dependent.d.mts +5 -0
- package/build/type/engine/indexable/from_dependent.mjs +8 -0
- package/build/type/engine/indexable/from_enum.d.mts +6 -0
- package/build/type/engine/indexable/from_enum.mjs +8 -0
- package/build/type/engine/indexable/{from-intersect.d.mts → from_intersect.d.mts} +1 -1
- package/build/type/engine/indexable/{from-intersect.mjs → from_intersect.mjs} +1 -1
- package/build/type/engine/indexable/{from-literal.d.mts → from_literal.d.mts} +1 -1
- package/build/type/engine/indexable/from_template_literal.d.mts +5 -0
- package/build/type/engine/indexable/from_template_literal.mjs +8 -0
- package/build/type/engine/indexable/from_type.d.mts +19 -0
- package/build/type/engine/indexable/from_type.mjs +25 -0
- package/build/type/engine/indexable/{from-union.d.mts → from_union.d.mts} +1 -1
- package/build/type/engine/indexable/{from-union.mjs → from_union.mjs} +1 -1
- package/build/type/engine/indexable/{to-indexable-keys.d.mts → to_indexable_keys.d.mts} +1 -1
- package/build/type/engine/indexable/{to-indexable-keys.mjs → to_indexable_keys.mjs} +1 -1
- package/build/type/engine/indexed/from_object.d.mts +16 -0
- package/build/type/engine/indexed/from_object.mjs +40 -0
- package/build/type/engine/indexed/{from-tuple.d.mts → from_tuple.d.mts} +1 -1
- package/build/type/engine/indexed/{from-tuple.mjs → from_tuple.mjs} +1 -1
- package/build/type/engine/indexed/from_type.d.mts +11 -0
- package/build/type/engine/indexed/from_type.mjs +14 -0
- package/build/type/engine/indexed/instantiate.d.mts +7 -12
- package/build/type/engine/indexed/instantiate.mjs +13 -22
- package/build/type/engine/instance_type/instantiate.d.mts +12 -0
- package/build/type/engine/{instance-type → instance_type}/instantiate.mjs +10 -9
- package/build/type/engine/instantiate.d.mts +53 -42
- package/build/type/engine/instantiate.mjs +92 -106
- package/build/type/engine/interface/instantiate.d.mts +6 -7
- package/build/type/engine/interface/instantiate.mjs +12 -8
- package/build/type/engine/intrinsics/{from-template-literal.d.mts → from_template_literal.d.mts} +3 -3
- package/build/type/engine/intrinsics/from_template_literal.mjs +8 -0
- package/build/type/engine/intrinsics/{from-type.d.mts → from_type.d.mts} +4 -4
- package/build/type/engine/intrinsics/{from-type.mjs → from_type.mjs} +4 -4
- package/build/type/engine/intrinsics/{from-union.d.mts → from_union.d.mts} +1 -1
- package/build/type/engine/intrinsics/{from-union.mjs → from_union.mjs} +1 -1
- package/build/type/engine/intrinsics/instantiate.d.mts +13 -9
- package/build/type/engine/intrinsics/instantiate.mjs +29 -25
- package/build/type/engine/keyof/from_type.d.mts +15 -0
- package/build/type/engine/keyof/from_type.mjs +23 -0
- package/build/type/engine/keyof/instantiate.d.mts +6 -17
- package/build/type/engine/keyof/instantiate.mjs +12 -28
- package/build/type/engine/mapped/instantiate.d.mts +4 -19
- package/build/type/engine/mapped/instantiate.mjs +7 -42
- package/build/type/engine/mapped/mapped_operation.d.mts +22 -0
- package/build/type/engine/mapped/mapped_operation.mjs +42 -0
- package/build/type/engine/mapped/mapped_variants.d.mts +17 -0
- package/build/type/engine/mapped/mapped_variants.mjs +39 -0
- package/build/type/engine/module/instantiate.d.mts +7 -9
- package/build/type/engine/module/instantiate.mjs +17 -15
- package/build/type/engine/non_nullable/instantiate.d.mts +14 -0
- package/build/type/engine/non_nullable/instantiate.mjs +22 -0
- package/build/type/engine/object/collapse.d.mts +1 -1
- package/build/type/engine/object/collapse.mjs +1 -1
- package/build/type/engine/object/{from-cyclic.d.mts → from_cyclic.d.mts} +1 -1
- package/build/type/engine/{indexable/from-cyclic.mjs → object/from_cyclic.mjs} +1 -1
- package/build/type/engine/object/from_dependent.d.mts +5 -0
- package/build/type/engine/object/from_dependent.mjs +8 -0
- package/build/type/engine/object/{from-intersect.d.mts → from_intersect.d.mts} +1 -1
- package/build/type/engine/object/{from-intersect.mjs → from_intersect.mjs} +1 -1
- package/build/type/engine/object/{from-tuple.d.mts → from_tuple.d.mts} +2 -2
- package/build/type/engine/object/{from-tuple.mjs → from_tuple.mjs} +2 -2
- package/build/type/engine/object/from_type.d.mts +16 -0
- package/build/type/engine/object/from_type.mjs +23 -0
- package/build/type/engine/object/{from-union.d.mts → from_union.d.mts} +1 -1
- package/build/type/engine/object/{from-union.mjs → from_union.mjs} +4 -11
- package/build/type/engine/omit/from_type.d.mts +12 -0
- package/build/type/engine/omit/from_type.mjs +18 -0
- package/build/type/engine/omit/instantiate.d.mts +4 -11
- package/build/type/engine/omit/instantiate.mjs +7 -22
- package/build/type/engine/optional/instantiate_add.d.mts +10 -0
- package/build/type/engine/optional/instantiate_add.mjs +14 -0
- package/build/type/engine/optional/instantiate_remove.d.mts +10 -0
- package/build/type/engine/optional/instantiate_remove.mjs +14 -0
- package/build/type/engine/parameters/instantiate.d.mts +7 -7
- package/build/type/engine/parameters/instantiate.mjs +14 -11
- package/build/type/engine/{readonly-type/from-cyclic.d.mts → partial/from_cyclic.d.mts} +1 -1
- package/build/type/engine/partial/{from-cyclic.mjs → from_cyclic.mjs} +1 -1
- package/build/type/engine/partial/from_dependent.d.mts +5 -0
- package/build/type/engine/partial/from_dependent.mjs +8 -0
- package/build/type/engine/partial/from_intersect.d.mts +5 -0
- package/build/type/engine/partial/from_intersect.mjs +8 -0
- package/build/type/engine/{readonly-type/from-object.d.mts → partial/from_object.d.mts} +2 -2
- package/build/type/engine/partial/{from-object.mjs → from_object.mjs} +2 -2
- package/build/type/engine/partial/from_type.d.mts +14 -0
- package/build/type/engine/partial/from_type.mjs +20 -0
- package/build/type/engine/{readonly-type/from-union.d.mts → partial/from_union.d.mts} +1 -1
- package/build/type/engine/{readonly-type/from-union.mjs → partial/from_union.mjs} +1 -1
- package/build/type/engine/partial/instantiate.d.mts +4 -4
- package/build/type/engine/partial/instantiate.mjs +8 -7
- package/build/type/engine/pick/from_type.d.mts +13 -0
- package/build/type/engine/pick/from_type.mjs +20 -0
- package/build/type/engine/pick/instantiate.d.mts +4 -12
- package/build/type/engine/pick/instantiate.mjs +7 -23
- package/build/type/engine/priority/index.d.mts +1 -0
- package/build/type/engine/priority/index.mjs +1 -0
- package/build/type/engine/priority/priority.d.mts +20 -0
- package/build/type/engine/priority/priority.mjs +28 -0
- package/build/type/engine/readonly/instantiate_add.d.mts +10 -0
- package/build/type/engine/readonly/instantiate_add.mjs +14 -0
- package/build/type/engine/readonly/instantiate_remove.d.mts +10 -0
- package/build/type/engine/readonly/instantiate_remove.mjs +14 -0
- package/build/type/engine/{readonly-type/from-array.d.mts → readonly_object/from_array.d.mts} +2 -2
- package/build/type/engine/{readonly-type/from-array.mjs → readonly_object/from_array.mjs} +2 -2
- package/build/type/engine/{partial/from-cyclic.d.mts → readonly_object/from_cyclic.d.mts} +1 -1
- package/build/type/engine/{required/from-cyclic.mjs → readonly_object/from_cyclic.mjs} +1 -1
- package/build/type/engine/readonly_object/from_dependent.d.mts +5 -0
- package/build/type/engine/readonly_object/from_dependent.mjs +8 -0
- package/build/type/engine/readonly_object/from_intersect.d.mts +5 -0
- package/build/type/engine/readonly_object/from_intersect.mjs +8 -0
- package/build/type/engine/{partial/from-object.d.mts → readonly_object/from_object.d.mts} +2 -2
- package/build/type/engine/{readonly-type/from-object.mjs → readonly_object/from_object.mjs} +2 -2
- package/build/type/engine/{readonly-type/from-tuple.d.mts → readonly_object/from_tuple.d.mts} +2 -2
- package/build/type/engine/{readonly-type/from-tuple.mjs → readonly_object/from_tuple.mjs} +2 -2
- package/build/type/engine/readonly_object/from_type.d.mts +18 -0
- package/build/type/engine/readonly_object/from_type.mjs +25 -0
- package/build/type/engine/{partial/from-union.d.mts → readonly_object/from_union.d.mts} +1 -1
- package/build/type/engine/{partial/from-union.mjs → readonly_object/from_union.mjs} +1 -1
- package/build/type/engine/readonly_object/instantiate.d.mts +9 -0
- package/build/type/engine/readonly_object/instantiate.mjs +15 -0
- package/build/type/engine/record/{from-key.d.mts → from_key.d.mts} +11 -11
- package/build/type/engine/record/{from-key.mjs → from_key.mjs} +11 -11
- package/build/type/engine/record/{from-key-any.mjs → from_key_any.mjs} +1 -1
- package/build/type/engine/record/{from-key-enum.d.mts → from_key_enum.d.mts} +3 -3
- package/build/type/engine/record/from_key_enum.mjs +8 -0
- package/build/type/engine/record/{from-key-integer.mjs → from_key_integer.mjs} +1 -1
- package/build/type/engine/record/{from-key-intersect.d.mts → from_key_intersect.d.mts} +1 -1
- package/build/type/engine/record/{from-key-intersect.mjs → from_key_intersect.mjs} +1 -1
- package/build/type/engine/record/{from-key-number.mjs → from_key_number.mjs} +1 -1
- package/build/type/engine/record/{from-key-string.mjs → from_key_string.mjs} +1 -1
- package/build/type/engine/record/{from-key-template-literal.d.mts → from_key_template_literal.d.mts} +4 -4
- package/build/type/engine/record/from_key_template_literal.mjs +12 -0
- package/build/type/engine/record/{from-key-union.mjs → from_key_union.mjs} +1 -1
- package/build/type/engine/record/instantiate.d.mts +4 -4
- package/build/type/engine/record/instantiate.mjs +9 -8
- package/build/type/engine/ref/instantiate.d.mts +4 -4
- package/build/type/engine/ref/instantiate.mjs +6 -6
- package/build/type/engine/required/{from-cyclic.d.mts → from_cyclic.d.mts} +1 -1
- package/build/type/engine/{readonly-type/from-cyclic.mjs → required/from_cyclic.mjs} +1 -1
- package/build/type/engine/required/from_dependent.d.mts +5 -0
- package/build/type/engine/required/from_dependent.mjs +8 -0
- package/build/type/engine/required/from_intersect.d.mts +5 -0
- package/build/type/engine/required/from_intersect.mjs +8 -0
- package/build/type/engine/required/{from-object.d.mts → from_object.d.mts} +2 -2
- package/build/type/engine/required/{from-object.mjs → from_object.mjs} +2 -2
- package/build/type/engine/required/from_type.d.mts +14 -0
- package/build/type/engine/required/from_type.mjs +20 -0
- package/build/type/engine/required/{from-union.d.mts → from_union.d.mts} +1 -1
- package/build/type/engine/required/{from-union.mjs → from_union.mjs} +1 -1
- package/build/type/engine/required/instantiate.d.mts +4 -4
- package/build/type/engine/required/instantiate.mjs +8 -7
- package/build/type/engine/return_type/instantiate.d.mts +12 -0
- package/build/type/engine/return_type/instantiate.mjs +21 -0
- package/build/type/engine/{template-literal → template_literal}/decode.d.mts +4 -4
- package/build/type/engine/{template-literal → template_literal}/decode.mjs +6 -12
- package/build/type/engine/{template-literal → template_literal}/encode.d.mts +6 -4
- package/build/type/engine/{template-literal → template_literal}/encode.mjs +17 -16
- package/build/type/engine/{template-literal → template_literal}/index.d.mts +2 -2
- package/build/type/engine/{template-literal → template_literal}/index.mjs +2 -2
- package/build/type/engine/{template-literal → template_literal}/instantiate.d.mts +4 -4
- package/build/type/engine/template_literal/instantiate.mjs +15 -0
- package/build/type/engine/{template-literal/is-finite.mjs → template_literal/is_finite.mjs} +3 -7
- package/build/type/engine/{template-literal/is-pattern.mjs → template_literal/is_pattern.mjs} +1 -0
- package/build/type/engine/this/expand_this.d.mts +16 -0
- package/build/type/engine/this/expand_this.mjs +26 -0
- package/build/type/engine/with/instantiate.d.mts +8 -0
- package/build/type/engine/with/instantiate.mjs +14 -0
- package/build/type/extends/any.d.mts +1 -1
- package/build/type/extends/any.mjs +1 -1
- package/build/type/extends/array.d.mts +2 -2
- package/build/type/extends/array.mjs +2 -2
- package/build/type/extends/bigint.d.mts +1 -1
- package/build/type/extends/bigint.mjs +1 -1
- package/build/type/extends/boolean.d.mts +1 -1
- package/build/type/extends/boolean.mjs +1 -1
- package/build/type/extends/constructor.d.mts +1 -1
- package/build/type/extends/constructor.mjs +1 -1
- package/build/type/extends/dependent.d.mts +6 -0
- package/build/type/extends/dependent.mjs +6 -0
- package/build/type/extends/enum.d.mts +5 -5
- package/build/type/extends/enum.mjs +4 -3
- package/build/type/extends/extends.d.mts +5 -3
- package/build/type/extends/extends.mjs +10 -8
- package/build/type/extends/{extends-left.d.mts → extends_left.d.mts} +7 -9
- package/build/type/extends/{extends-left.mjs → extends_left.mjs} +26 -29
- package/build/type/extends/{extends-right.d.mts → extends_right.d.mts} +9 -7
- package/build/type/extends/extends_right.mjs +49 -0
- package/build/type/extends/function.d.mts +1 -1
- package/build/type/extends/function.mjs +1 -1
- package/build/type/extends/inference.d.mts +1 -1
- package/build/type/extends/inference.mjs +2 -2
- package/build/type/extends/integer.d.mts +1 -1
- package/build/type/extends/integer.mjs +1 -1
- package/build/type/extends/intersect.d.mts +1 -1
- package/build/type/extends/intersect.mjs +1 -1
- package/build/type/extends/literal.d.mts +2 -2
- package/build/type/extends/literal.mjs +2 -2
- package/build/type/extends/never.d.mts +1 -1
- package/build/type/extends/never.mjs +1 -1
- package/build/type/extends/null.d.mts +1 -1
- package/build/type/extends/null.mjs +1 -1
- package/build/type/extends/number.d.mts +1 -1
- package/build/type/extends/number.mjs +1 -1
- package/build/type/extends/object.d.mts +10 -3
- package/build/type/extends/object.mjs +27 -5
- package/build/type/extends/parameters.d.mts +1 -1
- package/build/type/extends/parameters.mjs +4 -3
- package/build/type/extends/record.d.mts +13 -0
- package/build/type/extends/record.mjs +23 -0
- package/build/type/extends/result.d.mts +1 -4
- package/build/type/extends/result.mjs +0 -3
- package/build/type/extends/{return-type.d.mts → return_type.d.mts} +1 -1
- package/build/type/extends/{return-type.mjs → return_type.mjs} +1 -1
- package/build/type/extends/string.d.mts +1 -1
- package/build/type/extends/string.mjs +1 -1
- package/build/type/extends/symbol.d.mts +1 -1
- package/build/type/extends/symbol.mjs +1 -1
- package/build/type/extends/template_literal.d.mts +6 -0
- package/build/type/extends/template_literal.mjs +7 -0
- package/build/type/extends/tuple.d.mts +5 -8
- package/build/type/extends/tuple.mjs +8 -7
- package/build/type/extends/undefined.d.mts +1 -1
- package/build/type/extends/undefined.mjs +1 -1
- package/build/type/extends/union.d.mts +1 -1
- package/build/type/extends/union.mjs +4 -3
- package/build/type/extends/unknown.d.mts +1 -1
- package/build/type/extends/unknown.mjs +1 -1
- package/build/type/extends/void.d.mts +1 -1
- package/build/type/extends/void.mjs +1 -1
- package/build/type/script/mapping.d.mts +110 -119
- package/build/type/script/mapping.mjs +109 -113
- package/build/type/script/parser.d.mts +57 -61
- package/build/type/script/parser.mjs +38 -40
- package/build/type/script/script.d.mts +3 -4
- package/build/type/script/script.mjs +3 -2
- package/build/type/script/token/internal/guard.d.mts +1 -1
- package/build/type/script/token/internal/guard.mjs +1 -1
- package/build/type/script/token/internal/take.mjs +5 -9
- package/build/type/script/token/until.mjs +4 -7
- package/build/type/types/_codec.d.mts +12 -12
- package/build/type/types/_codec.mjs +0 -1
- package/build/type/types/_immutable.d.mts +2 -9
- package/build/type/types/_immutable.mjs +2 -10
- package/build/type/types/_optional.d.mts +2 -9
- package/build/type/types/_optional.mjs +2 -11
- package/build/type/types/_readonly.d.mts +2 -9
- package/build/type/types/_readonly.mjs +2 -10
- package/build/type/types/_refine.d.mts +13 -8
- package/build/type/types/_refine.mjs +20 -4
- package/build/type/types/array.d.mts +2 -1
- package/build/type/types/array.mjs +2 -1
- package/build/type/types/call.d.mts +3 -3
- package/build/type/types/call.mjs +3 -2
- package/build/type/types/deferred.d.mts +1 -0
- package/build/type/types/deferred.mjs +1 -1
- package/build/type/types/dependent.d.mts +17 -0
- package/build/type/types/{iterator.mjs → dependent.mjs} +9 -9
- package/build/type/types/enum.d.mts +5 -3
- package/build/type/types/enum.mjs +7 -2
- package/build/type/types/function.mjs +1 -1
- package/build/type/types/index.d.mts +2 -5
- package/build/type/types/index.mjs +2 -5
- package/build/type/types/number.d.mts +1 -1
- package/build/type/types/number.mjs +1 -1
- package/build/type/types/object.mjs +1 -1
- package/build/type/types/properties.d.mts +2 -1
- package/build/type/types/record.d.mts +19 -15
- package/build/type/types/record.mjs +19 -17
- package/build/type/types/static.d.mts +3 -6
- package/build/type/types/{template-literal.d.mts → template_literal.d.mts} +6 -4
- package/build/type/types/{template-literal.mjs → template_literal.mjs} +10 -4
- package/build/type/types/unsafe.d.mts +1 -2
- package/build/type/types/unsafe.mjs +5 -3
- package/build/typebox.d.mts +11 -15
- package/build/typebox.mjs +10 -14
- package/build/value/clean/clean.mjs +5 -3
- package/build/value/clean/{from-array.mjs → from_array.mjs} +1 -1
- package/build/value/clean/{from-cyclic.mjs → from_cyclic.mjs} +1 -1
- package/build/value/clean/{from-intersect.mjs → from_intersect.mjs} +3 -3
- package/build/value/clean/{from-object.mjs → from_object.mjs} +1 -1
- package/build/value/clean/{from-record.mjs → from_record.mjs} +1 -1
- package/build/value/clean/{from-ref.mjs → from_ref.mjs} +1 -1
- package/build/value/clean/{from-tuple.mjs → from_tuple.mjs} +1 -1
- package/build/value/clean/from_type.mjs +21 -0
- package/build/value/clean/{from-union.mjs → from_union.mjs} +2 -3
- package/build/value/clone/clone.mjs +2 -72
- package/build/value/codec/decode.mjs +5 -3
- package/build/value/codec/encode.mjs +5 -3
- package/build/value/codec/{from-array.mjs → from_array.mjs} +2 -5
- package/build/value/codec/{from-cyclic.mjs → from_cyclic.mjs} +1 -1
- package/build/value/codec/{from-intersect.mjs → from_intersect.mjs} +1 -1
- package/build/value/codec/{from-object.mjs → from_object.mjs} +3 -6
- package/build/value/codec/{from-record.mjs → from_record.mjs} +3 -8
- package/build/value/codec/{from-ref.mjs → from_ref.mjs} +1 -1
- package/build/value/codec/{from-tuple.mjs → from_tuple.mjs} +2 -5
- package/build/value/codec/{from-type.mjs → from_type.mjs} +8 -8
- package/build/value/codec/{from-union.mjs → from_union.mjs} +3 -4
- package/build/value/convert/convert.mjs +1 -1
- package/build/value/convert/{from-additional.mjs → from_additional.mjs} +1 -1
- package/build/value/convert/{from-array.mjs → from_array.mjs} +1 -1
- package/build/value/convert/{from-cyclic.mjs → from_cyclic.mjs} +1 -1
- package/build/value/convert/from_enum.mjs +6 -0
- package/build/value/convert/{from-intersect.mjs → from_intersect.mjs} +1 -1
- package/build/value/convert/{from-literal.d.mts → from_literal.d.mts} +1 -1
- package/build/value/convert/{from-object.mjs → from_object.mjs} +3 -3
- package/build/value/convert/{from-record.mjs → from_record.mjs} +2 -2
- package/build/value/convert/{from-ref.mjs → from_ref.mjs} +1 -1
- package/build/value/convert/{from-template-literal.d.mts → from_template_literal.d.mts} +1 -1
- package/build/value/convert/from_template_literal.mjs +6 -0
- package/build/value/convert/{from-tuple.mjs → from_tuple.mjs} +1 -1
- package/build/value/convert/from_type.mjs +43 -0
- package/build/value/convert/{from-union.mjs → from_union.mjs} +1 -1
- package/build/value/convert/try/try.d.mts +8 -8
- package/build/value/convert/try/try.mjs +8 -8
- package/build/value/convert/try/{try-array.d.mts → try_array.d.mts} +1 -1
- package/build/value/convert/try/{try-array.mjs → try_array.mjs} +1 -1
- package/build/value/convert/try/{try-bigint.d.mts → try_bigint.d.mts} +1 -1
- package/build/value/convert/try/{try-bigint.mjs → try_bigint.mjs} +1 -1
- package/build/value/convert/try/{try-boolean.d.mts → try_boolean.d.mts} +1 -1
- package/build/value/convert/try/{try-boolean.mjs → try_boolean.mjs} +1 -1
- package/build/value/convert/try/{try-null.d.mts → try_null.d.mts} +1 -1
- package/build/value/convert/try/{try-null.mjs → try_null.mjs} +1 -1
- package/build/value/convert/try/{try-number.d.mts → try_number.d.mts} +1 -1
- package/build/value/convert/try/{try-number.mjs → try_number.mjs} +2 -2
- package/build/value/convert/try/{try-string.d.mts → try_string.d.mts} +1 -1
- package/build/value/convert/try/{try-string.mjs → try_string.mjs} +1 -1
- package/build/value/convert/try/{try-undefined.d.mts → try_undefined.d.mts} +1 -1
- package/build/value/convert/try/{try-undefined.mjs → try_undefined.mjs} +1 -1
- package/build/value/create/create.mjs +1 -1
- package/build/value/create/{from-array.mjs → from_array.mjs} +1 -1
- package/build/value/create/{from-constructor.mjs → from_constructor.mjs} +1 -1
- package/build/value/create/{from-cyclic.mjs → from_cyclic.mjs} +1 -1
- package/build/value/create/from_enum.mjs +6 -0
- package/build/value/create/{from-function.mjs → from_function.mjs} +1 -1
- package/build/value/create/{from-intersect.mjs → from_intersect.mjs} +1 -1
- package/build/value/create/{from-object.mjs → from_object.mjs} +1 -1
- package/build/value/create/{from-ref.mjs → from_ref.mjs} +1 -1
- package/build/value/create/{from-template-literal.mjs → from_template_literal.mjs} +2 -2
- package/build/value/create/{from-tuple.mjs → from_tuple.mjs} +1 -1
- package/build/value/create/from_type.mjs +61 -0
- package/build/value/create/{from-union.mjs → from_union.mjs} +1 -1
- package/build/value/default/default.mjs +1 -1
- package/build/value/default/{from-array.mjs → from_array.mjs} +1 -1
- package/build/value/{clean/from-cyclic.d.mts → default/from_cyclic.d.mts} +1 -1
- package/build/value/default/{from-cyclic.mjs → from_cyclic.mjs} +1 -1
- package/build/value/default/{from-intersect.mjs → from_intersect.mjs} +1 -1
- package/build/value/default/{from-object.mjs → from_object.mjs} +2 -2
- package/build/value/default/{from-record.mjs → from_record.mjs} +1 -1
- package/build/value/default/{from-ref.mjs → from_ref.mjs} +1 -1
- package/build/value/default/{from-tuple.mjs → from_tuple.mjs} +1 -1
- package/build/value/default/from_type.mjs +25 -0
- package/build/value/default/{from-union.mjs → from_union.mjs} +1 -1
- package/build/value/delta/diff.mjs +6 -0
- package/build/value/errors/errors.d.mts +2 -2
- package/build/value/errors/errors.mjs +1 -1
- package/build/value/index.d.mts +0 -1
- package/build/value/index.mjs +0 -1
- package/build/value/repair/{from-array.mjs → from_array.mjs} +1 -1
- package/build/value/repair/from_enum.mjs +6 -0
- package/build/value/repair/from_intersect.d.mts +2 -0
- package/build/value/repair/{from-intersect.mjs → from_intersect.mjs} +1 -1
- package/build/value/repair/{from-object.mjs → from_object.mjs} +1 -1
- package/build/value/repair/{from-record.mjs → from_record.mjs} +1 -1
- package/build/value/repair/{from-ref.mjs → from_ref.mjs} +1 -1
- package/build/value/{convert/from-template-literal.mjs → repair/from_template_literal.mjs} +2 -2
- package/build/value/repair/{from-tuple.mjs → from_tuple.mjs} +1 -1
- package/build/value/repair/{from-type.mjs → from_type.mjs} +34 -32
- package/build/value/{clean/from-union.d.mts → repair/from_union.d.mts} +1 -1
- package/build/value/repair/{from-union.mjs → from_union.mjs} +2 -2
- package/build/value/repair/repair.mjs +1 -1
- package/build/value/shared/index.d.mts +3 -3
- package/build/value/shared/index.mjs +3 -3
- package/build/value/shared/union_priority_sort.d.mts +7 -0
- package/build/value/shared/union_priority_sort.mjs +72 -0
- package/build/value/value.d.mts +0 -1
- package/build/value/value.mjs +0 -1
- package/changes.json +1 -1
- package/package.json +22 -22
- package/readme.md +214 -95
- package/build/schema/engine/_guard.d.mts +0 -6
- package/build/schema/engine/_guard.mjs +0 -26
- package/build/schema/static/~non-readonly.d.mts +0 -7
- package/build/schema/static/~readonly.d.mts +0 -6
- package/build/schema/static/~readonly.mjs +0 -2
- package/build/schema/types/_guard.d.mts +0 -10
- package/build/schema/types/_guard.mjs +0 -16
- package/build/type/action/_optional.d.mts +0 -19
- package/build/type/action/_optional.mjs +0 -40
- package/build/type/action/_readonly.d.mts +0 -19
- package/build/type/action/_readonly.mjs +0 -40
- package/build/type/action/awaited.d.mts +0 -11
- package/build/type/action/awaited.mjs +0 -12
- package/build/type/action/options.d.mts +0 -12
- package/build/type/action/options.mjs +0 -12
- package/build/type/action/readonly-type.d.mts +0 -11
- package/build/type/action/readonly-type.mjs +0 -12
- package/build/type/engine/awaited/instantiate.d.mts +0 -10
- package/build/type/engine/awaited/instantiate.mjs +0 -19
- package/build/type/engine/constructor-parameters/instantiate.d.mts +0 -14
- package/build/type/engine/constructor-parameters/instantiate.mjs +0 -22
- package/build/type/engine/enum/enum-to-union.d.mts +0 -14
- package/build/type/engine/enum/enum-to-union.mjs +0 -24
- package/build/type/engine/indexable/from-enum.d.mts +0 -6
- package/build/type/engine/indexable/from-enum.mjs +0 -8
- package/build/type/engine/indexable/from-template-literal.d.mts +0 -5
- package/build/type/engine/indexable/from-template-literal.mjs +0 -8
- package/build/type/engine/indexable/from-type.d.mts +0 -17
- package/build/type/engine/indexable/from-type.mjs +0 -22
- package/build/type/engine/indexed/from-object.d.mts +0 -9
- package/build/type/engine/indexed/from-object.mjs +0 -18
- package/build/type/engine/instance-type/instantiate.d.mts +0 -12
- package/build/type/engine/intrinsics/from-template-literal.mjs +0 -8
- package/build/type/engine/mapped/mapped-variants.d.mts +0 -15
- package/build/type/engine/mapped/mapped-variants.mjs +0 -29
- package/build/type/engine/non-nullable/instantiate.d.mts +0 -15
- package/build/type/engine/non-nullable/instantiate.mjs +0 -22
- package/build/type/engine/object/from-type.d.mts +0 -14
- package/build/type/engine/object/from-type.mjs +0 -20
- package/build/type/engine/options/instantiate.d.mts +0 -8
- package/build/type/engine/options/instantiate.mjs +0 -13
- package/build/type/engine/partial/from-intersect.d.mts +0 -5
- package/build/type/engine/partial/from-intersect.mjs +0 -7
- package/build/type/engine/partial/from-type.d.mts +0 -12
- package/build/type/engine/partial/from-type.mjs +0 -17
- package/build/type/engine/readonly-type/from-intersect.d.mts +0 -5
- package/build/type/engine/readonly-type/from-intersect.mjs +0 -7
- package/build/type/engine/readonly-type/from-type.d.mts +0 -16
- package/build/type/engine/readonly-type/from-type.mjs +0 -22
- package/build/type/engine/readonly-type/instantiate.d.mts +0 -9
- package/build/type/engine/readonly-type/instantiate.mjs +0 -14
- package/build/type/engine/record/from-key-enum.mjs +0 -8
- package/build/type/engine/record/from-key-template-literal.mjs +0 -12
- package/build/type/engine/required/from-intersect.d.mts +0 -5
- package/build/type/engine/required/from-intersect.mjs +0 -7
- package/build/type/engine/required/from-type.d.mts +0 -12
- package/build/type/engine/required/from-type.mjs +0 -17
- package/build/type/engine/return-type/index.d.mts +0 -1
- package/build/type/engine/return-type/index.mjs +0 -1
- package/build/type/engine/return-type/instantiate.d.mts +0 -11
- package/build/type/engine/return-type/instantiate.mjs +0 -18
- package/build/type/engine/template-literal/instantiate.mjs +0 -14
- package/build/type/extends/async-iterator.d.mts +0 -7
- package/build/type/extends/async-iterator.mjs +0 -9
- package/build/type/extends/extends-right.mjs +0 -43
- package/build/type/extends/iterator.d.mts +0 -7
- package/build/type/extends/iterator.mjs +0 -9
- package/build/type/extends/promise.d.mts +0 -7
- package/build/type/extends/promise.mjs +0 -9
- package/build/type/extends/template-literal.d.mts +0 -6
- package/build/type/extends/template-literal.mjs +0 -7
- package/build/type/types/async-iterator.d.mts +0 -16
- package/build/type/types/async-iterator.mjs +0 -24
- package/build/type/types/base.d.mts +0 -50
- package/build/type/types/base.mjs +0 -84
- package/build/type/types/iterator.d.mts +0 -16
- package/build/type/types/promise.d.mts +0 -16
- package/build/type/types/promise.mjs +0 -24
- package/build/value/clean/from-base.d.mts +0 -2
- package/build/value/clean/from-base.mjs +0 -4
- package/build/value/clean/from-type.mjs +0 -23
- package/build/value/convert/from-base.d.mts +0 -2
- package/build/value/convert/from-base.mjs +0 -4
- package/build/value/convert/from-enum.mjs +0 -7
- package/build/value/convert/from-type.mjs +0 -45
- package/build/value/create/from-async-iterator.d.mts +0 -2
- package/build/value/create/from-async-iterator.mjs +0 -5
- package/build/value/create/from-base.d.mts +0 -2
- package/build/value/create/from-base.mjs +0 -4
- package/build/value/create/from-enum.mjs +0 -6
- package/build/value/create/from-iterator.d.mts +0 -2
- package/build/value/create/from-iterator.mjs +0 -5
- package/build/value/create/from-promise.d.mts +0 -2
- package/build/value/create/from-promise.mjs +0 -5
- package/build/value/create/from-type.mjs +0 -69
- package/build/value/default/from-base.d.mts +0 -2
- package/build/value/default/from-base.mjs +0 -5
- package/build/value/default/from-intersect.d.mts +0 -2
- package/build/value/default/from-type.mjs +0 -27
- package/build/value/mutate/error.d.mts +0 -3
- package/build/value/mutate/error.mjs +0 -6
- package/build/value/mutate/from-array.d.mts +0 -2
- package/build/value/mutate/from-array.mjs +0 -16
- package/build/value/mutate/from-object.d.mts +0 -2
- package/build/value/mutate/from-object.mjs +0 -27
- package/build/value/mutate/from-unknown.d.mts +0 -2
- package/build/value/mutate/from-unknown.mjs +0 -7
- package/build/value/mutate/from-value.d.mts +0 -2
- package/build/value/mutate/from-value.mjs +0 -12
- package/build/value/mutate/index.d.mts +0 -1
- package/build/value/mutate/index.mjs +0 -1
- package/build/value/mutate/mutate.d.mts +0 -9
- package/build/value/mutate/mutate.mjs +0 -39
- package/build/value/repair/from-base.d.mts +0 -2
- package/build/value/repair/from-base.mjs +0 -8
- package/build/value/repair/from-enum.mjs +0 -7
- package/build/value/repair/from-template-literal.mjs +0 -7
- package/build/value/shared/union-priority-sort.d.mts +0 -3
- package/build/value/shared/union-priority-sort.mjs +0 -36
- /package/build/format/{date-time.d.mts → date_time.d.mts} +0 -0
- /package/build/format/{date-time.mjs → date_time.mjs} +0 -0
- /package/build/format/{idn-email.d.mts → idn_email.d.mts} +0 -0
- /package/build/format/{idn-email.mjs → idn_email.mjs} +0 -0
- /package/build/format/{idn-hostname.d.mts → idn_hostname.d.mts} +0 -0
- /package/build/format/{idn-hostname.mjs → idn_hostname.mjs} +0 -0
- /package/build/format/{iri-reference.d.mts → iri_reference.d.mts} +0 -0
- /package/build/format/{iri-reference.mjs → iri_reference.mjs} +0 -0
- /package/build/format/{json-pointer.d.mts → json_pointer.d.mts} +0 -0
- /package/build/format/{json-pointer.mjs → json_pointer.mjs} +0 -0
- /package/build/format/{json-pointer-uri-fragment.d.mts → json_pointer_uri_fragment.d.mts} +0 -0
- /package/build/format/{json-pointer-uri-fragment.mjs → json_pointer_uri_fragment.mjs} +0 -0
- /package/build/format/{relative-json-pointer.d.mts → relative_json_pointer.d.mts} +0 -0
- /package/build/format/{relative-json-pointer.mjs → relative_json_pointer.mjs} +0 -0
- /package/build/format/{uri-reference.d.mts → uri_reference.d.mts} +0 -0
- /package/build/format/{uri-reference.mjs → uri_reference.mjs} +0 -0
- /package/build/format/{uri-template.d.mts → uri_template.d.mts} +0 -0
- /package/build/format/{uri-template.mjs → uri_template.mjs} +0 -0
- /package/build/schema/pointer/{pointer-get.d.mts → pointer_get.d.mts} +0 -0
- /package/build/schema/pointer/{pointer-get.mjs → pointer_get.mjs} +0 -0
- /package/build/schema/static/{~comparer.mjs → _canonical.mjs} +0 -0
- /package/build/schema/static/{~comparer.d.mts → _comparer.d.mts} +0 -0
- /package/build/schema/static/{~elements.mjs → _comparer.mjs} +0 -0
- /package/build/schema/static/{~non-readonly.mjs → _elements.mjs} +0 -0
- /package/build/type/engine/call/{distribute-arguments.d.mts → distribute_arguments.d.mts} +0 -0
- /package/build/type/engine/call/{resolve-arguments.d.mts → resolve_arguments.d.mts} +0 -0
- /package/build/type/engine/call/{resolve-target.d.mts → resolve_target.d.mts} +0 -0
- /package/build/type/engine/call/{resolve-target.mjs → resolve_target.mjs} +0 -0
- /package/build/type/engine/{awaited → constructor_parameters}/index.d.mts +0 -0
- /package/build/type/engine/{awaited → constructor_parameters}/index.mjs +0 -0
- /package/build/type/engine/enum/{typescript-enum-to-enum-values.d.mts → typescript_enum_to_enum_values.d.mts} +0 -0
- /package/build/type/engine/enum/{typescript-enum-to-enum-values.mjs → typescript_enum_to_enum_values.mjs} +0 -0
- /package/build/type/engine/helpers/{keys-to-indexer.d.mts → keys_to_indexer.d.mts} +0 -0
- /package/build/type/engine/helpers/{keys-to-indexer.mjs → keys_to_indexer.mjs} +0 -0
- /package/build/type/engine/indexable/{from-literal.mjs → from_literal.mjs} +0 -0
- /package/build/type/engine/indexable/{to-indexable.d.mts → to_indexable.d.mts} +0 -0
- /package/build/type/engine/indexable/{to-indexable.mjs → to_indexable.mjs} +0 -0
- /package/build/type/engine/indexed/{array-indexer.d.mts → array_indexer.d.mts} +0 -0
- /package/build/type/engine/indexed/{array-indexer.mjs → array_indexer.mjs} +0 -0
- /package/build/type/engine/indexed/{from-array.d.mts → from_array.d.mts} +0 -0
- /package/build/type/engine/indexed/{from-array.mjs → from_array.mjs} +0 -0
- /package/build/type/engine/{constructor-parameters → instance_type}/index.d.mts +0 -0
- /package/build/type/engine/{constructor-parameters → instance_type}/index.mjs +0 -0
- /package/build/type/engine/intrinsics/{from-literal.d.mts → from_literal.d.mts} +0 -0
- /package/build/type/engine/intrinsics/{from-literal.mjs → from_literal.mjs} +0 -0
- /package/build/type/engine/keyof/{from-any.d.mts → from_any.d.mts} +0 -0
- /package/build/type/engine/keyof/{from-any.mjs → from_any.mjs} +0 -0
- /package/build/type/engine/keyof/{from-array.d.mts → from_array.d.mts} +0 -0
- /package/build/type/engine/keyof/{from-array.mjs → from_array.mjs} +0 -0
- /package/build/type/engine/keyof/{from-object.d.mts → from_object.d.mts} +0 -0
- /package/build/type/engine/keyof/{from-object.mjs → from_object.mjs} +0 -0
- /package/build/type/engine/keyof/{from-record.d.mts → from_record.d.mts} +0 -0
- /package/build/type/engine/keyof/{from-record.mjs → from_record.mjs} +0 -0
- /package/build/type/engine/keyof/{from-tuple.d.mts → from_tuple.d.mts} +0 -0
- /package/build/type/engine/keyof/{from-tuple.mjs → from_tuple.mjs} +0 -0
- /package/build/type/engine/{instance-type → non_nullable}/index.d.mts +0 -0
- /package/build/type/engine/{instance-type → non_nullable}/index.mjs +0 -0
- /package/build/type/engine/object/{from-object.d.mts → from_object.d.mts} +0 -0
- /package/build/type/engine/object/{from-object.mjs → from_object.mjs} +0 -0
- /package/build/type/engine/{non-nullable → readonly_object}/index.d.mts +0 -0
- /package/build/type/engine/{non-nullable → readonly_object}/index.mjs +0 -0
- /package/build/type/engine/record/{from-key-any.d.mts → from_key_any.d.mts} +0 -0
- /package/build/type/engine/record/{from-key-boolean.d.mts → from_key_boolean.d.mts} +0 -0
- /package/build/type/engine/record/{from-key-boolean.mjs → from_key_boolean.mjs} +0 -0
- /package/build/type/engine/record/{from-key-integer.d.mts → from_key_integer.d.mts} +0 -0
- /package/build/type/engine/record/{from-key-literal.d.mts → from_key_literal.d.mts} +0 -0
- /package/build/type/engine/record/{from-key-literal.mjs → from_key_literal.mjs} +0 -0
- /package/build/type/engine/record/{from-key-number.d.mts → from_key_number.d.mts} +0 -0
- /package/build/type/engine/record/{from-key-string.d.mts → from_key_string.d.mts} +0 -0
- /package/build/type/engine/record/{from-key-union.d.mts → from_key_union.d.mts} +0 -0
- /package/build/type/engine/record/{record-create.d.mts → record_create.d.mts} +0 -0
- /package/build/type/engine/record/{record-create.mjs → record_create.mjs} +0 -0
- /package/build/type/engine/{options → return_type}/index.d.mts +0 -0
- /package/build/type/engine/{options → return_type}/index.mjs +0 -0
- /package/build/type/engine/{template-literal → template_literal}/create.d.mts +0 -0
- /package/build/type/engine/{template-literal → template_literal}/create.mjs +0 -0
- /package/build/type/engine/{template-literal/is-finite.d.mts → template_literal/is_finite.d.mts} +0 -0
- /package/build/type/engine/{template-literal/is-pattern.d.mts → template_literal/is_pattern.d.mts} +0 -0
- /package/build/type/engine/{template-literal → template_literal}/static.d.mts +0 -0
- /package/build/type/engine/{template-literal → template_literal}/static.mjs +0 -0
- /package/build/type/engine/tuple/{to-object.d.mts → to_object.d.mts} +0 -0
- /package/build/type/engine/tuple/{to-object.mjs → to_object.mjs} +0 -0
- /package/build/type/engine/{readonly-type → with}/index.d.mts +0 -0
- /package/build/type/engine/{readonly-type → with}/index.mjs +0 -0
- /package/build/value/clean/{from-array.d.mts → from_array.d.mts} +0 -0
- /package/build/value/{convert/from-cyclic.d.mts → clean/from_cyclic.d.mts} +0 -0
- /package/build/value/clean/{from-intersect.d.mts → from_intersect.d.mts} +0 -0
- /package/build/value/clean/{from-object.d.mts → from_object.d.mts} +0 -0
- /package/build/value/clean/{from-record.d.mts → from_record.d.mts} +0 -0
- /package/build/value/clean/{from-ref.d.mts → from_ref.d.mts} +0 -0
- /package/build/value/clean/{from-tuple.d.mts → from_tuple.d.mts} +0 -0
- /package/build/value/clean/{from-type.d.mts → from_type.d.mts} +0 -0
- /package/build/value/{repair/from-union.d.mts → clean/from_union.d.mts} +0 -0
- /package/build/value/codec/{from-array.d.mts → from_array.d.mts} +0 -0
- /package/build/value/codec/{from-cyclic.d.mts → from_cyclic.d.mts} +0 -0
- /package/build/value/codec/{from-intersect.d.mts → from_intersect.d.mts} +0 -0
- /package/build/value/codec/{from-object.d.mts → from_object.d.mts} +0 -0
- /package/build/value/codec/{from-record.d.mts → from_record.d.mts} +0 -0
- /package/build/value/codec/{from-ref.d.mts → from_ref.d.mts} +0 -0
- /package/build/value/codec/{from-tuple.d.mts → from_tuple.d.mts} +0 -0
- /package/build/value/codec/{from-type.d.mts → from_type.d.mts} +0 -0
- /package/build/value/codec/{from-union.d.mts → from_union.d.mts} +0 -0
- /package/build/value/convert/{from-additional.d.mts → from_additional.d.mts} +0 -0
- /package/build/value/convert/{from-array.d.mts → from_array.d.mts} +0 -0
- /package/build/value/convert/{from-bigint.d.mts → from_bigint.d.mts} +0 -0
- /package/build/value/convert/{from-bigint.mjs → from_bigint.mjs} +0 -0
- /package/build/value/convert/{from-boolean.d.mts → from_boolean.d.mts} +0 -0
- /package/build/value/convert/{from-boolean.mjs → from_boolean.mjs} +0 -0
- /package/build/value/{default/from-cyclic.d.mts → convert/from_cyclic.d.mts} +0 -0
- /package/build/value/convert/{from-enum.d.mts → from_enum.d.mts} +0 -0
- /package/build/value/convert/{from-integer.d.mts → from_integer.d.mts} +0 -0
- /package/build/value/convert/{from-integer.mjs → from_integer.mjs} +0 -0
- /package/build/value/convert/{from-intersect.d.mts → from_intersect.d.mts} +0 -0
- /package/build/value/convert/{from-literal.mjs → from_literal.mjs} +0 -0
- /package/build/value/convert/{from-null.d.mts → from_null.d.mts} +0 -0
- /package/build/value/convert/{from-null.mjs → from_null.mjs} +0 -0
- /package/build/value/convert/{from-number.d.mts → from_number.d.mts} +0 -0
- /package/build/value/convert/{from-number.mjs → from_number.mjs} +0 -0
- /package/build/value/convert/{from-object.d.mts → from_object.d.mts} +0 -0
- /package/build/value/convert/{from-record.d.mts → from_record.d.mts} +0 -0
- /package/build/value/convert/{from-ref.d.mts → from_ref.d.mts} +0 -0
- /package/build/value/convert/{from-string.d.mts → from_string.d.mts} +0 -0
- /package/build/value/convert/{from-string.mjs → from_string.mjs} +0 -0
- /package/build/value/convert/{from-tuple.d.mts → from_tuple.d.mts} +0 -0
- /package/build/value/convert/{from-type.d.mts → from_type.d.mts} +0 -0
- /package/build/value/convert/{from-undefined.d.mts → from_undefined.d.mts} +0 -0
- /package/build/value/convert/{from-undefined.mjs → from_undefined.mjs} +0 -0
- /package/build/value/convert/{from-union.d.mts → from_union.d.mts} +0 -0
- /package/build/value/convert/{from-void.d.mts → from_void.d.mts} +0 -0
- /package/build/value/convert/{from-void.mjs → from_void.mjs} +0 -0
- /package/build/value/convert/try/{try-result.d.mts → try_result.d.mts} +0 -0
- /package/build/value/convert/try/{try-result.mjs → try_result.mjs} +0 -0
- /package/build/value/create/{from-array.d.mts → from_array.d.mts} +0 -0
- /package/build/value/create/{from-bigint.d.mts → from_bigint.d.mts} +0 -0
- /package/build/value/create/{from-bigint.mjs → from_bigint.mjs} +0 -0
- /package/build/value/create/{from-boolean.d.mts → from_boolean.d.mts} +0 -0
- /package/build/value/create/{from-boolean.mjs → from_boolean.mjs} +0 -0
- /package/build/value/create/{from-constructor.d.mts → from_constructor.d.mts} +0 -0
- /package/build/value/create/{from-cyclic.d.mts → from_cyclic.d.mts} +0 -0
- /package/build/value/create/{from-default.d.mts → from_default.d.mts} +0 -0
- /package/build/value/create/{from-default.mjs → from_default.mjs} +0 -0
- /package/build/value/create/{from-enum.d.mts → from_enum.d.mts} +0 -0
- /package/build/value/create/{from-function.d.mts → from_function.d.mts} +0 -0
- /package/build/value/create/{from-integer.d.mts → from_integer.d.mts} +0 -0
- /package/build/value/create/{from-integer.mjs → from_integer.mjs} +0 -0
- /package/build/value/create/{from-intersect.d.mts → from_intersect.d.mts} +0 -0
- /package/build/value/create/{from-literal.d.mts → from_literal.d.mts} +0 -0
- /package/build/value/create/{from-literal.mjs → from_literal.mjs} +0 -0
- /package/build/value/create/{from-never.d.mts → from_never.d.mts} +0 -0
- /package/build/value/create/{from-never.mjs → from_never.mjs} +0 -0
- /package/build/value/create/{from-null.d.mts → from_null.d.mts} +0 -0
- /package/build/value/create/{from-null.mjs → from_null.mjs} +0 -0
- /package/build/value/create/{from-number.d.mts → from_number.d.mts} +0 -0
- /package/build/value/create/{from-number.mjs → from_number.mjs} +0 -0
- /package/build/value/create/{from-object.d.mts → from_object.d.mts} +0 -0
- /package/build/value/create/{from-record.d.mts → from_record.d.mts} +0 -0
- /package/build/value/create/{from-record.mjs → from_record.mjs} +0 -0
- /package/build/value/create/{from-ref.d.mts → from_ref.d.mts} +0 -0
- /package/build/value/create/{from-string.d.mts → from_string.d.mts} +0 -0
- /package/build/value/create/{from-string.mjs → from_string.mjs} +0 -0
- /package/build/value/create/{from-symbol.d.mts → from_symbol.d.mts} +0 -0
- /package/build/value/create/{from-symbol.mjs → from_symbol.mjs} +0 -0
- /package/build/value/create/{from-template-literal.d.mts → from_template_literal.d.mts} +0 -0
- /package/build/value/create/{from-tuple.d.mts → from_tuple.d.mts} +0 -0
- /package/build/value/create/{from-type.d.mts → from_type.d.mts} +0 -0
- /package/build/value/create/{from-undefined.d.mts → from_undefined.d.mts} +0 -0
- /package/build/value/create/{from-undefined.mjs → from_undefined.mjs} +0 -0
- /package/build/value/create/{from-union.d.mts → from_union.d.mts} +0 -0
- /package/build/value/create/{from-void.d.mts → from_void.d.mts} +0 -0
- /package/build/value/create/{from-void.mjs → from_void.mjs} +0 -0
- /package/build/value/default/{from-array.d.mts → from_array.d.mts} +0 -0
- /package/build/value/default/{from-default.d.mts → from_default.d.mts} +0 -0
- /package/build/value/default/{from-default.mjs → from_default.mjs} +0 -0
- /package/build/value/{repair/from-intersect.d.mts → default/from_intersect.d.mts} +0 -0
- /package/build/value/default/{from-object.d.mts → from_object.d.mts} +0 -0
- /package/build/value/default/{from-record.d.mts → from_record.d.mts} +0 -0
- /package/build/value/default/{from-ref.d.mts → from_ref.d.mts} +0 -0
- /package/build/value/default/{from-tuple.d.mts → from_tuple.d.mts} +0 -0
- /package/build/value/default/{from-type.d.mts → from_type.d.mts} +0 -0
- /package/build/value/default/{from-union.d.mts → from_union.d.mts} +0 -0
- /package/build/value/repair/{from-array.d.mts → from_array.d.mts} +0 -0
- /package/build/value/repair/{from-enum.d.mts → from_enum.d.mts} +0 -0
- /package/build/value/repair/{from-object.d.mts → from_object.d.mts} +0 -0
- /package/build/value/repair/{from-record.d.mts → from_record.d.mts} +0 -0
- /package/build/value/repair/{from-ref.d.mts → from_ref.d.mts} +0 -0
- /package/build/value/repair/{from-template-literal.d.mts → from_template_literal.d.mts} +0 -0
- /package/build/value/repair/{from-tuple.d.mts → from_tuple.d.mts} +0 -0
- /package/build/value/repair/{from-type.d.mts → from_type.d.mts} +0 -0
- /package/build/value/repair/{from-unknown.d.mts → from_unknown.d.mts} +0 -0
- /package/build/value/repair/{from-unknown.mjs → from_unknown.mjs} +0 -0
- /package/build/value/shared/{optional-undefined.d.mts → optional_undefined.d.mts} +0 -0
- /package/build/value/shared/{optional-undefined.mjs → optional_undefined.mjs} +0 -0
- /package/build/value/shared/{union-score-select.d.mts → union_score_select.d.mts} +0 -0
- /package/build/value/shared/{union-score-select.mjs → union_score_select.mjs} +0 -0
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { IsCyclic } from '../types/cyclic.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { Unknown } from '../types/unknown.mjs';
|
|
4
|
+
import { IsUnsafe } from '../types/unsafe.mjs';
|
|
5
|
+
import { ExtendsLeft } from './extends_left.mjs';
|
|
4
6
|
import { CyclicExtends } from '../engine/cyclic/index.mjs';
|
|
5
|
-
function
|
|
6
|
-
return (IsCyclic(type)
|
|
7
|
-
?
|
|
8
|
-
|
|
7
|
+
function Canonical(type) {
|
|
8
|
+
return (IsCyclic(type) ? CyclicExtends(type) :
|
|
9
|
+
IsUnsafe(type) ? Unknown() :
|
|
10
|
+
type);
|
|
9
11
|
}
|
|
10
12
|
/** Performs a structural extends check on left and right types and yields inferred types on right if specified. */
|
|
11
13
|
export function Extends(inferred, left, right) {
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
return ExtendsLeft(inferred,
|
|
14
|
+
const canonicalLeft = Canonical(left);
|
|
15
|
+
const canonicalRight = Canonical(right);
|
|
16
|
+
return ExtendsLeft(inferred, canonicalLeft, canonicalRight);
|
|
15
17
|
}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import { type TExtendsAny } from './any.mjs';
|
|
2
2
|
import { type TExtendsArray } from './array.mjs';
|
|
3
|
-
import { type TExtendsAsyncIterator } from './async-iterator.mjs';
|
|
4
3
|
import { type TExtendsBigInt } from './bigint.mjs';
|
|
5
4
|
import { type TExtendsBoolean } from './boolean.mjs';
|
|
6
5
|
import { type TExtendsConstructor } from './constructor.mjs';
|
|
6
|
+
import { type TExtendsDependent } from './dependent.mjs';
|
|
7
7
|
import { type TExtendsEnum } from './enum.mjs';
|
|
8
8
|
import { type TExtendsFunction } from './function.mjs';
|
|
9
9
|
import { type TExtendsInteger } from './integer.mjs';
|
|
10
10
|
import { type TExtendsIntersect } from './intersect.mjs';
|
|
11
|
-
import { type TExtendsIterator } from './iterator.mjs';
|
|
12
11
|
import { type TExtendsLiteral } from './literal.mjs';
|
|
13
12
|
import { type TExtendsNever } from './never.mjs';
|
|
14
13
|
import { type TExtendsNull } from './null.mjs';
|
|
15
14
|
import { type TExtendsNumber } from './number.mjs';
|
|
16
15
|
import { type TExtendsObject } from './object.mjs';
|
|
17
|
-
import { type
|
|
16
|
+
import { type TExtendsRecord } from './record.mjs';
|
|
18
17
|
import { type TExtendsString } from './string.mjs';
|
|
19
18
|
import { type TExtendsSymbol } from './symbol.mjs';
|
|
20
|
-
import { type TExtendsTemplateLiteral } from './
|
|
19
|
+
import { type TExtendsTemplateLiteral } from './template_literal.mjs';
|
|
21
20
|
import { type TExtendsTuple } from './tuple.mjs';
|
|
22
21
|
import { type TExtendsUndefined } from './undefined.mjs';
|
|
23
22
|
import { type TExtendsUnion } from './union.mjs';
|
|
@@ -25,25 +24,24 @@ import { type TExtendsUnknown } from './unknown.mjs';
|
|
|
25
24
|
import { type TExtendsVoid } from './void.mjs';
|
|
26
25
|
import { type TAny } from '../types/any.mjs';
|
|
27
26
|
import { type TArray } from '../types/array.mjs';
|
|
28
|
-
import { type TAsyncIterator } from '../types/async-iterator.mjs';
|
|
29
27
|
import { type TBigInt } from '../types/bigint.mjs';
|
|
30
28
|
import { type TBoolean } from '../types/boolean.mjs';
|
|
31
29
|
import { type TConstructor } from '../types/constructor.mjs';
|
|
30
|
+
import { type TDependent } from '../types/dependent.mjs';
|
|
32
31
|
import { type TEnum, type TEnumValue } from '../types/enum.mjs';
|
|
33
32
|
import { type TFunction } from '../types/function.mjs';
|
|
34
33
|
import { type TInteger } from '../types/integer.mjs';
|
|
35
34
|
import { type TIntersect } from '../types/intersect.mjs';
|
|
36
|
-
import { type TIterator } from '../types/iterator.mjs';
|
|
37
35
|
import { type TLiteral } from '../types/literal.mjs';
|
|
38
36
|
import { type TNever } from '../types/never.mjs';
|
|
39
37
|
import { type TNull } from '../types/null.mjs';
|
|
40
38
|
import { type TNumber } from '../types/number.mjs';
|
|
41
39
|
import { type TObject } from '../types/object.mjs';
|
|
42
|
-
import { type
|
|
40
|
+
import { type TRecord } from '../types/record.mjs';
|
|
43
41
|
import { type TSchema } from '../types/schema.mjs';
|
|
44
42
|
import { type TString } from '../types/string.mjs';
|
|
45
43
|
import { type TSymbol } from '../types/symbol.mjs';
|
|
46
|
-
import { type TTemplateLiteral } from '../types/
|
|
44
|
+
import { type TTemplateLiteral } from '../types/template_literal.mjs';
|
|
47
45
|
import { type TTuple } from '../types/tuple.mjs';
|
|
48
46
|
import { type TUndefined } from '../types/undefined.mjs';
|
|
49
47
|
import { type TUnknown } from '../types/unknown.mjs';
|
|
@@ -51,5 +49,5 @@ import { type TProperties } from '../types/properties.mjs';
|
|
|
51
49
|
import { type TUnion } from '../types/union.mjs';
|
|
52
50
|
import { type TVoid } from '../types/void.mjs';
|
|
53
51
|
import * as Result from './result.mjs';
|
|
54
|
-
export type TExtendsLeft<Inferred extends TProperties, Left extends TSchema, Right extends TSchema> = (Left extends TAny ? TExtendsAny<Inferred, Left, Right> : Left extends TArray<infer Items extends TSchema> ? TExtendsArray<Inferred, Left, Items, Right> : Left extends
|
|
52
|
+
export type TExtendsLeft<Inferred extends TProperties, Left extends TSchema, Right extends TSchema> = (Left extends TAny ? TExtendsAny<Inferred, Left, Right> : Left extends TArray<infer Items extends TSchema> ? TExtendsArray<Inferred, Left, Items, Right> : Left extends TBigInt ? TExtendsBigInt<Inferred, Left, Right> : Left extends TBoolean ? TExtendsBoolean<Inferred, Left, Right> : Left extends TConstructor<infer Parameters extends TSchema[], infer InstanceType extends TSchema> ? TExtendsConstructor<Inferred, Parameters, InstanceType, Right> : Left extends TDependent<infer If extends TSchema, infer Then extends TSchema, infer Else extends TSchema> ? TExtendsDependent<Inferred, If, Then, Else, Right> : Left extends TEnum<infer Values extends TEnumValue[]> ? TExtendsEnum<Inferred, Values, Right> : Left extends TFunction<infer Parameters extends TSchema[], infer ReturnType extends TSchema> ? TExtendsFunction<Inferred, Parameters, ReturnType, Right> : Left extends TInteger ? TExtendsInteger<Inferred, Left, Right> : Left extends TIntersect<infer Types extends TSchema[]> ? TExtendsIntersect<Inferred, Types, Right> : Left extends TLiteral ? TExtendsLiteral<Inferred, Left, Right> : Left extends TNever ? TExtendsNever<Inferred, Left, Right> : Left extends TNull ? TExtendsNull<Inferred, Left, Right> : Left extends TNumber ? TExtendsNumber<Inferred, Left, Right> : Left extends TObject<infer Properties extends TProperties> ? TExtendsObject<Inferred, Properties, Right> : Left extends TRecord<infer Pattern extends string, infer Value extends TSchema> ? TExtendsRecord<Inferred, Pattern, Value, Right> : Left extends TString ? TExtendsString<Inferred, Left, Right> : Left extends TSymbol ? TExtendsSymbol<Inferred, Left, Right> : Left extends TTemplateLiteral<infer Pattern extends string> ? TExtendsTemplateLiteral<Inferred, Pattern, Right> : Left extends TTuple<infer Types extends TSchema[]> ? TExtendsTuple<Inferred, Types, Right> : Left extends TUndefined ? TExtendsUndefined<Inferred, Left, Right> : Left extends TUnion<infer Types extends TSchema[]> ? TExtendsUnion<Inferred, Types, Right> : Left extends TUnknown ? TExtendsUnknown<Inferred, Left, Right> : Left extends TVoid ? TExtendsVoid<Inferred, Left, Right> : Result.TExtendsFalse);
|
|
55
53
|
export declare function ExtendsLeft<Inferred extends TProperties, Left extends TSchema, Right extends TSchema>(inferred: Inferred, left: Left, right: Right): TExtendsLeft<Inferred, Left, Right>;
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { ExtendsAny } from './any.mjs';
|
|
3
3
|
import { ExtendsArray } from './array.mjs';
|
|
4
|
-
import { ExtendsAsyncIterator } from './async-iterator.mjs';
|
|
5
4
|
import { ExtendsBigInt } from './bigint.mjs';
|
|
6
5
|
import { ExtendsBoolean } from './boolean.mjs';
|
|
7
6
|
import { ExtendsConstructor } from './constructor.mjs';
|
|
7
|
+
import { ExtendsDependent } from './dependent.mjs';
|
|
8
8
|
import { ExtendsEnum } from './enum.mjs';
|
|
9
9
|
import { ExtendsFunction } from './function.mjs';
|
|
10
10
|
import { ExtendsInteger } from './integer.mjs';
|
|
11
11
|
import { ExtendsIntersect } from './intersect.mjs';
|
|
12
|
-
import { ExtendsIterator } from './iterator.mjs';
|
|
13
12
|
import { ExtendsLiteral } from './literal.mjs';
|
|
14
13
|
import { ExtendsNever } from './never.mjs';
|
|
15
14
|
import { ExtendsNull } from './null.mjs';
|
|
16
15
|
import { ExtendsNumber } from './number.mjs';
|
|
17
16
|
import { ExtendsObject } from './object.mjs';
|
|
18
|
-
import {
|
|
17
|
+
import { ExtendsRecord } from './record.mjs';
|
|
19
18
|
import { ExtendsString } from './string.mjs';
|
|
20
19
|
import { ExtendsSymbol } from './symbol.mjs';
|
|
21
|
-
import { ExtendsTemplateLiteral } from './
|
|
20
|
+
import { ExtendsTemplateLiteral } from './template_literal.mjs';
|
|
22
21
|
import { ExtendsTuple } from './tuple.mjs';
|
|
23
22
|
import { ExtendsUndefined } from './undefined.mjs';
|
|
24
23
|
import { ExtendsUnion } from './union.mjs';
|
|
@@ -29,24 +28,23 @@ import { ExtendsVoid } from './void.mjs';
|
|
|
29
28
|
// ----------------------------------------------------------------------------
|
|
30
29
|
import { IsAny } from '../types/any.mjs';
|
|
31
30
|
import { IsArray } from '../types/array.mjs';
|
|
32
|
-
import { IsAsyncIterator } from '../types/async-iterator.mjs';
|
|
33
31
|
import { IsBigInt } from '../types/bigint.mjs';
|
|
34
32
|
import { IsBoolean } from '../types/boolean.mjs';
|
|
35
33
|
import { IsConstructor } from '../types/constructor.mjs';
|
|
34
|
+
import { IsDependent } from '../types/dependent.mjs';
|
|
36
35
|
import { IsEnum } from '../types/enum.mjs';
|
|
37
36
|
import { IsFunction } from '../types/function.mjs';
|
|
38
37
|
import { IsInteger } from '../types/integer.mjs';
|
|
39
38
|
import { IsIntersect } from '../types/intersect.mjs';
|
|
40
|
-
import { IsIterator } from '../types/iterator.mjs';
|
|
41
39
|
import { IsLiteral } from '../types/literal.mjs';
|
|
42
40
|
import { IsNever } from '../types/never.mjs';
|
|
43
41
|
import { IsNull } from '../types/null.mjs';
|
|
44
42
|
import { IsNumber } from '../types/number.mjs';
|
|
45
43
|
import { IsObject } from '../types/object.mjs';
|
|
46
|
-
import {
|
|
44
|
+
import { IsRecord, RecordPattern, RecordValue } from '../types/record.mjs';
|
|
47
45
|
import { IsString } from '../types/string.mjs';
|
|
48
46
|
import { IsSymbol } from '../types/symbol.mjs';
|
|
49
|
-
import { IsTemplateLiteral } from '../types/
|
|
47
|
+
import { IsTemplateLiteral } from '../types/template_literal.mjs';
|
|
50
48
|
import { IsTuple } from '../types/tuple.mjs';
|
|
51
49
|
import { IsUndefined } from '../types/undefined.mjs';
|
|
52
50
|
import { IsUnknown } from '../types/unknown.mjs';
|
|
@@ -56,28 +54,27 @@ import * as Result from './result.mjs';
|
|
|
56
54
|
export function ExtendsLeft(inferred, left, right) {
|
|
57
55
|
return (IsAny(left) ? ExtendsAny(inferred, left, right) :
|
|
58
56
|
IsArray(left) ? ExtendsArray(inferred, left, left.items, right) :
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
IsEnum(left) ? ExtendsEnum(inferred, left, right) :
|
|
57
|
+
IsBigInt(left) ? ExtendsBigInt(inferred, left, right) :
|
|
58
|
+
IsBoolean(left) ? ExtendsBoolean(inferred, left, right) :
|
|
59
|
+
IsConstructor(left) ? ExtendsConstructor(inferred, left.parameters, left.instanceType, right) :
|
|
60
|
+
IsDependent(left) ? ExtendsDependent(inferred, left.if, left.then, left.else, right) :
|
|
61
|
+
IsEnum(left) ? ExtendsEnum(inferred, left.enum, right) :
|
|
64
62
|
IsFunction(left) ? ExtendsFunction(inferred, left.parameters, left.returnType, right) :
|
|
65
63
|
IsInteger(left) ? ExtendsInteger(inferred, left, right) :
|
|
66
64
|
IsIntersect(left) ? ExtendsIntersect(inferred, left.allOf, right) :
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
Result.ExtendsFalse());
|
|
65
|
+
IsLiteral(left) ? ExtendsLiteral(inferred, left, right) :
|
|
66
|
+
IsNever(left) ? ExtendsNever(inferred, left, right) :
|
|
67
|
+
IsNull(left) ? ExtendsNull(inferred, left, right) :
|
|
68
|
+
IsNumber(left) ? ExtendsNumber(inferred, left, right) :
|
|
69
|
+
IsObject(left) ? ExtendsObject(inferred, left.properties, right) :
|
|
70
|
+
IsRecord(left) ? ExtendsRecord(inferred, RecordPattern(left), RecordValue(left), right) :
|
|
71
|
+
IsString(left) ? ExtendsString(inferred, left, right) :
|
|
72
|
+
IsSymbol(left) ? ExtendsSymbol(inferred, left, right) :
|
|
73
|
+
IsTemplateLiteral(left) ? ExtendsTemplateLiteral(inferred, left.pattern, right) :
|
|
74
|
+
IsTuple(left) ? ExtendsTuple(inferred, left.items, right) :
|
|
75
|
+
IsUndefined(left) ? ExtendsUndefined(inferred, left, right) :
|
|
76
|
+
IsUnion(left) ? ExtendsUnion(inferred, left.anyOf, right) :
|
|
77
|
+
IsUnknown(left) ? ExtendsUnknown(inferred, left, right) :
|
|
78
|
+
IsVoid(left) ? ExtendsVoid(inferred, left, right) :
|
|
79
|
+
Result.ExtendsFalse());
|
|
83
80
|
}
|
|
@@ -2,24 +2,26 @@ import { Memory } from '../../system/memory/index.mjs';
|
|
|
2
2
|
import { type TSchema } from '../types/schema.mjs';
|
|
3
3
|
import { type TProperties } from '../types/properties.mjs';
|
|
4
4
|
import { type TAny } from '../types/any.mjs';
|
|
5
|
+
import { type TDependent } from '../types/dependent.mjs';
|
|
5
6
|
import { type TEnum, type TEnumValue } from '../types/enum.mjs';
|
|
6
7
|
import { type TInfer } from '../types/infer.mjs';
|
|
7
8
|
import { type TIntersect } from '../types/intersect.mjs';
|
|
8
|
-
import { type TTemplateLiteral } from '../types/
|
|
9
|
+
import { type TTemplateLiteral } from '../types/template_literal.mjs';
|
|
9
10
|
import { type TUnion } from '../types/union.mjs';
|
|
10
11
|
import { type TUnknown } from '../types/unknown.mjs';
|
|
11
|
-
import { type TExtendsLeft } from './
|
|
12
|
+
import { type TExtendsLeft } from './extends_left.mjs';
|
|
12
13
|
import * as Result from './result.mjs';
|
|
13
|
-
import { type
|
|
14
|
-
import { type
|
|
14
|
+
import { type TEvaluateEnum } from '../engine/evaluate/evaluate.mjs';
|
|
15
|
+
import { type TEvaluateTemplateLiteral } from '../engine/evaluate/evaluate.mjs';
|
|
15
16
|
type TExtendsRightInfer<Inferred extends TProperties, Name extends string, Left extends TSchema, Right extends TSchema, Result extends Result.TResult = (TExtendsLeft<Inferred, Left, Right> extends Result.TExtendsTrueLike<infer CheckInferred extends TProperties> ? Result.TExtendsTrue<Memory.TAssign<Memory.TAssign<Inferred, CheckInferred>, {
|
|
16
17
|
[_ in Name]: Left;
|
|
17
18
|
}>> : Result.TExtendsFalse)> = Result;
|
|
18
19
|
type TExtendsRightAny<Inferred extends TProperties, _Left extends TSchema, Result extends Result.TResult = Result.TExtendsTrue<Inferred>> = Result;
|
|
19
|
-
type
|
|
20
|
+
type TExtendsRightDependent<Inferred extends TProperties, Left extends TSchema, If extends TSchema, Then extends TSchema, Else extends TSchema, Result extends Result.TResult = TExtendsLeft<Inferred, Left, If> extends Result.TExtendsTrueLike<infer Inferred extends TProperties> ? (TExtendsLeft<Inferred, Left, Then> extends Result.TExtendsTrueLike<infer Inferred extends TProperties> ? Result.TExtendsTrue<Inferred> : Result.TExtendsFalse) : (TExtendsLeft<Inferred, Left, Else> extends Result.TExtendsTrueLike<infer Inferred extends TProperties> ? Result.TExtendsTrue<Inferred> : Result.TExtendsFalse)> = Result;
|
|
21
|
+
type TExtendsRightEnum<Inferred extends TProperties, Left extends TSchema, Right extends TEnumValue[], Evaluated extends TSchema = TEvaluateEnum<Right>> = TExtendsLeft<Inferred, Left, Evaluated>;
|
|
20
22
|
type TExtendsRightIntersect<Inferred extends TProperties, Left extends TSchema, Right extends TSchema[]> = (Right extends [infer Head extends TSchema, ...infer Tail extends TSchema[]] ? TExtendsLeft<Inferred, Left, Head> extends Result.TExtendsTrueLike<infer Inferred extends TProperties> ? TExtendsRightIntersect<Inferred, Left, Tail> : Result.TExtendsFalse : Result.TExtendsTrue<Inferred>);
|
|
21
|
-
type TExtendsRightTemplateLiteral<Inferred extends TProperties, Left extends TSchema, Right extends string,
|
|
23
|
+
type TExtendsRightTemplateLiteral<Inferred extends TProperties, Left extends TSchema, Right extends string, Evaluated extends TSchema = TEvaluateTemplateLiteral<Right>> = TExtendsLeft<Inferred, Left, Evaluated>;
|
|
22
24
|
type TExtendsRightUnion<Inferred extends TProperties, Left extends TSchema, Right extends TSchema[]> = (Right extends [infer Head extends TSchema, ...infer Tail extends TSchema[]] ? TExtendsLeft<Inferred, Left, Head> extends Result.TExtendsTrueLike<infer Inferred extends TProperties> ? Result.TExtendsTrue<Inferred> : TExtendsRightUnion<Inferred, Left, Tail> : Result.TExtendsFalse);
|
|
23
|
-
export type TExtendsRight<Inferred extends TProperties, Left extends TSchema, Right extends TSchema> = (Right extends TAny ? TExtendsRightAny<Inferred, Left> : Right extends TEnum<infer Values extends TEnumValue[]> ? TExtendsRightEnum<Inferred, Left, Values> : Right extends TInfer<infer Name extends string, infer Type extends TSchema> ? TExtendsRightInfer<Inferred, Name, Left, Type> : Right extends TTemplateLiteral<infer Pattern extends string> ? TExtendsRightTemplateLiteral<Inferred, Left, Pattern> : Right extends TIntersect<infer Types extends TSchema[]> ? TExtendsRightIntersect<Inferred, Left, Types> : Right extends TUnion<infer Types extends TSchema[]> ? TExtendsRightUnion<Inferred, Left, Types> : Right extends TUnknown ? Result.TExtendsTrue<Inferred> : Result.TExtendsFalse);
|
|
25
|
+
export type TExtendsRight<Inferred extends TProperties, Left extends TSchema, Right extends TSchema> = (Right extends TAny ? TExtendsRightAny<Inferred, Left> : Right extends TDependent<infer If extends TSchema, infer Then extends TSchema, infer Else extends TSchema> ? TExtendsRightDependent<Inferred, Left, If, Then, Else> : Right extends TEnum<infer Values extends TEnumValue[]> ? TExtendsRightEnum<Inferred, Left, Values> : Right extends TInfer<infer Name extends string, infer Type extends TSchema> ? TExtendsRightInfer<Inferred, Name, Left, Type> : Right extends TTemplateLiteral<infer Pattern extends string> ? TExtendsRightTemplateLiteral<Inferred, Left, Pattern> : Right extends TIntersect<infer Types extends TSchema[]> ? TExtendsRightIntersect<Inferred, Left, Types> : Right extends TUnion<infer Types extends TSchema[]> ? TExtendsRightUnion<Inferred, Left, Types> : Right extends TUnknown ? Result.TExtendsTrue<Inferred> : Result.TExtendsFalse);
|
|
24
26
|
export declare function ExtendsRight<Inferred extends TProperties, Left extends TSchema, Right extends TSchema>(inferred: Inferred, left: Left, right: Right): TExtendsRight<Inferred, Left, Right>;
|
|
25
27
|
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// deno-fmt-ignore-file
|
|
2
|
+
import { Guard } from '../../guard/index.mjs';
|
|
3
|
+
import { Memory } from '../../system/memory/index.mjs';
|
|
4
|
+
import { IsAny } from '../types/any.mjs';
|
|
5
|
+
import { IsDependent } from '../types/dependent.mjs';
|
|
6
|
+
import { IsEnum } from '../types/enum.mjs';
|
|
7
|
+
import { IsInfer } from '../types/infer.mjs';
|
|
8
|
+
import { IsIntersect } from '../types/intersect.mjs';
|
|
9
|
+
import { IsTemplateLiteral } from '../types/template_literal.mjs';
|
|
10
|
+
import { IsUnion } from '../types/union.mjs';
|
|
11
|
+
import { IsUnknown } from '../types/unknown.mjs';
|
|
12
|
+
import { ExtendsLeft } from './extends_left.mjs';
|
|
13
|
+
import * as Result from './result.mjs';
|
|
14
|
+
import { EvaluateEnum } from '../engine/evaluate/evaluate.mjs';
|
|
15
|
+
import { EvaluateTemplateLiteral } from '../engine/evaluate/evaluate.mjs';
|
|
16
|
+
function ExtendsRightInfer(inferred, name, left, right) {
|
|
17
|
+
return Result.Match(ExtendsLeft(inferred, left, right), checkInferred => Result.ExtendsTrue(Memory.Assign(Memory.Assign(inferred, checkInferred), { [name]: left })), () => Result.ExtendsFalse());
|
|
18
|
+
}
|
|
19
|
+
function ExtendsRightAny(inferred, _left) {
|
|
20
|
+
return Result.ExtendsTrue(inferred);
|
|
21
|
+
}
|
|
22
|
+
function ExtendsRightDependent(inferred, left, if_, then_, else_) {
|
|
23
|
+
return Result.Match(ExtendsLeft(inferred, left, if_), inferred => Result.Match(ExtendsLeft(inferred, left, then_), inferred => Result.ExtendsTrue(inferred), () => Result.ExtendsFalse()), () => Result.Match(ExtendsLeft(inferred, left, else_), inferred => Result.ExtendsTrue(inferred), () => Result.ExtendsFalse()));
|
|
24
|
+
}
|
|
25
|
+
function ExtendsRightEnum(inferred, left, right) {
|
|
26
|
+
const evaluated = EvaluateEnum(right);
|
|
27
|
+
return ExtendsLeft(inferred, left, evaluated);
|
|
28
|
+
}
|
|
29
|
+
function ExtendsRightIntersect(inferred, left, right) {
|
|
30
|
+
return Guard.ShiftLeft(right, (head, tail) => Result.Match(ExtendsLeft(inferred, left, head), inferred => ExtendsRightIntersect(inferred, left, tail), () => Result.ExtendsFalse()), () => Result.ExtendsTrue(inferred));
|
|
31
|
+
}
|
|
32
|
+
function ExtendsRightTemplateLiteral(inferred, left, right) {
|
|
33
|
+
const evaluated = EvaluateTemplateLiteral(right);
|
|
34
|
+
return ExtendsLeft(inferred, left, evaluated);
|
|
35
|
+
}
|
|
36
|
+
function ExtendsRightUnion(inferred, left, right) {
|
|
37
|
+
return Guard.ShiftLeft(right, (head, tail) => Result.Match(ExtendsLeft(inferred, left, head), inferred => Result.ExtendsTrue(inferred), () => ExtendsRightUnion(inferred, left, tail)), () => Result.ExtendsFalse());
|
|
38
|
+
}
|
|
39
|
+
export function ExtendsRight(inferred, left, right) {
|
|
40
|
+
return (IsAny(right) ? ExtendsRightAny(inferred, left) :
|
|
41
|
+
IsDependent(right) ? ExtendsRightDependent(inferred, left, right.if, right.then, right.else) :
|
|
42
|
+
IsEnum(right) ? ExtendsRightEnum(inferred, left, right.enum) :
|
|
43
|
+
IsInfer(right) ? ExtendsRightInfer(inferred, right.name, left, right.extends) :
|
|
44
|
+
IsIntersect(right) ? ExtendsRightIntersect(inferred, left, right.allOf) :
|
|
45
|
+
IsTemplateLiteral(right) ? ExtendsRightTemplateLiteral(inferred, left, right.pattern) :
|
|
46
|
+
IsUnion(right) ? ExtendsRightUnion(inferred, left, right.anyOf) :
|
|
47
|
+
IsUnknown(right) ? Result.ExtendsTrue(inferred) :
|
|
48
|
+
Result.ExtendsFalse());
|
|
49
|
+
}
|
|
@@ -5,6 +5,6 @@ import { type TFunction } from '../types/function.mjs';
|
|
|
5
5
|
import { type TUnknown } from '../types/unknown.mjs';
|
|
6
6
|
import * as Result from './result.mjs';
|
|
7
7
|
import { type TExtendsParameters } from './parameters.mjs';
|
|
8
|
-
import { type TExtendsReturnType } from './
|
|
8
|
+
import { type TExtendsReturnType } from './return_type.mjs';
|
|
9
9
|
export type TExtendsFunction<Inferred extends TProperties, Parameters extends TSchema[], ReturnType extends TSchema, Right extends TSchema> = (Right extends TAny ? Result.TExtendsTrue<Inferred> : Right extends TUnknown ? Result.TExtendsTrue<Inferred> : Right extends TFunction ? TExtendsParameters<Inferred, Parameters, Right['parameters']> extends Result.TExtendsTrueLike<infer Inferred extends TProperties> ? TExtendsReturnType<Inferred, ReturnType, Right['returnType']> : Result.TExtendsFalse : Result.TExtendsFalse);
|
|
10
10
|
export declare function ExtendsFunction<Inferred extends TProperties, Parameters extends TSchema[], ReturnType extends TSchema, Right extends TSchema>(inferred: Inferred, parameters: [...Parameters], returnType: ReturnType, right: Right): TExtendsFunction<Inferred, Parameters, ReturnType, Right>;
|
|
@@ -7,7 +7,7 @@ import * as Result from './result.mjs';
|
|
|
7
7
|
// Parameters | ReturnType
|
|
8
8
|
// ------------------------------------------------------------------
|
|
9
9
|
import { ExtendsParameters } from './parameters.mjs';
|
|
10
|
-
import { ExtendsReturnType } from './
|
|
10
|
+
import { ExtendsReturnType } from './return_type.mjs';
|
|
11
11
|
export function ExtendsFunction(inferred, parameters, returnType, right) {
|
|
12
12
|
return (IsAny(right) ? Result.ExtendsTrue(inferred) :
|
|
13
13
|
IsUnknown(right) ? Result.ExtendsTrue(inferred) :
|
|
@@ -5,7 +5,7 @@ import { type TArray } from '../types/array.mjs';
|
|
|
5
5
|
import { type TUnknown } from '../types/unknown.mjs';
|
|
6
6
|
import { type TProperties } from '../types/properties.mjs';
|
|
7
7
|
import { type TTuple } from '../types/tuple.mjs';
|
|
8
|
-
import { type TExtendsLeft } from './
|
|
8
|
+
import { type TExtendsLeft } from './extends_left.mjs';
|
|
9
9
|
import { type TUnion } from '../types/union.mjs';
|
|
10
10
|
import { type TInfer } from '../types/infer.mjs';
|
|
11
11
|
import { type TRest } from '../types/rest.mjs';
|
|
@@ -6,7 +6,7 @@ import { Guard } from '../../guard/index.mjs';
|
|
|
6
6
|
import { IsArray } from '../types/array.mjs';
|
|
7
7
|
import { IsUnknown } from '../types/unknown.mjs';
|
|
8
8
|
import { Tuple } from '../types/tuple.mjs';
|
|
9
|
-
import { ExtendsLeft } from './
|
|
9
|
+
import { ExtendsLeft } from './extends_left.mjs';
|
|
10
10
|
import { Union } from '../types/union.mjs';
|
|
11
11
|
// ----------------------------------------------------------------------------
|
|
12
12
|
// Operator
|
|
@@ -46,7 +46,7 @@ export function TryInferable(type) {
|
|
|
46
46
|
undefined);
|
|
47
47
|
}
|
|
48
48
|
function TryInferResults(rest, right, result = []) {
|
|
49
|
-
return
|
|
49
|
+
return Guard.ShiftLeft(rest, (head, tail) => Result.Match(ExtendsLeft({}, head, right), () => TryInferResults(tail, right, [...result, head]), () => undefined), () => result);
|
|
50
50
|
}
|
|
51
51
|
export function InferTupleResult(inferred, name, left, right) {
|
|
52
52
|
const results = TryInferResults(left, right);
|
|
@@ -2,7 +2,7 @@ import { type TSchema } from '../types/schema.mjs';
|
|
|
2
2
|
import { type TProperties } from '../types/properties.mjs';
|
|
3
3
|
import { type TInteger } from '../types/integer.mjs';
|
|
4
4
|
import { type TNumber } from '../types/number.mjs';
|
|
5
|
-
import { type TExtendsRight } from './
|
|
5
|
+
import { type TExtendsRight } from './extends_right.mjs';
|
|
6
6
|
import * as Result from './result.mjs';
|
|
7
7
|
export type TExtendsInteger<Inferred extends TProperties, Left extends TInteger, Right extends TSchema> = (Right extends TInteger ? Result.TExtendsTrue<Inferred> : Right extends TNumber ? Result.TExtendsTrue<Inferred> : TExtendsRight<Inferred, Left, Right>);
|
|
8
8
|
export declare function ExtendsInteger<Inferred extends TProperties, Left extends TInteger, Right extends TSchema>(inferred: Inferred, left: Left, right: Right): TExtendsInteger<Inferred, Left, Right>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { IsInteger } from '../types/integer.mjs';
|
|
3
3
|
import { IsNumber } from '../types/number.mjs';
|
|
4
|
-
import { ExtendsRight } from './
|
|
4
|
+
import { ExtendsRight } from './extends_right.mjs';
|
|
5
5
|
import * as Result from './result.mjs';
|
|
6
6
|
export function ExtendsInteger(inferred, left, right) {
|
|
7
7
|
return (IsInteger(right) ? Result.ExtendsTrue(inferred) :
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type TProperties } from '../types/properties.mjs';
|
|
2
2
|
import { type TSchema } from '../types/schema.mjs';
|
|
3
|
-
import { type TExtendsLeft } from './
|
|
3
|
+
import { type TExtendsLeft } from './extends_left.mjs';
|
|
4
4
|
import { type TEvaluateIntersect } from '../engine/evaluate/index.mjs';
|
|
5
5
|
export type TExtendsIntersect<Inferred extends TProperties, Left extends TSchema[], Right extends TSchema, Evaluated extends TSchema = TEvaluateIntersect<Left>> = TExtendsLeft<Inferred, Evaluated, Right>;
|
|
6
6
|
export declare function ExtendsIntersect<Inferred extends TProperties, Left extends TSchema[], Right extends TSchema>(inferred: Inferred, left: Left, right: Right): TExtendsIntersect<Inferred, Left, Right>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TUnreachable } from '../../system/unreachable/unreachable.mjs';
|
|
1
|
+
import { type TUnreachable } from '../../system/unreachable/unreachable.mjs';
|
|
2
2
|
import { type TSchema } from '../types/schema.mjs';
|
|
3
3
|
import { type TProperties } from '../types/properties.mjs';
|
|
4
4
|
import { type TLiteral, type TLiteralValue } from '../types/literal.mjs';
|
|
@@ -6,7 +6,7 @@ import { type TBigInt } from '../types/bigint.mjs';
|
|
|
6
6
|
import { type TBoolean } from '../types/boolean.mjs';
|
|
7
7
|
import { type TNumber } from '../types/number.mjs';
|
|
8
8
|
import { type TString } from '../types/string.mjs';
|
|
9
|
-
import { type TExtendsRight } from './
|
|
9
|
+
import { type TExtendsRight } from './extends_right.mjs';
|
|
10
10
|
import * as Result from './result.mjs';
|
|
11
11
|
type TExtendsLiteralValue<Inferred extends TProperties, Left extends TLiteralValue, Right extends TLiteralValue> = (Left extends Right ? Result.TExtendsTrue<Inferred> : Result.TExtendsFalse);
|
|
12
12
|
type TExtendsLiteralBigInt<Inferred extends TProperties, Left extends bigint, Right extends TSchema> = (Right extends TLiteral<infer Value extends bigint> ? TExtendsLiteralValue<Inferred, Left, Value> : Right extends TBigInt ? Result.TExtendsTrue<Inferred> : TExtendsRight<Inferred, TLiteral<Left>, Right>);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
|
-
import { Unreachable } from '../../system/unreachable/unreachable.mjs';
|
|
3
2
|
import { Guard } from '../../guard/index.mjs';
|
|
3
|
+
import { Unreachable } from '../../system/unreachable/unreachable.mjs';
|
|
4
4
|
import { IsLiteral, Literal } from '../types/literal.mjs';
|
|
5
5
|
import { IsBigInt } from '../types/bigint.mjs';
|
|
6
6
|
import { IsBoolean } from '../types/boolean.mjs';
|
|
7
7
|
import { IsNumber } from '../types/number.mjs';
|
|
8
8
|
import { IsString } from '../types/string.mjs';
|
|
9
|
-
import { ExtendsRight } from './
|
|
9
|
+
import { ExtendsRight } from './extends_right.mjs';
|
|
10
10
|
import * as Result from './result.mjs';
|
|
11
11
|
function ExtendsLiteralValue(inferred, left, right) {
|
|
12
12
|
return (left === right
|
|
@@ -2,7 +2,7 @@ import { type TSchema } from '../types/schema.mjs';
|
|
|
2
2
|
import { type TProperties } from '../types/properties.mjs';
|
|
3
3
|
import { type TNever } from '../types/never.mjs';
|
|
4
4
|
import { type TInfer } from '../types/infer.mjs';
|
|
5
|
-
import { type TExtendsRight } from './
|
|
5
|
+
import { type TExtendsRight } from './extends_right.mjs';
|
|
6
6
|
import * as Result from './result.mjs';
|
|
7
7
|
export type TExtendsNever<Inferred extends TProperties, Left extends TNever, Right extends TSchema> = (Right extends TInfer ? TExtendsRight<Inferred, Left, Right> : Result.TExtendsTrue<Inferred>);
|
|
8
8
|
export declare function ExtendsNever<Inferred extends TProperties, Left extends TNever, Right extends TSchema>(inferred: Inferred, left: Left, right: Right): TExtendsNever<Inferred, Left, Right>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { IsInfer } from '../types/infer.mjs';
|
|
3
|
-
import { ExtendsRight } from './
|
|
3
|
+
import { ExtendsRight } from './extends_right.mjs';
|
|
4
4
|
import * as Result from './result.mjs';
|
|
5
5
|
export function ExtendsNever(inferred, left, right) {
|
|
6
6
|
return (IsInfer(right)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type TSchema } from '../types/schema.mjs';
|
|
2
2
|
import { type TProperties } from '../types/properties.mjs';
|
|
3
3
|
import { type TNull } from '../types/null.mjs';
|
|
4
|
-
import { type TExtendsRight } from './
|
|
4
|
+
import { type TExtendsRight } from './extends_right.mjs';
|
|
5
5
|
import * as Result from './result.mjs';
|
|
6
6
|
export type TExtendsNull<Inferred extends TProperties, Left extends TNull, Right extends TSchema> = (Right extends TNull ? Result.TExtendsTrue<Inferred> : TExtendsRight<Inferred, Left, Right>);
|
|
7
7
|
export declare function ExtendsNull<Inferred extends TProperties, Left extends TNull, Right extends TSchema>(inferred: Inferred, left: Left, right: Right): TExtendsNull<Inferred, Left, Right>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { IsNull } from '../types/null.mjs';
|
|
3
|
-
import { ExtendsRight } from './
|
|
3
|
+
import { ExtendsRight } from './extends_right.mjs';
|
|
4
4
|
import * as Result from './result.mjs';
|
|
5
5
|
export function ExtendsNull(inferred, left, right) {
|
|
6
6
|
return (IsNull(right)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type TSchema } from '../types/schema.mjs';
|
|
2
2
|
import { type TProperties } from '../types/properties.mjs';
|
|
3
3
|
import { type TNumber } from '../types/number.mjs';
|
|
4
|
-
import { type TExtendsRight } from './
|
|
4
|
+
import { type TExtendsRight } from './extends_right.mjs';
|
|
5
5
|
import * as Result from './result.mjs';
|
|
6
6
|
export type TExtendsNumber<Inferred extends TProperties, Left extends TNumber, Right extends TSchema> = (Right extends TNumber ? Result.TExtendsTrue<Inferred> : TExtendsRight<Inferred, Left, Right>);
|
|
7
7
|
export declare function ExtendsNumber<Inferred extends TProperties, Left extends TNumber, Right extends TSchema>(inferred: Inferred, left: Left, right: Right): TExtendsNumber<Inferred, Left, Right>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { IsNumber } from '../types/number.mjs';
|
|
3
|
-
import { ExtendsRight } from './
|
|
3
|
+
import { ExtendsRight } from './extends_right.mjs';
|
|
4
4
|
import * as Result from './result.mjs';
|
|
5
5
|
export function ExtendsNumber(inferred, left, right) {
|
|
6
6
|
return (IsNumber(right)
|
|
@@ -6,8 +6,10 @@ import { type TOptional } from '../types/_optional.mjs';
|
|
|
6
6
|
import { type TInfer } from '../types/infer.mjs';
|
|
7
7
|
import { type TNever } from '../types/never.mjs';
|
|
8
8
|
import { type TObject } from '../types/object.mjs';
|
|
9
|
-
import { type
|
|
10
|
-
import { type
|
|
9
|
+
import { type TRecord } from '../types/record.mjs';
|
|
10
|
+
import { type TUnion } from '../types/union.mjs';
|
|
11
|
+
import { type TExtendsLeft } from './extends_left.mjs';
|
|
12
|
+
import { type TExtendsRight } from './extends_right.mjs';
|
|
11
13
|
import { type TUnionToTuple } from '../engine/helpers/union.mjs';
|
|
12
14
|
import * as Result from './result.mjs';
|
|
13
15
|
type TExtendsPropertyOptional<Inferred extends TProperties, Left extends TSchema, Right extends TSchema> = (Left extends TOptional<Left> ? Right extends TOptional<Right> ? Result.TExtendsTrue<Inferred> : Result.TExtendsFalse : Result.TExtendsTrue<Inferred>);
|
|
@@ -20,6 +22,11 @@ type TExtendsPropertiesComparer<Inferred extends TProperties, Left extends TProp
|
|
|
20
22
|
}, Checked extends boolean = Properties[keyof Right] extends Result.TExtendsTrueLike ? true : false, Extracted extends TProperties = Checked extends true ? TExtractInferredProperties<TUnionToTuple<keyof Properties>, Properties> : {}> = (Checked extends true ? Result.TExtendsTrue<Extracted> : Result.TExtendsFalse);
|
|
21
23
|
type TExtendsProperties<Inferred extends TProperties, Left extends TProperties, Right extends TProperties, Compared extends Result.TResult = TExtendsPropertiesComparer<Inferred, Left, Right>> = (Compared extends Result.TExtendsTrueLike<infer ComparedInferred extends TProperties> ? Result.TExtendsTrue<Memory.TAssign<Inferred, ComparedInferred>> : Result.TExtendsFalse);
|
|
22
24
|
type TExtendsObjectToObject<Inferred extends TProperties, Left extends TProperties, Right extends TProperties> = (TExtendsProperties<Inferred, Left, Right>);
|
|
23
|
-
|
|
25
|
+
type TRecordMergeInferred<Left extends TProperties, Right extends TProperties, Result extends TProperties = {
|
|
26
|
+
[Key in keyof Right]: Key extends keyof Left ? Left[Key] extends TUnion<infer Types extends TSchema[]> ? TUnion<[...Types, Right[Key]]> : TUnion<[Left[Key], Right[Key]]> : Right[Key];
|
|
27
|
+
}> = Result;
|
|
28
|
+
type TExtendsRecordComparer<Properties extends TProperties, Keys extends (keyof Properties)[], Type extends TSchema, Result extends TProperties> = (Keys extends [infer Left extends (keyof Properties), ...infer Right extends (keyof Properties)[]] ? TExtendsLeft<{}, Properties[Left], Type> extends Result.TExtendsTrueLike<infer Inferred extends TProperties> ? TExtendsRecordComparer<Properties, Right, Type, TRecordMergeInferred<Result, Inferred>> : Result.TExtendsFalse : Result.TExtendsTrue<Result>);
|
|
29
|
+
type TExtendsObjectToRecord<Inferred extends TProperties, Properties extends TProperties, _Pattern extends string, Value extends TSchema, Keys extends (keyof Properties)[] = TUnionToTuple<keyof Properties>, Result extends Result.TResult = TExtendsRecordComparer<Properties, Keys, Value, Inferred>> = Result;
|
|
30
|
+
export type TExtendsObject<Inferred extends TProperties, Left extends TProperties, Right extends TSchema> = (Right extends TRecord<infer Pattern extends string, infer Value extends TSchema> ? TExtendsObjectToRecord<Inferred, Left, Pattern, Value> : Right extends TObject<infer Properties extends TProperties> ? TExtendsObjectToObject<Inferred, Left, Properties> : TExtendsRight<Inferred, TObject<Left>, Right>);
|
|
24
31
|
export declare function ExtendsObject<Inferred extends TProperties, Left extends TProperties, Right extends TSchema>(inferred: Inferred, left: Left, right: Right): TExtendsObject<Inferred, Left, Right>;
|
|
25
32
|
export {};
|
|
@@ -7,8 +7,10 @@ import { IsOptional } from '../types/_optional.mjs';
|
|
|
7
7
|
import { IsInfer } from '../types/infer.mjs';
|
|
8
8
|
import { IsNever } from '../types/never.mjs';
|
|
9
9
|
import { IsObject, Object } from '../types/object.mjs';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { IsRecord, RecordPattern, RecordValue } from '../types/record.mjs';
|
|
11
|
+
import { Union, IsUnion } from '../types/union.mjs';
|
|
12
|
+
import { ExtendsLeft } from './extends_left.mjs';
|
|
13
|
+
import { ExtendsRight } from './extends_right.mjs';
|
|
12
14
|
import * as Result from './result.mjs';
|
|
13
15
|
function ExtendsPropertyOptional(inferred, left, right) {
|
|
14
16
|
return (IsOptional(left)
|
|
@@ -80,8 +82,28 @@ function ExtendsProperties(inferred, left, right) {
|
|
|
80
82
|
function ExtendsObjectToObject(inferred, left, right) {
|
|
81
83
|
return ExtendsProperties(inferred, left, right);
|
|
82
84
|
}
|
|
85
|
+
function RecordMergeInferred(left, right) {
|
|
86
|
+
return Guard.Keys(right).reduce((result, key) => {
|
|
87
|
+
return {
|
|
88
|
+
...result, [key]: Guard.HasPropertyKey(left, key)
|
|
89
|
+
? IsUnion(result[key])
|
|
90
|
+
// @ts-ignore 5.0.4 cannot see `.anyOf`
|
|
91
|
+
? Union([...result[key].anyOf, right[key]])
|
|
92
|
+
: Union([left[key], right[key]])
|
|
93
|
+
: right[key]
|
|
94
|
+
};
|
|
95
|
+
}, left);
|
|
96
|
+
}
|
|
97
|
+
function ExtendsRecordComparer(properties, keys, type, result) {
|
|
98
|
+
return Guard.ShiftLeft(keys, (left, right) => Result.Match(ExtendsLeft({}, properties[left], type), inferred => ExtendsRecordComparer(properties, right, type, RecordMergeInferred(result, inferred)), () => Result.ExtendsFalse()), () => Result.ExtendsTrue(result));
|
|
99
|
+
}
|
|
100
|
+
function ExtendsObjectToRecord(inferred, properties, _pattern, value) {
|
|
101
|
+
const keys = Guard.Keys(properties);
|
|
102
|
+
const result = ExtendsRecordComparer(properties, keys, value, inferred);
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
83
105
|
export function ExtendsObject(inferred, left, right) {
|
|
84
|
-
return (
|
|
85
|
-
? ExtendsObjectToObject(inferred, left, right.properties)
|
|
86
|
-
|
|
106
|
+
return (IsRecord(right) ? ExtendsObjectToRecord(inferred, left, RecordPattern(right), RecordValue(right)) :
|
|
107
|
+
IsObject(right) ? ExtendsObjectToObject(inferred, left, right.properties) :
|
|
108
|
+
ExtendsRight(inferred, Object(left), right));
|
|
87
109
|
}
|
|
@@ -2,7 +2,7 @@ import { type TInfer } from '../types/infer.mjs';
|
|
|
2
2
|
import { type TSchema } from '../types/schema.mjs';
|
|
3
3
|
import { type TOptional } from '../types/_optional.mjs';
|
|
4
4
|
import { type TProperties } from '../types/properties.mjs';
|
|
5
|
-
import { type TExtendsLeft } from './
|
|
5
|
+
import { type TExtendsLeft } from './extends_left.mjs';
|
|
6
6
|
import * as Result from './result.mjs';
|
|
7
7
|
type TParameterCompare<Inferred extends TProperties, Left extends TSchema, LeftRest extends TSchema[], Right extends TSchema, RightRest extends TSchema[], CheckLeft extends TSchema = Right extends TInfer ? Left : Right, CheckRight extends TSchema = Right extends TInfer ? Right : Left, IsLeftOptional extends boolean = Left extends TOptional ? true : false, IsRightOptional extends boolean = Right extends TOptional ? true : false> = ([
|
|
8
8
|
IsLeftOptional,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
|
+
import { Guard } from '../../guard/index.mjs';
|
|
2
3
|
import { IsInfer } from '../types/infer.mjs';
|
|
3
4
|
import { IsOptional } from '../types/_optional.mjs';
|
|
4
|
-
import { ExtendsLeft } from './
|
|
5
|
+
import { ExtendsLeft } from './extends_left.mjs';
|
|
5
6
|
import * as Result from './result.mjs';
|
|
6
7
|
function ParameterCompare(inferred, left, leftRest, right, rightRest) {
|
|
7
8
|
// Parameter extends Right on Left, except when infer Right
|
|
@@ -15,12 +16,12 @@ function ParameterCompare(inferred, left, leftRest, right, rightRest) {
|
|
|
15
16
|
);
|
|
16
17
|
}
|
|
17
18
|
function ParameterRight(inferred, left, leftRest, rightRest) {
|
|
18
|
-
return
|
|
19
|
+
return Guard.ShiftLeft(rightRest, (head, tail) => ParameterCompare(inferred, left, leftRest, head, tail), () => IsOptional(left) // 'right-did-not-have-enough-elements'
|
|
19
20
|
? Result.ExtendsTrue(inferred) // 'ok: left was optional'
|
|
20
21
|
: Result.ExtendsFalse()); // 'fail: left was required'
|
|
21
22
|
}
|
|
22
23
|
function ParametersLeft(inferred, left, rightRest) {
|
|
23
|
-
return
|
|
24
|
+
return Guard.ShiftLeft(left, (head, tail) => ParameterRight(inferred, head, tail, rightRest), () => Result.ExtendsTrue(inferred)); // 'ok: no-more-elements-in-left'
|
|
24
25
|
}
|
|
25
26
|
export function ExtendsParameters(inferred, left, right) {
|
|
26
27
|
return ParametersLeft(inferred, left, right);
|