@sinclair/typebox 0.32.0-dev-17 → 0.32.0-dev-19
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/build/import/compiler/compiler.mjs +14 -35
- package/build/import/compiler/index.mjs +0 -27
- package/build/import/errors/errors.mjs +15 -38
- package/build/import/errors/function.mjs +0 -27
- package/build/import/errors/index.mjs +0 -27
- package/build/import/index.mjs +0 -27
- package/build/import/system/index.mjs +0 -27
- package/build/import/system/policy.mjs +0 -27
- package/build/import/system/system.mjs +0 -27
- package/build/import/type/any/any.mjs +0 -27
- package/build/import/type/any/index.mjs +0 -27
- package/build/import/type/array/array.mjs +0 -27
- package/build/import/type/array/index.mjs +0 -27
- package/build/import/type/async-iterator/async-iterator.mjs +0 -27
- package/build/import/type/async-iterator/index.mjs +0 -27
- package/build/import/type/awaited/awaited.d.mts +6 -6
- package/build/import/type/awaited/awaited.mjs +14 -41
- package/build/import/type/awaited/index.mjs +0 -27
- package/build/import/type/bigint/bigint.mjs +0 -27
- package/build/import/type/bigint/index.mjs +0 -27
- package/build/import/type/boolean/boolean.mjs +0 -27
- package/build/import/type/boolean/index.mjs +0 -27
- package/build/import/type/clone/index.mjs +0 -27
- package/build/import/type/clone/type.mjs +0 -27
- package/build/import/type/clone/value.mjs +0 -27
- package/build/import/type/composite/composite.mjs +0 -27
- package/build/import/type/composite/index.mjs +0 -27
- package/build/import/type/const/const.mjs +0 -27
- package/build/import/type/const/index.mjs +0 -27
- package/build/import/type/constructor/constructor.mjs +0 -27
- package/build/import/type/constructor/index.mjs +0 -27
- package/build/import/type/constructor-parameters/constructor-parameters.mjs +0 -27
- package/build/import/type/constructor-parameters/index.mjs +0 -27
- package/build/import/type/date/date.mjs +0 -27
- package/build/import/type/date/index.mjs +0 -27
- package/build/import/type/deref/deref.mjs +12 -39
- package/build/import/type/deref/index.mjs +0 -27
- package/build/import/type/discard/discard.mjs +0 -27
- package/build/import/type/discard/index.mjs +0 -27
- package/build/import/type/enum/enum.mjs +0 -27
- package/build/import/type/enum/index.mjs +0 -27
- package/build/import/type/exclude/exclude-from-mapped-result.mjs +0 -27
- package/build/import/type/exclude/exclude.mjs +8 -32
- package/build/import/type/exclude/index.mjs +0 -27
- package/build/import/type/extends/extends-check.mjs +167 -194
- package/build/import/type/extends/extends-from-mapped-key.mjs +0 -27
- package/build/import/type/extends/extends-from-mapped-result.mjs +0 -27
- package/build/import/type/extends/extends-undefined.mjs +0 -27
- package/build/import/type/extends/extends.mjs +3 -30
- package/build/import/type/extends/index.mjs +0 -27
- package/build/import/type/extract/extract-from-mapped-result.mjs +0 -27
- package/build/import/type/extract/extract.mjs +5 -32
- package/build/import/type/extract/index.mjs +0 -27
- package/build/import/type/function/function.mjs +0 -27
- package/build/import/type/function/index.mjs +0 -27
- package/build/import/type/guard/index.mjs +0 -27
- package/build/import/type/guard/type.d.mts +50 -50
- package/build/import/type/guard/type.mjs +136 -163
- package/build/import/type/guard/value.mjs +0 -27
- package/build/import/type/helpers/helpers.mjs +0 -27
- package/build/import/type/helpers/index.mjs +0 -27
- package/build/import/type/index.mjs +0 -27
- package/build/import/type/indexed/index.d.mts +0 -1
- package/build/import/type/indexed/index.mjs +0 -28
- package/build/import/type/indexed/indexed-from-mapped-key.d.mts +2 -2
- package/build/import/type/indexed/indexed-from-mapped-key.mjs +2 -29
- package/build/import/type/indexed/indexed-property-keys.mjs +7 -34
- package/build/import/type/indexed/indexed.d.mts +38 -5
- package/build/import/type/indexed/indexed.mjs +78 -32
- package/build/import/type/instance-type/index.mjs +0 -27
- package/build/import/type/instance-type/instance-type.mjs +0 -27
- package/build/import/type/integer/index.mjs +0 -27
- package/build/import/type/integer/integer.mjs +0 -27
- package/build/import/type/intersect/index.mjs +0 -27
- package/build/import/type/intersect/intersect-create.mjs +4 -31
- package/build/import/type/intersect/intersect-evaluated.mjs +1 -28
- package/build/import/type/intersect/intersect-type.mjs +0 -27
- package/build/import/type/intersect/intersect.mjs +2 -29
- package/build/import/type/intrinsic/capitalize.mjs +0 -27
- package/build/import/type/intrinsic/index.mjs +0 -27
- package/build/import/type/intrinsic/intrinsic-from-mapped-key.mjs +0 -27
- package/build/import/type/intrinsic/intrinsic.mjs +5 -32
- package/build/import/type/intrinsic/lowercase.mjs +0 -27
- package/build/import/type/intrinsic/uncapitalize.mjs +0 -27
- package/build/import/type/intrinsic/uppercase.mjs +0 -27
- package/build/import/type/iterator/index.mjs +0 -27
- package/build/import/type/iterator/iterator.mjs +0 -27
- package/build/import/type/keyof/index.mjs +0 -27
- package/build/import/type/keyof/keyof-from-mapped-result.mjs +0 -27
- package/build/import/type/keyof/keyof-property-keys.mjs +7 -34
- package/build/import/type/keyof/keyof.mjs +2 -29
- package/build/import/type/literal/index.mjs +0 -27
- package/build/import/type/literal/literal.mjs +0 -27
- package/build/import/type/mapped/index.mjs +0 -27
- package/build/import/type/mapped/mapped-key.mjs +0 -27
- package/build/import/type/mapped/mapped-result.mjs +0 -27
- package/build/import/type/mapped/mapped.mjs +16 -43
- package/build/import/type/modifiers/index.mjs +0 -27
- package/build/import/type/modifiers/modifiers.mjs +3 -30
- package/build/import/type/never/index.mjs +0 -27
- package/build/import/type/never/never.mjs +0 -27
- package/build/import/type/not/index.mjs +0 -27
- package/build/import/type/not/not.mjs +0 -27
- package/build/import/type/null/index.mjs +0 -27
- package/build/import/type/null/null.mjs +0 -27
- package/build/import/type/number/index.mjs +0 -27
- package/build/import/type/number/number.mjs +0 -27
- package/build/import/type/object/index.mjs +0 -27
- package/build/import/type/object/object.mjs +3 -30
- package/build/import/type/omit/index.mjs +0 -27
- package/build/import/type/omit/omit-from-mapped-key.mjs +0 -27
- package/build/import/type/omit/omit.mjs +6 -33
- package/build/import/type/operators/index.mjs +0 -27
- package/build/import/type/operators/operators.mjs +0 -27
- package/build/import/type/optional/index.mjs +0 -27
- package/build/import/type/optional/optional.mjs +0 -27
- package/build/import/type/parameters/index.mjs +0 -27
- package/build/import/type/parameters/parameters.mjs +0 -27
- package/build/import/type/partial/index.mjs +0 -27
- package/build/import/type/partial/partial-from-mapped-result.mjs +0 -27
- package/build/import/type/partial/partial.mjs +5 -32
- package/build/import/type/patterns/index.mjs +0 -27
- package/build/import/type/patterns/patterns.mjs +0 -27
- package/build/import/type/pick/index.mjs +0 -27
- package/build/import/type/pick/pick-from-mapped-key.mjs +0 -27
- package/build/import/type/pick/pick.mjs +6 -33
- package/build/import/type/promise/index.mjs +0 -27
- package/build/import/type/promise/promise.mjs +0 -27
- package/build/import/type/readonly/index.mjs +0 -27
- package/build/import/type/readonly/readonly.mjs +0 -27
- package/build/import/type/readonly-optional/index.mjs +0 -27
- package/build/import/type/readonly-optional/readonly-optional.mjs +0 -27
- package/build/import/type/record/index.mjs +0 -27
- package/build/import/type/record/record.d.mts +10 -9
- package/build/import/type/record/record.mjs +37 -60
- package/build/import/type/recursive/index.mjs +0 -27
- package/build/import/type/recursive/recursive.mjs +0 -27
- package/build/import/type/ref/index.mjs +0 -27
- package/build/import/type/ref/ref.mjs +0 -27
- package/build/import/type/regexp/index.mjs +0 -27
- package/build/import/type/regexp/regexp.mjs +0 -27
- package/build/import/type/registry/format.mjs +0 -27
- package/build/import/type/registry/index.mjs +0 -27
- package/build/import/type/registry/type.mjs +0 -27
- package/build/import/type/required/index.mjs +0 -27
- package/build/import/type/required/required-from-mapped-result.mjs +0 -27
- package/build/import/type/required/required.mjs +5 -32
- package/build/import/type/rest/index.mjs +0 -27
- package/build/import/type/rest/rest.mjs +6 -29
- package/build/import/type/return-type/index.mjs +0 -27
- package/build/import/type/return-type/return-type.mjs +0 -27
- package/build/import/type/schema/anyschema.mjs +0 -27
- package/build/import/type/schema/index.mjs +0 -27
- package/build/import/type/schema/schema.mjs +0 -27
- package/build/import/type/static/index.mjs +0 -27
- package/build/import/type/static/static.mjs +0 -27
- package/build/import/type/strict/index.mjs +0 -27
- package/build/import/type/strict/strict.mjs +0 -27
- package/build/import/type/string/index.mjs +0 -27
- package/build/import/type/string/string.mjs +0 -27
- package/build/import/type/symbol/index.mjs +0 -27
- package/build/import/type/symbol/symbol.mjs +0 -27
- package/build/import/type/symbols/index.mjs +0 -27
- package/build/import/type/symbols/symbols.mjs +0 -27
- package/build/import/type/template-literal/finite.mjs +0 -27
- package/build/import/type/template-literal/generate.mjs +0 -27
- package/build/import/type/template-literal/index.mjs +0 -27
- package/build/import/type/template-literal/parser.mjs +0 -27
- package/build/import/type/template-literal/pattern.mjs +9 -36
- package/build/import/type/template-literal/syntax.mjs +0 -27
- package/build/import/type/template-literal/template-literal.mjs +0 -27
- package/build/import/type/template-literal/union.mjs +0 -27
- package/build/import/type/transform/index.mjs +0 -27
- package/build/import/type/transform/transform.mjs +1 -28
- package/build/import/type/tuple/index.mjs +0 -27
- package/build/import/type/tuple/tuple.mjs +0 -27
- package/build/import/type/type/index.mjs +0 -27
- package/build/import/type/type/javascript.mjs +0 -27
- package/build/import/type/type/json.d.mts +2 -2
- package/build/import/type/type/json.mjs +0 -27
- package/build/import/type/type/type.mjs +0 -27
- package/build/import/type/uint8array/index.mjs +0 -27
- package/build/import/type/uint8array/uint8array.mjs +0 -27
- package/build/import/type/undefined/index.mjs +0 -27
- package/build/import/type/undefined/undefined.mjs +0 -27
- package/build/import/type/union/index.mjs +0 -27
- package/build/import/type/union/union-create.mjs +0 -27
- package/build/import/type/union/union-evaluated.mjs +2 -29
- package/build/import/type/union/union-type.mjs +0 -27
- package/build/import/type/union/union.mjs +0 -27
- package/build/import/type/unknown/index.mjs +0 -27
- package/build/import/type/unknown/unknown.mjs +0 -27
- package/build/import/type/unsafe/index.mjs +0 -27
- package/build/import/type/unsafe/unsafe.mjs +0 -27
- package/build/import/type/void/index.mjs +0 -27
- package/build/import/type/void/void.mjs +0 -27
- package/build/import/value/cast/cast.mjs +0 -27
- package/build/import/value/cast/index.mjs +0 -27
- package/build/import/value/check/check.mjs +18 -38
- package/build/import/value/check/index.mjs +0 -27
- package/build/import/value/clean/clean.mjs +9 -34
- package/build/import/value/clean/index.mjs +0 -27
- package/build/import/value/clone/clone.mjs +7 -31
- package/build/import/value/clone/index.mjs +0 -27
- package/build/import/value/convert/convert.mjs +6 -29
- package/build/import/value/convert/index.mjs +0 -27
- package/build/import/value/create/create.mjs +0 -27
- package/build/import/value/create/index.mjs +0 -27
- package/build/import/value/default/default.mjs +12 -31
- package/build/import/value/default/index.mjs +0 -27
- package/build/import/value/delta/delta.mjs +0 -27
- package/build/import/value/delta/index.mjs +0 -27
- package/build/import/value/deref/deref.mjs +0 -27
- package/build/import/value/deref/index.mjs +0 -27
- package/build/import/value/equal/equal.mjs +0 -27
- package/build/import/value/equal/index.mjs +0 -27
- package/build/import/value/guard/guard.mjs +0 -27
- package/build/import/value/guard/index.mjs +0 -27
- package/build/import/value/hash/hash.mjs +0 -27
- package/build/import/value/hash/index.mjs +0 -27
- package/build/import/value/index.mjs +0 -27
- package/build/import/value/mutate/index.mjs +0 -27
- package/build/import/value/mutate/mutate.mjs +0 -27
- package/build/import/value/pointer/index.mjs +0 -27
- package/build/import/value/pointer/pointer.mjs +0 -27
- package/build/import/value/transform/decode.mjs +12 -33
- package/build/import/value/transform/encode.mjs +12 -33
- package/build/import/value/transform/has.mjs +24 -45
- package/build/import/value/transform/index.mjs +0 -27
- package/build/import/value/value/index.mjs +0 -27
- package/build/import/value/value/value.mjs +0 -27
- package/build/require/compiler/compiler.js +77 -97
- package/build/require/compiler/index.js +0 -26
- package/build/require/errors/errors.js +58 -80
- package/build/require/errors/function.js +0 -26
- package/build/require/errors/index.js +0 -26
- package/build/require/index.js +0 -26
- package/build/require/system/index.js +0 -26
- package/build/require/system/policy.js +0 -26
- package/build/require/system/system.js +0 -26
- package/build/require/type/any/any.js +0 -26
- package/build/require/type/any/index.js +0 -26
- package/build/require/type/array/array.js +0 -26
- package/build/require/type/array/index.js +0 -26
- package/build/require/type/async-iterator/async-iterator.js +0 -26
- package/build/require/type/async-iterator/index.js +0 -26
- package/build/require/type/awaited/awaited.d.ts +6 -6
- package/build/require/type/awaited/awaited.js +14 -41
- package/build/require/type/awaited/index.js +0 -26
- package/build/require/type/bigint/bigint.js +0 -26
- package/build/require/type/bigint/index.js +0 -26
- package/build/require/type/boolean/boolean.js +0 -26
- package/build/require/type/boolean/index.js +0 -26
- package/build/require/type/clone/index.js +0 -26
- package/build/require/type/clone/type.js +0 -26
- package/build/require/type/clone/value.js +0 -26
- package/build/require/type/composite/composite.js +0 -26
- package/build/require/type/composite/index.js +0 -26
- package/build/require/type/const/const.js +0 -26
- package/build/require/type/const/index.js +0 -26
- package/build/require/type/constructor/constructor.js +0 -26
- package/build/require/type/constructor/index.js +0 -26
- package/build/require/type/constructor-parameters/constructor-parameters.js +0 -26
- package/build/require/type/constructor-parameters/index.js +0 -26
- package/build/require/type/date/date.js +0 -26
- package/build/require/type/date/index.js +0 -26
- package/build/require/type/deref/deref.js +11 -37
- package/build/require/type/deref/index.js +0 -26
- package/build/require/type/discard/discard.js +0 -26
- package/build/require/type/discard/index.js +0 -26
- package/build/require/type/enum/enum.js +0 -26
- package/build/require/type/enum/index.js +0 -26
- package/build/require/type/exclude/exclude-from-mapped-result.js +0 -26
- package/build/require/type/exclude/exclude.js +7 -30
- package/build/require/type/exclude/index.js +0 -26
- package/build/require/type/extends/extends-check.js +167 -193
- package/build/require/type/extends/extends-from-mapped-key.js +0 -26
- package/build/require/type/extends/extends-from-mapped-result.js +0 -26
- package/build/require/type/extends/extends-undefined.js +0 -26
- package/build/require/type/extends/extends.js +2 -28
- package/build/require/type/extends/index.js +0 -26
- package/build/require/type/extract/extract-from-mapped-result.js +0 -26
- package/build/require/type/extract/extract.js +4 -30
- package/build/require/type/extract/index.js +0 -26
- package/build/require/type/function/function.js +0 -26
- package/build/require/type/function/index.js +0 -26
- package/build/require/type/guard/index.js +0 -26
- package/build/require/type/guard/type.d.ts +50 -50
- package/build/require/type/guard/type.js +184 -210
- package/build/require/type/guard/value.js +0 -26
- package/build/require/type/helpers/helpers.js +0 -26
- package/build/require/type/helpers/index.js +0 -26
- package/build/require/type/index.js +0 -26
- package/build/require/type/indexed/index.d.ts +0 -1
- package/build/require/type/indexed/index.js +0 -27
- package/build/require/type/indexed/indexed-from-mapped-key.d.ts +2 -2
- package/build/require/type/indexed/indexed-from-mapped-key.js +2 -28
- package/build/require/type/indexed/indexed-property-keys.js +6 -32
- package/build/require/type/indexed/indexed.d.ts +38 -5
- package/build/require/type/indexed/indexed.js +78 -31
- package/build/require/type/instance-type/index.js +0 -26
- package/build/require/type/instance-type/instance-type.js +0 -26
- package/build/require/type/integer/index.js +0 -26
- package/build/require/type/integer/integer.js +0 -26
- package/build/require/type/intersect/index.js +0 -26
- package/build/require/type/intersect/intersect-create.js +3 -29
- package/build/require/type/intersect/intersect-evaluated.js +2 -28
- package/build/require/type/intersect/intersect-type.js +0 -26
- package/build/require/type/intersect/intersect.js +1 -27
- package/build/require/type/intrinsic/capitalize.js +0 -26
- package/build/require/type/intrinsic/index.js +0 -26
- package/build/require/type/intrinsic/intrinsic-from-mapped-key.js +0 -26
- package/build/require/type/intrinsic/intrinsic.js +4 -30
- package/build/require/type/intrinsic/lowercase.js +0 -26
- package/build/require/type/intrinsic/uncapitalize.js +0 -26
- package/build/require/type/intrinsic/uppercase.js +0 -26
- package/build/require/type/iterator/index.js +0 -26
- package/build/require/type/iterator/iterator.js +0 -26
- package/build/require/type/keyof/index.js +0 -26
- package/build/require/type/keyof/keyof-from-mapped-result.js +0 -26
- package/build/require/type/keyof/keyof-property-keys.js +6 -32
- package/build/require/type/keyof/keyof.js +1 -27
- package/build/require/type/literal/index.js +0 -26
- package/build/require/type/literal/literal.js +0 -26
- package/build/require/type/mapped/index.js +0 -26
- package/build/require/type/mapped/mapped-key.js +0 -26
- package/build/require/type/mapped/mapped-result.js +0 -26
- package/build/require/type/mapped/mapped.js +15 -41
- package/build/require/type/modifiers/index.js +0 -26
- package/build/require/type/modifiers/modifiers.js +2 -28
- package/build/require/type/never/index.js +0 -26
- package/build/require/type/never/never.js +0 -26
- package/build/require/type/not/index.js +0 -26
- package/build/require/type/not/not.js +0 -26
- package/build/require/type/null/index.js +0 -26
- package/build/require/type/null/null.js +0 -26
- package/build/require/type/number/index.js +0 -26
- package/build/require/type/number/number.js +0 -26
- package/build/require/type/object/index.js +0 -26
- package/build/require/type/object/object.js +2 -28
- package/build/require/type/omit/index.js +0 -26
- package/build/require/type/omit/omit-from-mapped-key.js +0 -26
- package/build/require/type/omit/omit.js +5 -31
- package/build/require/type/operators/index.js +0 -26
- package/build/require/type/operators/operators.js +0 -26
- package/build/require/type/optional/index.js +0 -26
- package/build/require/type/optional/optional.js +0 -26
- package/build/require/type/parameters/index.js +0 -26
- package/build/require/type/parameters/parameters.js +0 -26
- package/build/require/type/partial/index.js +0 -26
- package/build/require/type/partial/partial-from-mapped-result.js +0 -26
- package/build/require/type/partial/partial.js +4 -30
- package/build/require/type/patterns/index.js +0 -26
- package/build/require/type/patterns/patterns.js +0 -26
- package/build/require/type/pick/index.js +0 -26
- package/build/require/type/pick/pick-from-mapped-key.js +0 -26
- package/build/require/type/pick/pick.js +5 -31
- package/build/require/type/promise/index.js +0 -26
- package/build/require/type/promise/promise.js +0 -26
- package/build/require/type/readonly/index.js +0 -26
- package/build/require/type/readonly/readonly.js +0 -26
- package/build/require/type/readonly-optional/index.js +0 -26
- package/build/require/type/readonly-optional/readonly-optional.js +0 -26
- package/build/require/type/record/index.js +0 -26
- package/build/require/type/record/record.d.ts +10 -9
- package/build/require/type/record/record.js +36 -58
- package/build/require/type/recursive/index.js +0 -26
- package/build/require/type/recursive/recursive.js +0 -26
- package/build/require/type/ref/index.js +0 -26
- package/build/require/type/ref/ref.js +0 -26
- package/build/require/type/regexp/index.js +0 -26
- package/build/require/type/regexp/regexp.js +0 -26
- package/build/require/type/registry/format.js +0 -26
- package/build/require/type/registry/index.js +0 -26
- package/build/require/type/registry/type.js +0 -26
- package/build/require/type/required/index.js +0 -26
- package/build/require/type/required/required-from-mapped-result.js +0 -26
- package/build/require/type/required/required.js +4 -30
- package/build/require/type/rest/index.js +0 -26
- package/build/require/type/rest/rest.js +5 -27
- package/build/require/type/return-type/index.js +0 -26
- package/build/require/type/return-type/return-type.js +0 -26
- package/build/require/type/schema/anyschema.js +0 -26
- package/build/require/type/schema/index.js +0 -26
- package/build/require/type/schema/schema.js +0 -26
- package/build/require/type/static/index.js +0 -26
- package/build/require/type/static/static.js +0 -26
- package/build/require/type/strict/index.js +0 -26
- package/build/require/type/strict/strict.js +0 -26
- package/build/require/type/string/index.js +0 -26
- package/build/require/type/string/string.js +0 -26
- package/build/require/type/symbol/index.js +0 -26
- package/build/require/type/symbol/symbol.js +0 -26
- package/build/require/type/symbols/index.js +0 -26
- package/build/require/type/symbols/symbols.js +0 -26
- package/build/require/type/template-literal/finite.js +0 -26
- package/build/require/type/template-literal/generate.js +0 -26
- package/build/require/type/template-literal/index.js +0 -26
- package/build/require/type/template-literal/parser.js +0 -26
- package/build/require/type/template-literal/pattern.js +8 -34
- package/build/require/type/template-literal/syntax.js +0 -26
- package/build/require/type/template-literal/template-literal.js +0 -26
- package/build/require/type/template-literal/union.js +0 -26
- package/build/require/type/transform/index.js +0 -26
- package/build/require/type/transform/transform.js +1 -27
- package/build/require/type/tuple/index.js +0 -26
- package/build/require/type/tuple/tuple.js +0 -26
- package/build/require/type/type/index.js +0 -26
- package/build/require/type/type/javascript.js +0 -26
- package/build/require/type/type/json.d.ts +2 -2
- package/build/require/type/type/json.js +0 -26
- package/build/require/type/type/type.js +0 -26
- package/build/require/type/uint8array/index.js +0 -26
- package/build/require/type/uint8array/uint8array.js +0 -26
- package/build/require/type/undefined/index.js +0 -26
- package/build/require/type/undefined/undefined.js +0 -26
- package/build/require/type/union/index.js +0 -26
- package/build/require/type/union/union-create.js +0 -26
- package/build/require/type/union/union-evaluated.js +1 -27
- package/build/require/type/union/union-type.js +0 -26
- package/build/require/type/union/union.js +0 -26
- package/build/require/type/unknown/index.js +0 -26
- package/build/require/type/unknown/unknown.js +0 -26
- package/build/require/type/unsafe/index.js +0 -26
- package/build/require/type/unsafe/unsafe.js +0 -26
- package/build/require/type/void/index.js +0 -26
- package/build/require/type/void/void.js +0 -26
- package/build/require/value/cast/cast.js +0 -26
- package/build/require/value/cast/index.js +0 -26
- package/build/require/value/check/check.js +63 -82
- package/build/require/value/check/index.js +0 -26
- package/build/require/value/clean/clean.js +31 -55
- package/build/require/value/clean/index.js +0 -26
- package/build/require/value/clone/clone.js +7 -30
- package/build/require/value/clone/index.js +0 -26
- package/build/require/value/convert/convert.js +42 -64
- package/build/require/value/convert/index.js +0 -26
- package/build/require/value/create/create.js +0 -26
- package/build/require/value/create/index.js +0 -26
- package/build/require/value/default/default.js +24 -42
- package/build/require/value/default/index.js +0 -26
- package/build/require/value/delta/delta.js +0 -26
- package/build/require/value/delta/index.js +0 -26
- package/build/require/value/deref/deref.js +0 -26
- package/build/require/value/deref/index.js +0 -26
- package/build/require/value/equal/equal.js +0 -26
- package/build/require/value/equal/index.js +0 -26
- package/build/require/value/guard/guard.js +0 -26
- package/build/require/value/guard/index.js +0 -26
- package/build/require/value/hash/hash.js +0 -26
- package/build/require/value/hash/index.js +0 -26
- package/build/require/value/index.js +0 -26
- package/build/require/value/mutate/index.js +0 -26
- package/build/require/value/mutate/mutate.js +0 -26
- package/build/require/value/pointer/index.js +0 -26
- package/build/require/value/pointer/pointer.js +0 -26
- package/build/require/value/transform/decode.js +27 -47
- package/build/require/value/transform/encode.js +28 -48
- package/build/require/value/transform/has.js +29 -49
- package/build/require/value/transform/index.js +0 -26
- package/build/require/value/value/index.js +0 -26
- package/build/require/value/value/value.js +0 -26
- package/license +3 -1
- package/package.json +1 -1
- package/readme.md +7 -7
- package/build/import/type/indexed/indexed-result.d.mts +0 -33
- package/build/import/type/indexed/indexed-result.mjs +0 -107
- package/build/require/type/indexed/indexed-result.d.ts +0 -33
- package/build/require/type/indexed/indexed-result.js +0 -111
|
@@ -1,110 +1,90 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*--------------------------------------------------------------------------
|
|
3
2
|
|
|
4
|
-
@sinclair/typebox/value
|
|
5
|
-
|
|
6
|
-
The MIT License (MIT)
|
|
7
|
-
|
|
8
|
-
Copyright (c) 2017-2023 Haydn Paterson (sinclair) <haydn.developer@gmail.com>
|
|
9
|
-
|
|
10
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
-
in the Software without restriction, including without limitation the rights
|
|
13
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
-
furnished to do so, subject to the following conditions:
|
|
16
|
-
|
|
17
|
-
The above copyright notice and this permission notice shall be included in
|
|
18
|
-
all copies or substantial portions of the Software.
|
|
19
|
-
|
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
26
|
-
THE SOFTWARE.
|
|
27
|
-
|
|
28
|
-
---------------------------------------------------------------------------*/
|
|
29
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
4
|
exports.HasTransform = void 0;
|
|
5
|
+
const index_1 = require("../deref/index");
|
|
6
|
+
const index_2 = require("../../type/symbols/index");
|
|
7
|
+
// ------------------------------------------------------------------
|
|
8
|
+
// TypeGuard
|
|
9
|
+
// ------------------------------------------------------------------
|
|
31
10
|
const type_1 = require("../../type/guard/type");
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
11
|
+
// ------------------------------------------------------------------
|
|
12
|
+
// ValueGuard
|
|
13
|
+
// ------------------------------------------------------------------
|
|
14
|
+
const index_3 = require("../guard/index");
|
|
35
15
|
// prettier-ignore
|
|
36
16
|
function TArray(schema, references) {
|
|
37
|
-
return (0, type_1.
|
|
17
|
+
return (0, type_1.IsTransform)(schema) || Visit(schema.items, references);
|
|
38
18
|
}
|
|
39
19
|
// prettier-ignore
|
|
40
20
|
function TAsyncIterator(schema, references) {
|
|
41
|
-
return (0, type_1.
|
|
21
|
+
return (0, type_1.IsTransform)(schema) || Visit(schema.items, references);
|
|
42
22
|
}
|
|
43
23
|
// prettier-ignore
|
|
44
24
|
function TConstructor(schema, references) {
|
|
45
|
-
return (0, type_1.
|
|
25
|
+
return (0, type_1.IsTransform)(schema) || Visit(schema.returns, references) || schema.parameters.some((schema) => Visit(schema, references));
|
|
46
26
|
}
|
|
47
27
|
// prettier-ignore
|
|
48
28
|
function TFunction(schema, references) {
|
|
49
|
-
return (0, type_1.
|
|
29
|
+
return (0, type_1.IsTransform)(schema) || Visit(schema.returns, references) || schema.parameters.some((schema) => Visit(schema, references));
|
|
50
30
|
}
|
|
51
31
|
// prettier-ignore
|
|
52
32
|
function TIntersect(schema, references) {
|
|
53
|
-
return (0, type_1.
|
|
33
|
+
return (0, type_1.IsTransform)(schema) || (0, type_1.IsTransform)(schema.unevaluatedProperties) || schema.allOf.some((schema) => Visit(schema, references));
|
|
54
34
|
}
|
|
55
35
|
// prettier-ignore
|
|
56
36
|
function TIterator(schema, references) {
|
|
57
|
-
return (0, type_1.
|
|
37
|
+
return (0, type_1.IsTransform)(schema) || Visit(schema.items, references);
|
|
58
38
|
}
|
|
59
39
|
// prettier-ignore
|
|
60
40
|
function TNot(schema, references) {
|
|
61
|
-
return (0, type_1.
|
|
41
|
+
return (0, type_1.IsTransform)(schema) || Visit(schema.not, references);
|
|
62
42
|
}
|
|
63
43
|
// prettier-ignore
|
|
64
44
|
function TObject(schema, references) {
|
|
65
|
-
return ((0, type_1.
|
|
45
|
+
return ((0, type_1.IsTransform)(schema) ||
|
|
66
46
|
Object.values(schema.properties).some((schema) => Visit(schema, references)) ||
|
|
67
|
-
((0, type_1.
|
|
47
|
+
((0, type_1.IsSchema)(schema.additionalProperties) && Visit(schema.additionalProperties, references)));
|
|
68
48
|
}
|
|
69
49
|
// prettier-ignore
|
|
70
50
|
function TPromise(schema, references) {
|
|
71
|
-
return (0, type_1.
|
|
51
|
+
return (0, type_1.IsTransform)(schema) || Visit(schema.item, references);
|
|
72
52
|
}
|
|
73
53
|
// prettier-ignore
|
|
74
54
|
function TRecord(schema, references) {
|
|
75
55
|
const pattern = Object.getOwnPropertyNames(schema.patternProperties)[0];
|
|
76
56
|
const property = schema.patternProperties[pattern];
|
|
77
|
-
return (0, type_1.
|
|
57
|
+
return (0, type_1.IsTransform)(schema) || Visit(property, references) || ((0, type_1.IsSchema)(schema.additionalProperties) && (0, type_1.IsTransform)(schema.additionalProperties));
|
|
78
58
|
}
|
|
79
59
|
// prettier-ignore
|
|
80
60
|
function TRef(schema, references) {
|
|
81
|
-
if ((0, type_1.
|
|
61
|
+
if ((0, type_1.IsTransform)(schema))
|
|
82
62
|
return true;
|
|
83
|
-
return Visit((0,
|
|
63
|
+
return Visit((0, index_1.Deref)(schema, references), references);
|
|
84
64
|
}
|
|
85
65
|
// prettier-ignore
|
|
86
66
|
function TThis(schema, references) {
|
|
87
|
-
if ((0, type_1.
|
|
67
|
+
if ((0, type_1.IsTransform)(schema))
|
|
88
68
|
return true;
|
|
89
|
-
return Visit((0,
|
|
69
|
+
return Visit((0, index_1.Deref)(schema, references), references);
|
|
90
70
|
}
|
|
91
71
|
// prettier-ignore
|
|
92
72
|
function TTuple(schema, references) {
|
|
93
|
-
return (0, type_1.
|
|
73
|
+
return (0, type_1.IsTransform)(schema) || (!(0, index_3.IsUndefined)(schema.items) && schema.items.some((schema) => Visit(schema, references)));
|
|
94
74
|
}
|
|
95
75
|
// prettier-ignore
|
|
96
76
|
function TUnion(schema, references) {
|
|
97
|
-
return (0, type_1.
|
|
77
|
+
return (0, type_1.IsTransform)(schema) || schema.anyOf.some((schema) => Visit(schema, references));
|
|
98
78
|
}
|
|
99
79
|
// prettier-ignore
|
|
100
80
|
function Visit(schema, references) {
|
|
101
|
-
const references_ = (0,
|
|
81
|
+
const references_ = (0, index_3.IsString)(schema.$id) ? [...references, schema] : references;
|
|
102
82
|
const schema_ = schema;
|
|
103
83
|
if (schema.$id && visited.has(schema.$id))
|
|
104
84
|
return false;
|
|
105
85
|
if (schema.$id)
|
|
106
86
|
visited.add(schema.$id);
|
|
107
|
-
switch (schema[
|
|
87
|
+
switch (schema[index_2.Kind]) {
|
|
108
88
|
case 'Array':
|
|
109
89
|
return TArray(schema_, references_);
|
|
110
90
|
case 'AsyncIterator':
|
|
@@ -134,7 +114,7 @@ function Visit(schema, references) {
|
|
|
134
114
|
case 'Union':
|
|
135
115
|
return TUnion(schema_, references_);
|
|
136
116
|
default:
|
|
137
|
-
return (0, type_1.
|
|
117
|
+
return (0, type_1.IsTransform)(schema);
|
|
138
118
|
}
|
|
139
119
|
}
|
|
140
120
|
const visited = new Set();
|
|
@@ -1,31 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*--------------------------------------------------------------------------
|
|
3
2
|
|
|
4
|
-
@sinclair/typebox/value
|
|
5
|
-
|
|
6
|
-
The MIT License (MIT)
|
|
7
|
-
|
|
8
|
-
Copyright (c) 2017-2023 Haydn Paterson (sinclair) <haydn.developer@gmail.com>
|
|
9
|
-
|
|
10
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
-
in the Software without restriction, including without limitation the rights
|
|
13
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
-
furnished to do so, subject to the following conditions:
|
|
16
|
-
|
|
17
|
-
The above copyright notice and this permission notice shall be included in
|
|
18
|
-
all copies or substantial portions of the Software.
|
|
19
|
-
|
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
26
|
-
THE SOFTWARE.
|
|
27
|
-
|
|
28
|
-
---------------------------------------------------------------------------*/
|
|
29
3
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
30
4
|
if (k2 === undefined) k2 = k;
|
|
31
5
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -1,31 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*--------------------------------------------------------------------------
|
|
3
2
|
|
|
4
|
-
@sinclair/typebox/value
|
|
5
|
-
|
|
6
|
-
The MIT License (MIT)
|
|
7
|
-
|
|
8
|
-
Copyright (c) 2017-2023 Haydn Paterson (sinclair) <haydn.developer@gmail.com>
|
|
9
|
-
|
|
10
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
-
in the Software without restriction, including without limitation the rights
|
|
13
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
-
furnished to do so, subject to the following conditions:
|
|
16
|
-
|
|
17
|
-
The above copyright notice and this permission notice shall be included in
|
|
18
|
-
all copies or substantial portions of the Software.
|
|
19
|
-
|
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
26
|
-
THE SOFTWARE.
|
|
27
|
-
|
|
28
|
-
---------------------------------------------------------------------------*/
|
|
29
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
4
|
exports.Value = void 0;
|
|
31
5
|
exports.Value = require("./value");
|
|
@@ -1,31 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*--------------------------------------------------------------------------
|
|
3
2
|
|
|
4
|
-
@sinclair/typebox/value
|
|
5
|
-
|
|
6
|
-
The MIT License (MIT)
|
|
7
|
-
|
|
8
|
-
Copyright (c) 2017-2023 Haydn Paterson (sinclair) <haydn.developer@gmail.com>
|
|
9
|
-
|
|
10
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
-
in the Software without restriction, including without limitation the rights
|
|
13
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
-
furnished to do so, subject to the following conditions:
|
|
16
|
-
|
|
17
|
-
The above copyright notice and this permission notice shall be included in
|
|
18
|
-
all copies or substantial portions of the Software.
|
|
19
|
-
|
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
26
|
-
THE SOFTWARE.
|
|
27
|
-
|
|
28
|
-
---------------------------------------------------------------------------*/
|
|
29
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
4
|
exports.Mutate = exports.Patch = exports.Hash = exports.Diff = exports.Equal = exports.Errors = exports.Encode = exports.Default = exports.Decode = exports.Clone = exports.Convert = exports.Clean = exports.Check = exports.Create = exports.Cast = void 0;
|
|
31
5
|
const index_1 = require("../transform/index");
|
package/license
CHANGED
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -1136,16 +1136,16 @@ type S = Static<typeof T> // type S = 'A' | 'B' | 'C'
|
|
|
1136
1136
|
|
|
1137
1137
|
### TypeGuard
|
|
1138
1138
|
|
|
1139
|
-
TypeBox can type check its own types with the TypeGuard module. This module is written for reflection and provides structural tests for every built-in TypeBox type. Functions of this module return `is` guards which can be used with TypeScript control flow assertions to obtain schema inference. The following guards that the value
|
|
1139
|
+
TypeBox can type check its own types with the TypeGuard module. This module is written for reflection and provides structural tests for every built-in TypeBox type. Functions of this module return `is` guards which can be used with TypeScript control flow assertions to obtain schema inference. The following guards that the value `T` is TString.
|
|
1140
1140
|
|
|
1141
1141
|
```typescript
|
|
1142
|
-
import {
|
|
1142
|
+
import { TypeGuard, Kind } from '@sinclair/typebox'
|
|
1143
1143
|
|
|
1144
|
-
const
|
|
1144
|
+
const T: unknown = { [Kind]: 'String', type: 'string' }
|
|
1145
1145
|
|
|
1146
|
-
if(TypeGuard.
|
|
1146
|
+
if(TypeGuard.IsString(T)) {
|
|
1147
1147
|
|
|
1148
|
-
|
|
1148
|
+
// T is TString
|
|
1149
1149
|
}
|
|
1150
1150
|
```
|
|
1151
1151
|
|
|
@@ -1723,7 +1723,7 @@ For additional comparative benchmarks, please refer to [typescript-runtime-type-
|
|
|
1723
1723
|
|
|
1724
1724
|
### Compile
|
|
1725
1725
|
|
|
1726
|
-
This benchmark measures compilation performance for varying types.
|
|
1726
|
+
This benchmark measures compilation performance for varying types.
|
|
1727
1727
|
|
|
1728
1728
|
```typescript
|
|
1729
1729
|
┌────────────────────────────┬────────────┬──────────────┬──────────────┬──────────────┐
|
|
@@ -1765,7 +1765,7 @@ This benchmark measures compilation performance for varying types. You can revie
|
|
|
1765
1765
|
|
|
1766
1766
|
### Validate
|
|
1767
1767
|
|
|
1768
|
-
This benchmark measures validation performance for varying types.
|
|
1768
|
+
This benchmark measures validation performance for varying types.
|
|
1769
1769
|
|
|
1770
1770
|
```typescript
|
|
1771
1771
|
┌────────────────────────────┬────────────┬──────────────┬──────────────┬──────────────┬──────────────┐
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { type TSchema, SchemaOptions } from '../schema/index.mjs';
|
|
2
|
-
import { type TObject, type TProperties } from '../object/index.mjs';
|
|
3
|
-
import { type TNever } from '../never/index.mjs';
|
|
4
|
-
import { type TRecursive } from '../recursive/index.mjs';
|
|
5
|
-
import { type TIntersect } from '../intersect/index.mjs';
|
|
6
|
-
import { type TUnion } from '../union/index.mjs';
|
|
7
|
-
import { type TTuple } from '../tuple/index.mjs';
|
|
8
|
-
import { type TArray } from '../array/index.mjs';
|
|
9
|
-
import { IntersectEvaluated } from '../intersect/index.mjs';
|
|
10
|
-
import { UnionEvaluated } from '../union/index.mjs';
|
|
11
|
-
type FromRest<T extends TSchema[], K extends PropertyKey> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? [FromKey<L, K>, ...FromRest<R, K>] : []);
|
|
12
|
-
declare function FromRest<T extends TSchema[], K extends PropertyKey>(T: [...T], K: K): FromRest<T, K>;
|
|
13
|
-
type FromIntersectRest<T extends TSchema[]> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? L extends TNever ? [...FromIntersectRest<R>] : [L, ...FromIntersectRest<R>] : []);
|
|
14
|
-
declare function FromIntersectRest<T extends TSchema[]>(T: [...T]): FromIntersectRest<T>;
|
|
15
|
-
type FromIntersect<T extends TSchema[], K extends PropertyKey> = (IntersectEvaluated<FromIntersectRest<FromRest<T, K>>>);
|
|
16
|
-
declare function FromIntersect<T extends TSchema[], K extends PropertyKey>(T: [...T], K: K): FromIntersect<T, K>;
|
|
17
|
-
type FromUnionRest<T extends TSchema[], S = T> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? L extends TNever ? [] : FromUnionRest<R, S> : S);
|
|
18
|
-
declare function FromUnionRest<T extends TSchema[]>(T: [...T], S?: [...T]): FromUnionRest<T>;
|
|
19
|
-
type FromUnion<T extends TSchema[], K extends PropertyKey> = (UnionEvaluated<FromUnionRest<FromRest<T, K>>>);
|
|
20
|
-
declare function FromUnion<T extends TSchema[], K extends PropertyKey>(T: [...T], K: K): FromUnion<T, K>;
|
|
21
|
-
type FromTuple<T extends TSchema[], K extends PropertyKey> = (K extends keyof T ? T[K] : K extends '[number]' ? UnionEvaluated<T> : TNever);
|
|
22
|
-
declare function FromTuple<T extends TSchema[], K extends PropertyKey>(T: [...T], K: K): FromTuple<T, K>;
|
|
23
|
-
type FromArray<T extends TSchema, K extends PropertyKey> = (K extends '[number]' ? T : TNever);
|
|
24
|
-
declare function FromArray<T extends TSchema, K extends PropertyKey>(T: T, K: K): FromArray<T, K>;
|
|
25
|
-
type FromProperty<T extends TProperties, K extends PropertyKey> = (K extends keyof T ? T[K] : TNever);
|
|
26
|
-
declare function FromProperty<T extends TProperties, K extends PropertyKey>(T: T, K: K): FromProperty<T, K>;
|
|
27
|
-
type FromKey<T extends TSchema, K extends PropertyKey> = (T extends TRecursive<infer S> ? FromKey<S, K> : T extends TIntersect<infer S> ? FromIntersect<S, K> : T extends TUnion<infer S> ? FromUnion<S, K> : T extends TTuple<infer S> ? FromTuple<S, K> : T extends TArray<infer S> ? FromArray<S, K> : T extends TObject<infer S> ? FromProperty<S, K> : TNever);
|
|
28
|
-
declare function FromKey<T extends TSchema, K extends PropertyKey>(T: T, K: K): FromKey<T, K>;
|
|
29
|
-
type FromKeys<T extends TSchema, K extends PropertyKey[]> = (K extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? [FromKey<T, L>, ...FromKeys<T, R>] : []);
|
|
30
|
-
declare function FromKeys<T extends TSchema, K extends PropertyKey[]>(T: T, K: [...K]): FromKeys<T, K>;
|
|
31
|
-
export type TIndexResult<T extends TSchema, K extends PropertyKey[]> = (UnionEvaluated<FromKeys<T, K>>);
|
|
32
|
-
export declare function IndexResult<T extends TSchema, K extends PropertyKey[]>(T: T, K: [...K], options: SchemaOptions): TIndexResult<T, K>;
|
|
33
|
-
export {};
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
/*--------------------------------------------------------------------------
|
|
2
|
-
|
|
3
|
-
@sinclair/typebox/type
|
|
4
|
-
|
|
5
|
-
The MIT License (MIT)
|
|
6
|
-
|
|
7
|
-
Copyright (c) 2017-2023 Haydn Paterson (sinclair) <haydn.developer@gmail.com>
|
|
8
|
-
|
|
9
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
-
in the Software without restriction, including without limitation the rights
|
|
12
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
-
furnished to do so, subject to the following conditions:
|
|
15
|
-
|
|
16
|
-
The above copyright notice and this permission notice shall be included in
|
|
17
|
-
all copies or substantial portions of the Software.
|
|
18
|
-
|
|
19
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
25
|
-
THE SOFTWARE.
|
|
26
|
-
|
|
27
|
-
---------------------------------------------------------------------------*/
|
|
28
|
-
import { Never } from '../never/index.mjs';
|
|
29
|
-
import { IntersectEvaluated } from '../intersect/index.mjs';
|
|
30
|
-
import { UnionEvaluated } from '../union/index.mjs';
|
|
31
|
-
import { CloneType } from '../clone/type.mjs';
|
|
32
|
-
// ------------------------------------------------------------------
|
|
33
|
-
// TypeGuard
|
|
34
|
-
// ------------------------------------------------------------------
|
|
35
|
-
// prettier-ignore
|
|
36
|
-
import { TArray as IsArrayType, TIntersect as IsIntersectType, TObject as IsObjectType, TNever as IsNeverType, TTuple as IsTupleType, TUnion as IsUnionType } from '../guard/type.mjs';
|
|
37
|
-
// prettier-ignore
|
|
38
|
-
function FromRest(T, K) {
|
|
39
|
-
const [L, ...R] = T;
|
|
40
|
-
return (T.length > 0
|
|
41
|
-
? [FromKey(L, K), ...FromRest(R, K)]
|
|
42
|
-
: []);
|
|
43
|
-
}
|
|
44
|
-
// prettier-ignore
|
|
45
|
-
function FromIntersectRest(T) {
|
|
46
|
-
const [L, ...R] = T;
|
|
47
|
-
return (T.length > 0
|
|
48
|
-
? IsNeverType(L)
|
|
49
|
-
? [...FromIntersectRest(R)]
|
|
50
|
-
: [L, ...FromIntersectRest(R)]
|
|
51
|
-
: []);
|
|
52
|
-
}
|
|
53
|
-
// prettier-ignore
|
|
54
|
-
function FromIntersect(T, K) {
|
|
55
|
-
return (IntersectEvaluated(FromIntersectRest(FromRest(T, K))));
|
|
56
|
-
}
|
|
57
|
-
// prettier-ignore
|
|
58
|
-
function FromUnionRest(T, S = T) {
|
|
59
|
-
const [L, ...R] = T;
|
|
60
|
-
return (T.length > 0
|
|
61
|
-
? IsNeverType(L)
|
|
62
|
-
? []
|
|
63
|
-
: FromUnionRest(R, S)
|
|
64
|
-
: S);
|
|
65
|
-
}
|
|
66
|
-
// prettier-ignore
|
|
67
|
-
function FromUnion(T, K) {
|
|
68
|
-
return (UnionEvaluated(FromUnionRest(FromRest(T, K))));
|
|
69
|
-
}
|
|
70
|
-
// prettier-ignore
|
|
71
|
-
function FromTuple(T, K) {
|
|
72
|
-
return (K in T ? T[K] :
|
|
73
|
-
K === '[number]' ? UnionEvaluated(T) :
|
|
74
|
-
Never());
|
|
75
|
-
}
|
|
76
|
-
// prettier-ignore
|
|
77
|
-
function FromArray(T, K) {
|
|
78
|
-
return (K === '[number]'
|
|
79
|
-
? T
|
|
80
|
-
: Never());
|
|
81
|
-
}
|
|
82
|
-
// prettier-ignore
|
|
83
|
-
function FromProperty(T, K) {
|
|
84
|
-
return (K in T
|
|
85
|
-
? T[K]
|
|
86
|
-
: Never());
|
|
87
|
-
}
|
|
88
|
-
// prettier-ignore
|
|
89
|
-
function FromKey(T, K) {
|
|
90
|
-
return (IsIntersectType(T) ? FromIntersect(T.allOf, K) :
|
|
91
|
-
IsUnionType(T) ? FromUnion(T.anyOf, K) :
|
|
92
|
-
IsTupleType(T) ? FromTuple(T.items ?? [], K) :
|
|
93
|
-
IsArrayType(T) ? FromArray(T.items, K) :
|
|
94
|
-
IsObjectType(T) ? FromProperty(T.properties, K) :
|
|
95
|
-
Never());
|
|
96
|
-
}
|
|
97
|
-
// prettier-ignore
|
|
98
|
-
function FromKeys(T, K) {
|
|
99
|
-
const [L, ...R] = K;
|
|
100
|
-
return (K.length > 0
|
|
101
|
-
? [FromKey(T, L), ...FromKeys(T, R)]
|
|
102
|
-
: []);
|
|
103
|
-
}
|
|
104
|
-
// prettier-ignore
|
|
105
|
-
export function IndexResult(T, K, options) {
|
|
106
|
-
return (CloneType(UnionEvaluated(FromKeys(T, K)), options));
|
|
107
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { type TSchema, SchemaOptions } from '../schema/index';
|
|
2
|
-
import { type TObject, type TProperties } from '../object/index';
|
|
3
|
-
import { type TNever } from '../never/index';
|
|
4
|
-
import { type TRecursive } from '../recursive/index';
|
|
5
|
-
import { type TIntersect } from '../intersect/index';
|
|
6
|
-
import { type TUnion } from '../union/index';
|
|
7
|
-
import { type TTuple } from '../tuple/index';
|
|
8
|
-
import { type TArray } from '../array/index';
|
|
9
|
-
import { IntersectEvaluated } from '../intersect/index';
|
|
10
|
-
import { UnionEvaluated } from '../union/index';
|
|
11
|
-
type FromRest<T extends TSchema[], K extends PropertyKey> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? [FromKey<L, K>, ...FromRest<R, K>] : []);
|
|
12
|
-
declare function FromRest<T extends TSchema[], K extends PropertyKey>(T: [...T], K: K): FromRest<T, K>;
|
|
13
|
-
type FromIntersectRest<T extends TSchema[]> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? L extends TNever ? [...FromIntersectRest<R>] : [L, ...FromIntersectRest<R>] : []);
|
|
14
|
-
declare function FromIntersectRest<T extends TSchema[]>(T: [...T]): FromIntersectRest<T>;
|
|
15
|
-
type FromIntersect<T extends TSchema[], K extends PropertyKey> = (IntersectEvaluated<FromIntersectRest<FromRest<T, K>>>);
|
|
16
|
-
declare function FromIntersect<T extends TSchema[], K extends PropertyKey>(T: [...T], K: K): FromIntersect<T, K>;
|
|
17
|
-
type FromUnionRest<T extends TSchema[], S = T> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? L extends TNever ? [] : FromUnionRest<R, S> : S);
|
|
18
|
-
declare function FromUnionRest<T extends TSchema[]>(T: [...T], S?: [...T]): FromUnionRest<T>;
|
|
19
|
-
type FromUnion<T extends TSchema[], K extends PropertyKey> = (UnionEvaluated<FromUnionRest<FromRest<T, K>>>);
|
|
20
|
-
declare function FromUnion<T extends TSchema[], K extends PropertyKey>(T: [...T], K: K): FromUnion<T, K>;
|
|
21
|
-
type FromTuple<T extends TSchema[], K extends PropertyKey> = (K extends keyof T ? T[K] : K extends '[number]' ? UnionEvaluated<T> : TNever);
|
|
22
|
-
declare function FromTuple<T extends TSchema[], K extends PropertyKey>(T: [...T], K: K): FromTuple<T, K>;
|
|
23
|
-
type FromArray<T extends TSchema, K extends PropertyKey> = (K extends '[number]' ? T : TNever);
|
|
24
|
-
declare function FromArray<T extends TSchema, K extends PropertyKey>(T: T, K: K): FromArray<T, K>;
|
|
25
|
-
type FromProperty<T extends TProperties, K extends PropertyKey> = (K extends keyof T ? T[K] : TNever);
|
|
26
|
-
declare function FromProperty<T extends TProperties, K extends PropertyKey>(T: T, K: K): FromProperty<T, K>;
|
|
27
|
-
type FromKey<T extends TSchema, K extends PropertyKey> = (T extends TRecursive<infer S> ? FromKey<S, K> : T extends TIntersect<infer S> ? FromIntersect<S, K> : T extends TUnion<infer S> ? FromUnion<S, K> : T extends TTuple<infer S> ? FromTuple<S, K> : T extends TArray<infer S> ? FromArray<S, K> : T extends TObject<infer S> ? FromProperty<S, K> : TNever);
|
|
28
|
-
declare function FromKey<T extends TSchema, K extends PropertyKey>(T: T, K: K): FromKey<T, K>;
|
|
29
|
-
type FromKeys<T extends TSchema, K extends PropertyKey[]> = (K extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? [FromKey<T, L>, ...FromKeys<T, R>] : []);
|
|
30
|
-
declare function FromKeys<T extends TSchema, K extends PropertyKey[]>(T: T, K: [...K]): FromKeys<T, K>;
|
|
31
|
-
export type TIndexResult<T extends TSchema, K extends PropertyKey[]> = (UnionEvaluated<FromKeys<T, K>>);
|
|
32
|
-
export declare function IndexResult<T extends TSchema, K extends PropertyKey[]>(T: T, K: [...K], options: SchemaOptions): TIndexResult<T, K>;
|
|
33
|
-
export {};
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*--------------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
@sinclair/typebox/type
|
|
5
|
-
|
|
6
|
-
The MIT License (MIT)
|
|
7
|
-
|
|
8
|
-
Copyright (c) 2017-2023 Haydn Paterson (sinclair) <haydn.developer@gmail.com>
|
|
9
|
-
|
|
10
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
-
in the Software without restriction, including without limitation the rights
|
|
13
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
-
furnished to do so, subject to the following conditions:
|
|
16
|
-
|
|
17
|
-
The above copyright notice and this permission notice shall be included in
|
|
18
|
-
all copies or substantial portions of the Software.
|
|
19
|
-
|
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
26
|
-
THE SOFTWARE.
|
|
27
|
-
|
|
28
|
-
---------------------------------------------------------------------------*/
|
|
29
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.IndexResult = void 0;
|
|
31
|
-
const index_1 = require("../never/index");
|
|
32
|
-
const index_2 = require("../intersect/index");
|
|
33
|
-
const index_3 = require("../union/index");
|
|
34
|
-
const type_1 = require("../clone/type");
|
|
35
|
-
// ------------------------------------------------------------------
|
|
36
|
-
// TypeGuard
|
|
37
|
-
// ------------------------------------------------------------------
|
|
38
|
-
// prettier-ignore
|
|
39
|
-
const type_2 = require("../guard/type");
|
|
40
|
-
// prettier-ignore
|
|
41
|
-
function FromRest(T, K) {
|
|
42
|
-
const [L, ...R] = T;
|
|
43
|
-
return (T.length > 0
|
|
44
|
-
? [FromKey(L, K), ...FromRest(R, K)]
|
|
45
|
-
: []);
|
|
46
|
-
}
|
|
47
|
-
// prettier-ignore
|
|
48
|
-
function FromIntersectRest(T) {
|
|
49
|
-
const [L, ...R] = T;
|
|
50
|
-
return (T.length > 0
|
|
51
|
-
? (0, type_2.TNever)(L)
|
|
52
|
-
? [...FromIntersectRest(R)]
|
|
53
|
-
: [L, ...FromIntersectRest(R)]
|
|
54
|
-
: []);
|
|
55
|
-
}
|
|
56
|
-
// prettier-ignore
|
|
57
|
-
function FromIntersect(T, K) {
|
|
58
|
-
return ((0, index_2.IntersectEvaluated)(FromIntersectRest(FromRest(T, K))));
|
|
59
|
-
}
|
|
60
|
-
// prettier-ignore
|
|
61
|
-
function FromUnionRest(T, S = T) {
|
|
62
|
-
const [L, ...R] = T;
|
|
63
|
-
return (T.length > 0
|
|
64
|
-
? (0, type_2.TNever)(L)
|
|
65
|
-
? []
|
|
66
|
-
: FromUnionRest(R, S)
|
|
67
|
-
: S);
|
|
68
|
-
}
|
|
69
|
-
// prettier-ignore
|
|
70
|
-
function FromUnion(T, K) {
|
|
71
|
-
return ((0, index_3.UnionEvaluated)(FromUnionRest(FromRest(T, K))));
|
|
72
|
-
}
|
|
73
|
-
// prettier-ignore
|
|
74
|
-
function FromTuple(T, K) {
|
|
75
|
-
return (K in T ? T[K] :
|
|
76
|
-
K === '[number]' ? (0, index_3.UnionEvaluated)(T) :
|
|
77
|
-
(0, index_1.Never)());
|
|
78
|
-
}
|
|
79
|
-
// prettier-ignore
|
|
80
|
-
function FromArray(T, K) {
|
|
81
|
-
return (K === '[number]'
|
|
82
|
-
? T
|
|
83
|
-
: (0, index_1.Never)());
|
|
84
|
-
}
|
|
85
|
-
// prettier-ignore
|
|
86
|
-
function FromProperty(T, K) {
|
|
87
|
-
return (K in T
|
|
88
|
-
? T[K]
|
|
89
|
-
: (0, index_1.Never)());
|
|
90
|
-
}
|
|
91
|
-
// prettier-ignore
|
|
92
|
-
function FromKey(T, K) {
|
|
93
|
-
return ((0, type_2.TIntersect)(T) ? FromIntersect(T.allOf, K) :
|
|
94
|
-
(0, type_2.TUnion)(T) ? FromUnion(T.anyOf, K) :
|
|
95
|
-
(0, type_2.TTuple)(T) ? FromTuple(T.items ?? [], K) :
|
|
96
|
-
(0, type_2.TArray)(T) ? FromArray(T.items, K) :
|
|
97
|
-
(0, type_2.TObject)(T) ? FromProperty(T.properties, K) :
|
|
98
|
-
(0, index_1.Never)());
|
|
99
|
-
}
|
|
100
|
-
// prettier-ignore
|
|
101
|
-
function FromKeys(T, K) {
|
|
102
|
-
const [L, ...R] = K;
|
|
103
|
-
return (K.length > 0
|
|
104
|
-
? [FromKey(T, L), ...FromKeys(T, R)]
|
|
105
|
-
: []);
|
|
106
|
-
}
|
|
107
|
-
// prettier-ignore
|
|
108
|
-
function IndexResult(T, K, options) {
|
|
109
|
-
return ((0, type_1.CloneType)((0, index_3.UnionEvaluated)(FromKeys(T, K)), options));
|
|
110
|
-
}
|
|
111
|
-
exports.IndexResult = IndexResult;
|