@sinclair/typebox 0.32.0-dev-15 → 0.32.0-dev-17
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.d.mts +9 -0
- package/build/import/compiler/compiler.mjs +87 -6
- package/build/import/compiler/index.mjs +27 -0
- package/build/import/errors/errors.d.mts +3 -0
- package/build/import/errors/errors.mjs +55 -3
- package/build/import/errors/function.d.mts +3 -0
- package/build/import/errors/function.mjs +31 -0
- package/build/import/errors/index.mjs +27 -0
- package/build/import/index.d.mts +2 -2
- package/build/import/index.mjs +38 -2
- package/build/import/system/index.mjs +27 -0
- package/build/import/system/policy.d.mts +10 -0
- package/build/import/system/policy.mjs +40 -0
- package/build/import/system/system.d.mts +3 -0
- package/build/import/system/system.mjs +36 -0
- package/build/import/type/any/any.d.mts +1 -0
- package/build/import/type/any/any.mjs +28 -0
- package/build/import/type/any/index.mjs +27 -0
- package/build/import/type/array/array.d.mts +8 -1
- package/build/import/type/array/array.mjs +28 -0
- package/build/import/type/array/index.mjs +27 -0
- package/build/import/type/async-iterator/async-iterator.d.mts +1 -0
- package/build/import/type/async-iterator/async-iterator.mjs +28 -0
- package/build/import/type/async-iterator/index.mjs +27 -0
- package/build/import/type/awaited/awaited.d.mts +1 -0
- package/build/import/type/awaited/awaited.mjs +37 -0
- package/build/import/type/awaited/index.mjs +27 -0
- package/build/import/type/bigint/bigint.d.mts +1 -0
- package/build/import/type/bigint/bigint.mjs +28 -0
- package/build/import/type/bigint/index.mjs +27 -0
- package/build/import/type/boolean/boolean.d.mts +1 -0
- package/build/import/type/boolean/boolean.mjs +28 -0
- package/build/import/type/boolean/index.mjs +27 -0
- package/build/import/type/clone/index.mjs +27 -0
- package/build/import/type/clone/type.d.mts +2 -0
- package/build/import/type/clone/type.mjs +29 -0
- package/build/import/type/clone/value.d.mts +1 -0
- package/build/import/type/clone/value.mjs +29 -0
- package/build/import/type/composite/composite.d.mts +1 -0
- package/build/import/type/composite/composite.mjs +28 -0
- package/build/import/type/composite/index.mjs +27 -0
- package/build/import/type/const/const.d.mts +2 -1
- package/build/import/type/const/const.mjs +32 -1
- package/build/import/type/const/index.mjs +27 -0
- package/build/import/type/constructor/constructor.d.mts +5 -4
- package/build/import/type/constructor/constructor.mjs +28 -0
- package/build/import/type/constructor/index.mjs +27 -0
- package/build/import/type/constructor-parameters/constructor-parameters.d.mts +1 -0
- package/build/import/type/constructor-parameters/constructor-parameters.mjs +28 -0
- package/build/import/type/constructor-parameters/index.mjs +27 -0
- package/build/import/type/date/date.d.mts +6 -0
- package/build/import/type/date/date.mjs +28 -0
- package/build/import/type/date/index.mjs +27 -0
- package/build/import/type/deref/deref.d.mts +1 -0
- package/build/import/type/deref/deref.mjs +45 -0
- package/build/import/type/deref/index.mjs +27 -0
- package/build/import/type/discard/discard.mjs +27 -0
- package/build/import/type/discard/index.mjs +27 -0
- package/build/import/type/enum/enum.d.mts +1 -0
- package/build/import/type/enum/enum.mjs +28 -0
- package/build/import/type/enum/index.mjs +27 -0
- package/build/import/type/exclude/exclude-from-mapped-result.mjs +30 -0
- package/build/import/type/exclude/exclude.d.mts +5 -3
- package/build/import/type/exclude/exclude.mjs +30 -0
- package/build/import/type/exclude/index.mjs +27 -0
- package/build/import/type/extends/extends-check.mjs +200 -1
- package/build/import/type/extends/extends-from-mapped-key.mjs +31 -0
- package/build/import/type/extends/extends-from-mapped-result.mjs +30 -0
- package/build/import/type/extends/extends-undefined.d.mts +1 -0
- package/build/import/type/extends/extends-undefined.mjs +30 -0
- package/build/import/type/extends/extends.d.mts +3 -0
- package/build/import/type/extends/extends.mjs +35 -1
- package/build/import/type/extends/index.mjs +27 -0
- package/build/import/type/extract/extract-from-mapped-result.mjs +30 -0
- package/build/import/type/extract/extract.d.mts +5 -3
- package/build/import/type/extract/extract.mjs +30 -0
- package/build/import/type/extract/index.mjs +27 -0
- package/build/import/type/function/function.d.mts +5 -4
- package/build/import/type/function/function.mjs +28 -0
- package/build/import/type/function/index.mjs +27 -0
- package/build/import/type/guard/index.mjs +27 -0
- package/build/import/type/guard/type.d.mts +46 -0
- package/build/import/type/guard/type.mjs +111 -1
- package/build/import/type/guard/value.d.mts +14 -0
- package/build/import/type/guard/value.mjs +41 -0
- package/build/import/type/helpers/helpers.d.mts +1 -0
- package/build/import/type/helpers/helpers.mjs +28 -0
- package/build/import/type/helpers/index.mjs +27 -0
- package/build/import/type/index.mjs +27 -0
- package/build/import/type/indexed/index.mjs +27 -0
- package/build/import/type/indexed/indexed-from-mapped-key.mjs +35 -1
- package/build/import/type/indexed/indexed-property-keys.d.mts +1 -0
- package/build/import/type/indexed/indexed-property-keys.mjs +36 -0
- package/build/import/type/indexed/indexed-result.d.mts +6 -6
- package/build/import/type/indexed/indexed-result.mjs +49 -7
- package/build/import/type/indexed/indexed.d.mts +3 -0
- package/build/import/type/indexed/indexed.mjs +34 -1
- package/build/import/type/instance-type/index.mjs +27 -0
- package/build/import/type/instance-type/instance-type.d.mts +1 -0
- package/build/import/type/instance-type/instance-type.mjs +28 -0
- package/build/import/type/integer/index.mjs +27 -0
- package/build/import/type/integer/integer.d.mts +1 -0
- package/build/import/type/integer/integer.mjs +28 -0
- package/build/import/type/intersect/index.d.mts +2 -0
- package/build/import/type/intersect/index.mjs +29 -0
- package/build/import/type/intersect/intersect-create.d.mts +3 -0
- package/build/import/type/intersect/intersect-create.mjs +47 -0
- package/build/import/type/intersect/intersect-evaluated.d.mts +17 -0
- package/build/import/type/intersect/intersect-evaluated.mjs +71 -0
- package/build/import/type/intersect/intersect-type.d.mts +15 -0
- package/build/import/type/intersect/intersect-type.mjs +28 -0
- package/build/import/type/intersect/intersect.d.mts +5 -20
- package/build/import/type/intersect/intersect.mjs +37 -17
- package/build/import/type/intrinsic/capitalize.d.mts +1 -0
- package/build/import/type/intrinsic/capitalize.mjs +28 -0
- package/build/import/type/intrinsic/index.mjs +27 -0
- package/build/import/type/intrinsic/intrinsic-from-mapped-key.mjs +31 -0
- package/build/import/type/intrinsic/intrinsic.d.mts +2 -0
- package/build/import/type/intrinsic/intrinsic.mjs +43 -1
- package/build/import/type/intrinsic/lowercase.d.mts +1 -0
- package/build/import/type/intrinsic/lowercase.mjs +28 -0
- package/build/import/type/intrinsic/uncapitalize.d.mts +1 -0
- package/build/import/type/intrinsic/uncapitalize.mjs +28 -0
- package/build/import/type/intrinsic/uppercase.d.mts +1 -0
- package/build/import/type/intrinsic/uppercase.mjs +28 -0
- package/build/import/type/iterator/index.mjs +27 -0
- package/build/import/type/iterator/iterator.d.mts +1 -0
- package/build/import/type/iterator/iterator.mjs +28 -0
- package/build/import/type/keyof/index.mjs +27 -0
- package/build/import/type/keyof/keyof-from-mapped-result.mjs +30 -0
- package/build/import/type/keyof/keyof-property-keys.d.mts +2 -0
- package/build/import/type/keyof/keyof-property-keys.mjs +47 -0
- package/build/import/type/keyof/keyof.d.mts +4 -2
- package/build/import/type/keyof/keyof.mjs +35 -2
- package/build/import/type/literal/index.mjs +27 -0
- package/build/import/type/literal/literal.d.mts +1 -0
- package/build/import/type/literal/literal.mjs +28 -0
- package/build/import/type/mapped/index.mjs +27 -0
- package/build/import/type/mapped/mapped-key.mjs +28 -0
- package/build/import/type/mapped/mapped-result.mjs +28 -0
- package/build/import/type/mapped/mapped.d.mts +2 -0
- package/build/import/type/mapped/mapped.mjs +47 -3
- package/build/import/type/modifiers/index.mjs +27 -0
- package/build/import/type/modifiers/modifiers.mjs +37 -0
- package/build/import/type/never/index.mjs +27 -0
- package/build/import/type/never/never.d.mts +1 -0
- package/build/import/type/never/never.mjs +28 -0
- package/build/import/type/not/index.mjs +27 -0
- package/build/import/type/not/not.d.mts +1 -0
- package/build/import/type/not/not.mjs +28 -0
- package/build/import/type/null/index.mjs +27 -0
- package/build/import/type/null/null.d.mts +1 -0
- package/build/import/type/null/null.mjs +28 -0
- package/build/import/type/number/index.mjs +27 -0
- package/build/import/type/number/number.d.mts +1 -0
- package/build/import/type/number/number.mjs +28 -0
- package/build/import/type/object/index.mjs +27 -0
- package/build/import/type/object/object.d.mts +10 -5
- package/build/import/type/object/object.mjs +33 -0
- package/build/import/type/omit/index.mjs +27 -0
- package/build/import/type/omit/omit-from-mapped-key.mjs +31 -0
- package/build/import/type/omit/omit.d.mts +3 -0
- package/build/import/type/omit/omit.mjs +39 -0
- package/build/import/type/operators/index.mjs +27 -0
- package/build/import/type/operators/operators.d.mts +8 -0
- package/build/import/type/operators/operators.mjs +42 -0
- package/build/import/type/optional/index.mjs +27 -0
- package/build/import/type/optional/optional.d.mts +1 -0
- package/build/import/type/optional/optional.mjs +28 -0
- package/build/import/type/parameters/index.mjs +27 -0
- package/build/import/type/parameters/parameters.d.mts +1 -0
- package/build/import/type/parameters/parameters.mjs +28 -0
- package/build/import/type/partial/index.mjs +27 -0
- package/build/import/type/partial/partial-from-mapped-result.mjs +30 -0
- package/build/import/type/partial/partial.d.mts +2 -0
- package/build/import/type/partial/partial.mjs +36 -0
- package/build/import/type/patterns/index.mjs +27 -0
- package/build/import/type/patterns/patterns.mjs +27 -0
- package/build/import/type/pick/index.mjs +27 -0
- package/build/import/type/pick/pick-from-mapped-key.mjs +31 -0
- package/build/import/type/pick/pick.d.mts +3 -0
- package/build/import/type/pick/pick.mjs +34 -0
- package/build/import/type/promise/index.mjs +27 -0
- package/build/import/type/promise/promise.d.mts +1 -0
- package/build/import/type/promise/promise.mjs +28 -0
- package/build/import/type/readonly/index.mjs +27 -0
- package/build/import/type/readonly/readonly.d.mts +1 -0
- package/build/import/type/readonly/readonly.mjs +28 -0
- package/build/import/type/readonly-optional/index.mjs +27 -0
- package/build/import/type/readonly-optional/readonly-optional.d.mts +1 -0
- package/build/import/type/readonly-optional/readonly-optional.mjs +28 -0
- package/build/import/type/record/index.mjs +27 -0
- package/build/import/type/record/record.d.mts +1 -1
- package/build/import/type/record/record.mjs +49 -1
- package/build/import/type/recursive/index.mjs +27 -0
- package/build/import/type/recursive/recursive.d.mts +4 -2
- package/build/import/type/recursive/recursive.mjs +31 -5
- package/build/import/type/ref/index.mjs +27 -0
- package/build/import/type/ref/ref.d.mts +2 -0
- package/build/import/type/ref/ref.mjs +28 -0
- package/build/import/type/regexp/index.mjs +27 -0
- package/build/import/type/regexp/regexp.d.mts +2 -0
- package/build/import/type/regexp/regexp.mjs +28 -0
- package/build/import/type/registry/format.d.mts +6 -0
- package/build/import/type/registry/format.mjs +34 -0
- package/build/import/type/registry/index.mjs +27 -0
- package/build/import/type/registry/type.d.mts +6 -0
- package/build/import/type/registry/type.mjs +34 -0
- package/build/import/type/required/index.mjs +27 -0
- package/build/import/type/required/required-from-mapped-result.mjs +30 -0
- package/build/import/type/required/required.d.mts +2 -0
- package/build/import/type/required/required.mjs +36 -0
- package/build/import/type/rest/index.mjs +27 -0
- package/build/import/type/rest/rest.d.mts +1 -0
- package/build/import/type/rest/rest.mjs +32 -0
- package/build/import/type/return-type/index.mjs +27 -0
- package/build/import/type/return-type/return-type.d.mts +1 -0
- package/build/import/type/return-type/return-type.mjs +28 -0
- package/build/import/type/schema/anyschema.mjs +27 -0
- package/build/import/type/schema/index.mjs +27 -0
- package/build/import/type/schema/schema.d.mts +7 -0
- package/build/import/type/schema/schema.mjs +27 -0
- package/build/import/type/static/index.mjs +27 -0
- package/build/import/type/static/static.d.mts +3 -0
- package/build/import/type/static/static.mjs +27 -0
- package/build/import/type/strict/index.mjs +27 -0
- package/build/import/type/strict/strict.d.mts +1 -0
- package/build/import/type/strict/strict.mjs +28 -0
- package/build/import/type/string/index.mjs +27 -0
- package/build/import/type/string/string.d.mts +7 -0
- package/build/import/type/string/string.mjs +28 -0
- package/build/import/type/symbol/index.mjs +27 -0
- package/build/import/type/symbol/symbol.d.mts +1 -0
- package/build/import/type/symbol/symbol.mjs +28 -0
- package/build/import/type/symbols/index.mjs +27 -0
- package/build/import/type/symbols/symbols.d.mts +5 -0
- package/build/import/type/symbols/symbols.mjs +32 -0
- package/build/import/type/template-literal/finite.mjs +37 -0
- package/build/import/type/template-literal/generate.mjs +37 -0
- package/build/import/type/template-literal/index.mjs +27 -0
- package/build/import/type/template-literal/parser.d.mts +2 -0
- package/build/import/type/template-literal/parser.mjs +44 -0
- package/build/import/type/template-literal/pattern.mjs +38 -0
- package/build/import/type/template-literal/syntax.d.mts +5 -4
- package/build/import/type/template-literal/syntax.mjs +35 -0
- package/build/import/type/template-literal/template-literal.d.mts +6 -4
- package/build/import/type/template-literal/template-literal.mjs +29 -0
- package/build/import/type/template-literal/union.d.mts +1 -0
- package/build/import/type/template-literal/union.mjs +31 -0
- package/build/import/type/transform/index.mjs +27 -0
- package/build/import/type/transform/transform.d.mts +4 -2
- package/build/import/type/transform/transform.mjs +37 -1
- package/build/import/type/tuple/index.mjs +27 -0
- package/build/import/type/tuple/tuple.d.mts +4 -3
- package/build/import/type/tuple/tuple.mjs +30 -0
- package/build/import/type/type/index.d.mts +1 -0
- package/build/import/type/type/index.mjs +34 -0
- package/build/import/type/type/javascript.d.mts +19 -0
- package/build/import/type/type/javascript.mjs +45 -0
- package/build/import/type/type/json.d.mts +66 -5
- package/build/import/type/type/json.mjs +82 -1
- package/build/import/type/type/type.mjs +30 -0
- package/build/import/type/uint8array/index.mjs +27 -0
- package/build/import/type/uint8array/uint8array.d.mts +1 -0
- package/build/import/type/uint8array/uint8array.mjs +28 -0
- package/build/import/type/undefined/index.mjs +27 -0
- package/build/import/type/undefined/undefined.d.mts +1 -0
- package/build/import/type/undefined/undefined.mjs +28 -0
- package/build/import/type/union/index.d.mts +2 -0
- package/build/import/type/union/index.mjs +29 -0
- package/build/import/type/union/union-create.d.mts +3 -0
- package/build/import/type/union/union-create.mjs +32 -0
- package/build/import/type/union/union-evaluated.d.mts +17 -0
- package/build/import/type/union/union-evaluated.mjs +68 -0
- package/build/import/type/union/union-type.d.mts +12 -0
- package/build/import/type/union/union-type.mjs +28 -0
- package/build/import/type/union/union.d.mts +4 -13
- package/build/import/type/union/union.mjs +32 -10
- package/build/import/type/unknown/index.mjs +27 -0
- package/build/import/type/unknown/unknown.d.mts +1 -0
- package/build/import/type/unknown/unknown.mjs +28 -0
- package/build/import/type/unsafe/index.mjs +27 -0
- package/build/import/type/unsafe/unsafe.d.mts +1 -0
- package/build/import/type/unsafe/unsafe.mjs +28 -0
- package/build/import/type/void/index.mjs +27 -0
- package/build/import/type/void/void.d.mts +1 -0
- package/build/import/type/void/void.mjs +28 -0
- package/build/import/value/cast/cast.d.mts +2 -0
- package/build/import/value/cast/cast.mjs +55 -0
- package/build/import/value/cast/index.mjs +27 -0
- package/build/import/value/check/check.d.mts +2 -0
- package/build/import/value/check/check.mjs +46 -1
- package/build/import/value/check/index.mjs +27 -0
- package/build/import/value/clean/clean.d.mts +2 -0
- package/build/import/value/clean/clean.mjs +39 -1
- package/build/import/value/clean/index.mjs +27 -0
- package/build/import/value/clone/clone.d.mts +1 -0
- package/build/import/value/clone/clone.mjs +34 -0
- package/build/import/value/clone/index.mjs +27 -0
- package/build/import/value/convert/convert.d.mts +2 -0
- package/build/import/value/convert/convert.mjs +57 -1
- package/build/import/value/convert/index.mjs +27 -0
- package/build/import/value/create/create.d.mts +2 -0
- package/build/import/value/create/create.mjs +44 -0
- package/build/import/value/create/index.mjs +27 -0
- package/build/import/value/default/default.d.mts +2 -0
- package/build/import/value/default/default.mjs +46 -0
- package/build/import/value/default/index.mjs +27 -0
- package/build/import/value/delta/delta.d.mts +1 -1
- package/build/import/value/delta/delta.mjs +42 -0
- package/build/import/value/delta/index.mjs +27 -0
- package/build/import/value/deref/deref.d.mts +1 -0
- package/build/import/value/deref/deref.mjs +28 -0
- package/build/import/value/deref/index.mjs +27 -0
- package/build/import/value/equal/equal.d.mts +1 -0
- package/build/import/value/equal/equal.mjs +34 -0
- package/build/import/value/equal/index.mjs +27 -0
- package/build/import/value/guard/guard.d.mts +20 -0
- package/build/import/value/guard/guard.mjs +57 -0
- package/build/import/value/guard/index.mjs +27 -0
- package/build/import/value/hash/hash.d.mts +1 -0
- package/build/import/value/hash/hash.mjs +46 -0
- package/build/import/value/hash/index.mjs +27 -0
- package/build/import/value/index.mjs +39 -0
- package/build/import/value/mutate/index.mjs +27 -0
- package/build/import/value/mutate/mutate.d.mts +1 -0
- package/build/import/value/mutate/mutate.mjs +38 -0
- package/build/import/value/pointer/index.mjs +27 -0
- package/build/import/value/pointer/pointer.d.mts +5 -0
- package/build/import/value/pointer/pointer.mjs +45 -0
- package/build/import/value/transform/decode.d.mts +5 -0
- package/build/import/value/transform/decode.mjs +50 -0
- package/build/import/value/transform/encode.d.mts +6 -0
- package/build/import/value/transform/encode.mjs +52 -0
- package/build/import/value/transform/has.d.mts +1 -0
- package/build/import/value/transform/has.mjs +43 -0
- package/build/import/value/transform/index.mjs +27 -0
- package/build/import/value/value/index.mjs +27 -0
- package/build/import/value/value/value.d.mts +24 -0
- package/build/import/value/value/value.mjs +42 -0
- package/build/require/compiler/compiler.d.ts +9 -0
- package/build/require/compiler/compiler.js +87 -6
- package/build/require/compiler/index.js +27 -0
- package/build/require/errors/errors.d.ts +3 -0
- package/build/require/errors/errors.js +55 -3
- package/build/require/errors/function.d.ts +3 -0
- package/build/require/errors/function.js +31 -0
- package/build/require/errors/index.js +27 -0
- package/build/require/index.d.ts +2 -2
- package/build/require/index.js +41 -2
- package/build/require/system/index.js +27 -0
- package/build/require/system/policy.d.ts +10 -0
- package/build/require/system/policy.js +40 -0
- package/build/require/system/system.d.ts +3 -0
- package/build/require/system/system.js +36 -0
- package/build/require/type/any/any.d.ts +1 -0
- package/build/require/type/any/any.js +28 -0
- package/build/require/type/any/index.js +27 -0
- package/build/require/type/array/array.d.ts +8 -1
- package/build/require/type/array/array.js +28 -0
- package/build/require/type/array/index.js +27 -0
- package/build/require/type/async-iterator/async-iterator.d.ts +1 -0
- package/build/require/type/async-iterator/async-iterator.js +28 -0
- package/build/require/type/async-iterator/index.js +27 -0
- package/build/require/type/awaited/awaited.d.ts +1 -0
- package/build/require/type/awaited/awaited.js +37 -0
- package/build/require/type/awaited/index.js +27 -0
- package/build/require/type/bigint/bigint.d.ts +1 -0
- package/build/require/type/bigint/bigint.js +28 -0
- package/build/require/type/bigint/index.js +27 -0
- package/build/require/type/boolean/boolean.d.ts +1 -0
- package/build/require/type/boolean/boolean.js +28 -0
- package/build/require/type/boolean/index.js +27 -0
- package/build/require/type/clone/index.js +27 -0
- package/build/require/type/clone/type.d.ts +2 -0
- package/build/require/type/clone/type.js +29 -0
- package/build/require/type/clone/value.d.ts +1 -0
- package/build/require/type/clone/value.js +29 -0
- package/build/require/type/composite/composite.d.ts +1 -0
- package/build/require/type/composite/composite.js +28 -0
- package/build/require/type/composite/index.js +27 -0
- package/build/require/type/const/const.d.ts +2 -1
- package/build/require/type/const/const.js +32 -1
- package/build/require/type/const/index.js +27 -0
- package/build/require/type/constructor/constructor.d.ts +5 -4
- package/build/require/type/constructor/constructor.js +28 -0
- package/build/require/type/constructor/index.js +27 -0
- package/build/require/type/constructor-parameters/constructor-parameters.d.ts +1 -0
- package/build/require/type/constructor-parameters/constructor-parameters.js +28 -0
- package/build/require/type/constructor-parameters/index.js +27 -0
- package/build/require/type/date/date.d.ts +6 -0
- package/build/require/type/date/date.js +28 -0
- package/build/require/type/date/index.js +27 -0
- package/build/require/type/deref/deref.d.ts +1 -0
- package/build/require/type/deref/deref.js +45 -0
- package/build/require/type/deref/index.js +27 -0
- package/build/require/type/discard/discard.js +27 -0
- package/build/require/type/discard/index.js +27 -0
- package/build/require/type/enum/enum.d.ts +1 -0
- package/build/require/type/enum/enum.js +28 -0
- package/build/require/type/enum/index.js +27 -0
- package/build/require/type/exclude/exclude-from-mapped-result.js +30 -0
- package/build/require/type/exclude/exclude.d.ts +5 -3
- package/build/require/type/exclude/exclude.js +30 -0
- package/build/require/type/exclude/index.js +27 -0
- package/build/require/type/extends/extends-check.js +200 -1
- package/build/require/type/extends/extends-from-mapped-key.js +31 -0
- package/build/require/type/extends/extends-from-mapped-result.js +30 -0
- package/build/require/type/extends/extends-undefined.d.ts +1 -0
- package/build/require/type/extends/extends-undefined.js +30 -0
- package/build/require/type/extends/extends.d.ts +3 -0
- package/build/require/type/extends/extends.js +39 -5
- package/build/require/type/extends/index.js +27 -0
- package/build/require/type/extract/extract-from-mapped-result.js +30 -0
- package/build/require/type/extract/extract.d.ts +5 -3
- package/build/require/type/extract/extract.js +30 -0
- package/build/require/type/extract/index.js +27 -0
- package/build/require/type/function/function.d.ts +5 -4
- package/build/require/type/function/function.js +28 -0
- package/build/require/type/function/index.js +27 -0
- package/build/require/type/guard/index.js +27 -0
- package/build/require/type/guard/type.d.ts +46 -0
- package/build/require/type/guard/type.js +111 -1
- package/build/require/type/guard/value.d.ts +14 -0
- package/build/require/type/guard/value.js +41 -0
- package/build/require/type/helpers/helpers.d.ts +1 -0
- package/build/require/type/helpers/helpers.js +28 -0
- package/build/require/type/helpers/index.js +27 -0
- package/build/require/type/index.js +27 -0
- package/build/require/type/indexed/index.js +27 -0
- package/build/require/type/indexed/indexed-from-mapped-key.js +35 -1
- package/build/require/type/indexed/indexed-property-keys.d.ts +1 -0
- package/build/require/type/indexed/indexed-property-keys.js +36 -0
- package/build/require/type/indexed/indexed-result.d.ts +6 -6
- package/build/require/type/indexed/indexed-result.js +46 -4
- package/build/require/type/indexed/indexed.d.ts +3 -0
- package/build/require/type/indexed/indexed.js +37 -4
- package/build/require/type/instance-type/index.js +27 -0
- package/build/require/type/instance-type/instance-type.d.ts +1 -0
- package/build/require/type/instance-type/instance-type.js +28 -0
- package/build/require/type/integer/index.js +27 -0
- package/build/require/type/integer/integer.d.ts +1 -0
- package/build/require/type/integer/integer.js +28 -0
- package/build/require/type/intersect/index.d.ts +2 -0
- package/build/require/type/intersect/index.js +29 -0
- package/build/require/type/intersect/intersect-create.d.ts +3 -0
- package/build/require/type/intersect/intersect-create.js +51 -0
- package/build/require/type/intersect/intersect-evaluated.d.ts +17 -0
- package/build/require/type/intersect/intersect-evaluated.js +75 -0
- package/build/require/type/intersect/intersect-type.d.ts +15 -0
- package/build/require/type/intersect/intersect-type.js +30 -0
- package/build/require/type/intersect/intersect.d.ts +5 -20
- package/build/require/type/intersect/intersect.js +37 -18
- package/build/require/type/intrinsic/capitalize.d.ts +1 -0
- package/build/require/type/intrinsic/capitalize.js +28 -0
- package/build/require/type/intrinsic/index.js +27 -0
- package/build/require/type/intrinsic/intrinsic-from-mapped-key.js +31 -0
- package/build/require/type/intrinsic/intrinsic.d.ts +2 -0
- package/build/require/type/intrinsic/intrinsic.js +43 -1
- package/build/require/type/intrinsic/lowercase.d.ts +1 -0
- package/build/require/type/intrinsic/lowercase.js +28 -0
- package/build/require/type/intrinsic/uncapitalize.d.ts +1 -0
- package/build/require/type/intrinsic/uncapitalize.js +28 -0
- package/build/require/type/intrinsic/uppercase.d.ts +1 -0
- package/build/require/type/intrinsic/uppercase.js +28 -0
- package/build/require/type/iterator/index.js +27 -0
- package/build/require/type/iterator/iterator.d.ts +1 -0
- package/build/require/type/iterator/iterator.js +28 -0
- package/build/require/type/keyof/index.js +27 -0
- package/build/require/type/keyof/keyof-from-mapped-result.js +30 -0
- package/build/require/type/keyof/keyof-property-keys.d.ts +2 -0
- package/build/require/type/keyof/keyof-property-keys.js +47 -0
- package/build/require/type/keyof/keyof.d.ts +4 -2
- package/build/require/type/keyof/keyof.js +34 -1
- package/build/require/type/literal/index.js +27 -0
- package/build/require/type/literal/literal.d.ts +1 -0
- package/build/require/type/literal/literal.js +28 -0
- package/build/require/type/mapped/index.js +27 -0
- package/build/require/type/mapped/mapped-key.js +28 -0
- package/build/require/type/mapped/mapped-result.js +28 -0
- package/build/require/type/mapped/mapped.d.ts +2 -0
- package/build/require/type/mapped/mapped.js +63 -19
- package/build/require/type/modifiers/index.js +27 -0
- package/build/require/type/modifiers/modifiers.js +37 -0
- package/build/require/type/never/index.js +27 -0
- package/build/require/type/never/never.d.ts +1 -0
- package/build/require/type/never/never.js +28 -0
- package/build/require/type/not/index.js +27 -0
- package/build/require/type/not/not.d.ts +1 -0
- package/build/require/type/not/not.js +28 -0
- package/build/require/type/null/index.js +27 -0
- package/build/require/type/null/null.d.ts +1 -0
- package/build/require/type/null/null.js +28 -0
- package/build/require/type/number/index.js +27 -0
- package/build/require/type/number/number.d.ts +1 -0
- package/build/require/type/number/number.js +28 -0
- package/build/require/type/object/index.js +27 -0
- package/build/require/type/object/object.d.ts +10 -5
- package/build/require/type/object/object.js +33 -0
- package/build/require/type/omit/index.js +27 -0
- package/build/require/type/omit/omit-from-mapped-key.js +31 -0
- package/build/require/type/omit/omit.d.ts +3 -0
- package/build/require/type/omit/omit.js +39 -0
- package/build/require/type/operators/index.js +27 -0
- package/build/require/type/operators/operators.d.ts +8 -0
- package/build/require/type/operators/operators.js +42 -0
- package/build/require/type/optional/index.js +27 -0
- package/build/require/type/optional/optional.d.ts +1 -0
- package/build/require/type/optional/optional.js +28 -0
- package/build/require/type/parameters/index.js +27 -0
- package/build/require/type/parameters/parameters.d.ts +1 -0
- package/build/require/type/parameters/parameters.js +28 -0
- package/build/require/type/partial/index.js +27 -0
- package/build/require/type/partial/partial-from-mapped-result.js +30 -0
- package/build/require/type/partial/partial.d.ts +2 -0
- package/build/require/type/partial/partial.js +36 -0
- package/build/require/type/patterns/index.js +27 -0
- package/build/require/type/patterns/patterns.js +27 -0
- package/build/require/type/pick/index.js +27 -0
- package/build/require/type/pick/pick-from-mapped-key.js +31 -0
- package/build/require/type/pick/pick.d.ts +3 -0
- package/build/require/type/pick/pick.js +34 -0
- package/build/require/type/promise/index.js +27 -0
- package/build/require/type/promise/promise.d.ts +1 -0
- package/build/require/type/promise/promise.js +28 -0
- package/build/require/type/readonly/index.js +27 -0
- package/build/require/type/readonly/readonly.d.ts +1 -0
- package/build/require/type/readonly/readonly.js +28 -0
- package/build/require/type/readonly-optional/index.js +27 -0
- package/build/require/type/readonly-optional/readonly-optional.d.ts +1 -0
- package/build/require/type/readonly-optional/readonly-optional.js +28 -0
- package/build/require/type/record/index.js +27 -0
- package/build/require/type/record/record.d.ts +1 -1
- package/build/require/type/record/record.js +49 -2
- package/build/require/type/recursive/index.js +27 -0
- package/build/require/type/recursive/recursive.d.ts +4 -2
- package/build/require/type/recursive/recursive.js +31 -5
- package/build/require/type/ref/index.js +27 -0
- package/build/require/type/ref/ref.d.ts +2 -0
- package/build/require/type/ref/ref.js +28 -0
- package/build/require/type/regexp/index.js +27 -0
- package/build/require/type/regexp/regexp.d.ts +2 -0
- package/build/require/type/regexp/regexp.js +28 -0
- package/build/require/type/registry/format.d.ts +6 -0
- package/build/require/type/registry/format.js +34 -0
- package/build/require/type/registry/index.js +27 -0
- package/build/require/type/registry/type.d.ts +6 -0
- package/build/require/type/registry/type.js +34 -0
- package/build/require/type/required/index.js +27 -0
- package/build/require/type/required/required-from-mapped-result.js +30 -0
- package/build/require/type/required/required.d.ts +2 -0
- package/build/require/type/required/required.js +36 -0
- package/build/require/type/rest/index.js +27 -0
- package/build/require/type/rest/rest.d.ts +1 -0
- package/build/require/type/rest/rest.js +32 -0
- package/build/require/type/return-type/index.js +27 -0
- package/build/require/type/return-type/return-type.d.ts +1 -0
- package/build/require/type/return-type/return-type.js +28 -0
- package/build/require/type/schema/anyschema.js +27 -0
- package/build/require/type/schema/index.js +27 -0
- package/build/require/type/schema/schema.d.ts +7 -0
- package/build/require/type/schema/schema.js +27 -0
- package/build/require/type/static/index.js +27 -0
- package/build/require/type/static/static.d.ts +3 -0
- package/build/require/type/static/static.js +27 -0
- package/build/require/type/strict/index.js +27 -0
- package/build/require/type/strict/strict.d.ts +1 -0
- package/build/require/type/strict/strict.js +28 -0
- package/build/require/type/string/index.js +27 -0
- package/build/require/type/string/string.d.ts +7 -0
- package/build/require/type/string/string.js +28 -0
- package/build/require/type/symbol/index.js +27 -0
- package/build/require/type/symbol/symbol.d.ts +1 -0
- package/build/require/type/symbol/symbol.js +28 -0
- package/build/require/type/symbols/index.js +27 -0
- package/build/require/type/symbols/symbols.d.ts +5 -0
- package/build/require/type/symbols/symbols.js +32 -0
- package/build/require/type/template-literal/finite.js +37 -0
- package/build/require/type/template-literal/generate.js +37 -0
- package/build/require/type/template-literal/index.js +27 -0
- package/build/require/type/template-literal/parser.d.ts +2 -0
- package/build/require/type/template-literal/parser.js +44 -0
- package/build/require/type/template-literal/pattern.js +38 -0
- package/build/require/type/template-literal/syntax.d.ts +5 -4
- package/build/require/type/template-literal/syntax.js +35 -0
- package/build/require/type/template-literal/template-literal.d.ts +6 -4
- package/build/require/type/template-literal/template-literal.js +29 -0
- package/build/require/type/template-literal/union.d.ts +1 -0
- package/build/require/type/template-literal/union.js +31 -0
- package/build/require/type/transform/index.js +27 -0
- package/build/require/type/transform/transform.d.ts +4 -2
- package/build/require/type/transform/transform.js +40 -4
- package/build/require/type/tuple/index.js +27 -0
- package/build/require/type/tuple/tuple.d.ts +4 -3
- package/build/require/type/tuple/tuple.js +30 -0
- package/build/require/type/type/index.d.ts +1 -0
- package/build/require/type/type/index.js +34 -0
- package/build/require/type/type/javascript.d.ts +19 -0
- package/build/require/type/type/javascript.js +45 -0
- package/build/require/type/type/json.d.ts +66 -5
- package/build/require/type/type/json.js +82 -1
- package/build/require/type/type/type.js +30 -0
- package/build/require/type/uint8array/index.js +27 -0
- package/build/require/type/uint8array/uint8array.d.ts +1 -0
- package/build/require/type/uint8array/uint8array.js +28 -0
- package/build/require/type/undefined/index.js +27 -0
- package/build/require/type/undefined/undefined.d.ts +1 -0
- package/build/require/type/undefined/undefined.js +28 -0
- package/build/require/type/union/index.d.ts +2 -0
- package/build/require/type/union/index.js +29 -0
- package/build/require/type/union/union-create.d.ts +3 -0
- package/build/require/type/union/union-create.js +36 -0
- package/build/require/type/union/union-evaluated.d.ts +17 -0
- package/build/require/type/union/union-evaluated.js +72 -0
- package/build/require/type/union/union-type.d.ts +12 -0
- package/build/require/type/union/union-type.js +30 -0
- package/build/require/type/union/union.d.ts +4 -13
- package/build/require/type/union/union.js +32 -11
- package/build/require/type/unknown/index.js +27 -0
- package/build/require/type/unknown/unknown.d.ts +1 -0
- package/build/require/type/unknown/unknown.js +28 -0
- package/build/require/type/unsafe/index.js +27 -0
- package/build/require/type/unsafe/unsafe.d.ts +1 -0
- package/build/require/type/unsafe/unsafe.js +28 -0
- package/build/require/type/void/index.js +27 -0
- package/build/require/type/void/void.d.ts +1 -0
- package/build/require/type/void/void.js +28 -0
- package/build/require/value/cast/cast.d.ts +2 -0
- package/build/require/value/cast/cast.js +55 -0
- package/build/require/value/cast/index.js +27 -0
- package/build/require/value/check/check.d.ts +2 -0
- package/build/require/value/check/check.js +46 -1
- package/build/require/value/check/index.js +27 -0
- package/build/require/value/clean/clean.d.ts +2 -0
- package/build/require/value/clean/clean.js +39 -1
- package/build/require/value/clean/index.js +27 -0
- package/build/require/value/clone/clone.d.ts +1 -0
- package/build/require/value/clone/clone.js +34 -0
- package/build/require/value/clone/index.js +27 -0
- package/build/require/value/convert/convert.d.ts +2 -0
- package/build/require/value/convert/convert.js +57 -1
- package/build/require/value/convert/index.js +27 -0
- package/build/require/value/create/create.d.ts +2 -0
- package/build/require/value/create/create.js +44 -0
- package/build/require/value/create/index.js +27 -0
- package/build/require/value/default/default.d.ts +2 -0
- package/build/require/value/default/default.js +46 -0
- package/build/require/value/default/index.js +27 -0
- package/build/require/value/delta/delta.d.ts +1 -1
- package/build/require/value/delta/delta.js +42 -0
- package/build/require/value/delta/index.js +27 -0
- package/build/require/value/deref/deref.d.ts +1 -0
- package/build/require/value/deref/deref.js +28 -0
- package/build/require/value/deref/index.js +27 -0
- package/build/require/value/equal/equal.d.ts +1 -0
- package/build/require/value/equal/equal.js +34 -0
- package/build/require/value/equal/index.js +27 -0
- package/build/require/value/guard/guard.d.ts +20 -0
- package/build/require/value/guard/guard.js +57 -0
- package/build/require/value/guard/index.js +27 -0
- package/build/require/value/hash/hash.d.ts +1 -0
- package/build/require/value/hash/hash.js +46 -0
- package/build/require/value/hash/index.js +27 -0
- package/build/require/value/index.js +39 -0
- package/build/require/value/mutate/index.js +27 -0
- package/build/require/value/mutate/mutate.d.ts +1 -0
- package/build/require/value/mutate/mutate.js +38 -0
- package/build/require/value/pointer/index.js +27 -0
- package/build/require/value/pointer/pointer.d.ts +5 -0
- package/build/require/value/pointer/pointer.js +45 -0
- package/build/require/value/transform/decode.d.ts +5 -0
- package/build/require/value/transform/decode.js +50 -0
- package/build/require/value/transform/encode.d.ts +6 -0
- package/build/require/value/transform/encode.js +52 -0
- package/build/require/value/transform/has.d.ts +1 -0
- package/build/require/value/transform/has.js +43 -0
- package/build/require/value/transform/index.js +27 -0
- package/build/require/value/value/index.js +27 -0
- package/build/require/value/value/value.d.ts +24 -0
- package/build/require/value/value/value.js +42 -0
- package/package.json +1 -1
- package/readme.md +27 -20
package/build/require/index.js
CHANGED
|
@@ -1,7 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*--------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
@sinclair/typebox
|
|
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
|
+
---------------------------------------------------------------------------*/
|
|
2
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
30
|
+
exports.Lowercase = exports.Capitalize = exports.IntrinsicFromMappedKey = exports.Intrinsic = exports.Iterator = exports.IntersectEvaluated = exports.Intersect = exports.Integer = exports.InstanceType = exports.IndexFromMappedKey = exports.IndexPropertyKeys = exports.Index = exports.Increment = exports.Function = exports.Extract = exports.ExtendsUndefinedCheck = exports.ExtendsResult = exports.ExtendsCheck = exports.Extends = exports.Exclude = exports.Enum = exports.Deref = exports.Date = exports.ConstructorParameters = exports.Constructor = exports.Const = exports.Composite = exports.Boolean = exports.BigInt = exports.Awaited = exports.AsyncIterator = exports.Array = exports.Any = exports.CloneRest = exports.CloneType = exports.ValueGuard = exports.TypeGuard = exports.FormatRegistry = exports.TypeRegistry = exports.PatternStringExact = exports.PatternString = exports.PatternNumberExact = exports.PatternNumber = exports.PatternBooleanExact = exports.PatternBoolean = exports.TransformKind = exports.OptionalKind = exports.ReadonlyKind = exports.Hint = exports.Kind = void 0;
|
|
31
|
+
exports.Type = exports.Void = exports.Unsafe = exports.Unknown = exports.UnionEvaluated = exports.Union = exports.Undefined = exports.Uint8Array = exports.Tuple = exports.TransformEncodeBuilder = exports.TransformDecodeBuilder = exports.Transform = exports.TemplateLiteralGenerate = exports.TemplateLiteralParseExact = exports.TemplateLiteralParse = exports.IsTemplateLiteralFinite = exports.TemplateLiteral = exports.Symbol = exports.String = exports.Strict = exports.ReturnType = exports.Rest = exports.Required = exports.RegExp = exports.Ref = exports.Recursive = exports.Record = exports.ReadonlyOptional = exports.Readonly = exports.Promise = exports.Pick = exports.PartialFromMappedResult = exports.Partial = exports.Parameters = exports.Optional = exports.Omit = exports.Object = exports.Number = exports.Null = exports.Not = exports.Never = exports.MappedResult = exports.MappedKey = exports.Mapped = exports.Literal = exports.KeyOfPattern = exports.KeyOfPropertyKeys = exports.KeyOf = exports.Uppercase = exports.Uncapitalize = void 0;
|
|
32
|
+
exports.JavaScriptTypeBuilder = exports.JsonTypeBuilder = void 0;
|
|
33
|
+
// ------------------------------------------------------------------
|
|
34
|
+
// Infrastructure
|
|
35
|
+
// ------------------------------------------------------------------
|
|
5
36
|
var index_1 = require("./type/symbols/index");
|
|
6
37
|
Object.defineProperty(exports, "Kind", { enumerable: true, get: function () { return index_1.Kind; } });
|
|
7
38
|
Object.defineProperty(exports, "Hint", { enumerable: true, get: function () { return index_1.Hint; } });
|
|
@@ -24,6 +55,9 @@ Object.defineProperty(exports, "ValueGuard", { enumerable: true, get: function (
|
|
|
24
55
|
var type_1 = require("./type/clone/type");
|
|
25
56
|
Object.defineProperty(exports, "CloneType", { enumerable: true, get: function () { return type_1.CloneType; } });
|
|
26
57
|
Object.defineProperty(exports, "CloneRest", { enumerable: true, get: function () { return type_1.CloneRest; } });
|
|
58
|
+
// ------------------------------------------------------------------
|
|
59
|
+
// Type
|
|
60
|
+
// ------------------------------------------------------------------
|
|
27
61
|
var index_5 = require("./type/any/index");
|
|
28
62
|
Object.defineProperty(exports, "Any", { enumerable: true, get: function () { return index_5.Any; } });
|
|
29
63
|
var index_6 = require("./type/array/index");
|
|
@@ -73,6 +107,7 @@ var index_25 = require("./type/integer/index");
|
|
|
73
107
|
Object.defineProperty(exports, "Integer", { enumerable: true, get: function () { return index_25.Integer; } });
|
|
74
108
|
var index_26 = require("./type/intersect/index");
|
|
75
109
|
Object.defineProperty(exports, "Intersect", { enumerable: true, get: function () { return index_26.Intersect; } });
|
|
110
|
+
Object.defineProperty(exports, "IntersectEvaluated", { enumerable: true, get: function () { return index_26.IntersectEvaluated; } });
|
|
76
111
|
var index_27 = require("./type/iterator/index");
|
|
77
112
|
Object.defineProperty(exports, "Iterator", { enumerable: true, get: function () { return index_27.Iterator; } });
|
|
78
113
|
var index_28 = require("./type/intrinsic/index");
|
|
@@ -157,12 +192,16 @@ var index_59 = require("./type/undefined/index");
|
|
|
157
192
|
Object.defineProperty(exports, "Undefined", { enumerable: true, get: function () { return index_59.Undefined; } });
|
|
158
193
|
var index_60 = require("./type/union/index");
|
|
159
194
|
Object.defineProperty(exports, "Union", { enumerable: true, get: function () { return index_60.Union; } });
|
|
195
|
+
Object.defineProperty(exports, "UnionEvaluated", { enumerable: true, get: function () { return index_60.UnionEvaluated; } });
|
|
160
196
|
var index_61 = require("./type/unknown/index");
|
|
161
197
|
Object.defineProperty(exports, "Unknown", { enumerable: true, get: function () { return index_61.Unknown; } });
|
|
162
198
|
var index_62 = require("./type/unsafe/index");
|
|
163
199
|
Object.defineProperty(exports, "Unsafe", { enumerable: true, get: function () { return index_62.Unsafe; } });
|
|
164
200
|
var index_63 = require("./type/void/index");
|
|
165
201
|
Object.defineProperty(exports, "Void", { enumerable: true, get: function () { return index_63.Void; } });
|
|
202
|
+
// ------------------------------------------------------------------
|
|
203
|
+
// Namespace
|
|
204
|
+
// ------------------------------------------------------------------
|
|
166
205
|
var index_64 = require("./type/type/index");
|
|
167
206
|
Object.defineProperty(exports, "Type", { enumerable: true, get: function () { return index_64.Type; } });
|
|
168
207
|
Object.defineProperty(exports, "JsonTypeBuilder", { enumerable: true, get: function () { return index_64.JsonTypeBuilder; } });
|
|
@@ -1,4 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*--------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
@sinclair/typebox/system
|
|
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
|
+
---------------------------------------------------------------------------*/
|
|
2
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
30
|
exports.TypeSystemDuplicateTypeKind = exports.TypeSystemDuplicateFormat = exports.TypeSystem = exports.TypeSystemPolicy = void 0;
|
|
4
31
|
var policy_1 = require("./policy");
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
export declare namespace TypeSystemPolicy {
|
|
2
|
+
/** Shared assertion routines used by the value and errors modules */
|
|
3
|
+
/** Sets whether TypeBox should assert optional properties using the TypeScript `exactOptionalPropertyTypes` assertion policy. The default is `false` */
|
|
2
4
|
let ExactOptionalPropertyTypes: boolean;
|
|
5
|
+
/** Sets whether arrays should be treated as a kind of objects. The default is `false` */
|
|
3
6
|
let AllowArrayObject: boolean;
|
|
7
|
+
/** Sets whether `NaN` or `Infinity` should be treated as valid numeric values. The default is `false` */
|
|
4
8
|
let AllowNaN: boolean;
|
|
9
|
+
/** Sets whether `null` should validate for void types. The default is `false` */
|
|
5
10
|
let AllowNullVoid: boolean;
|
|
11
|
+
/** Asserts this value using the ExactOptionalPropertyTypes policy */
|
|
6
12
|
function IsExactOptionalProperty(value: Record<keyof any, unknown>, key: string): boolean;
|
|
13
|
+
/** Asserts this value using the AllowArrayObjects policy */
|
|
7
14
|
function IsObjectLike(value: unknown): value is Record<keyof any, unknown>;
|
|
15
|
+
/** Asserts this value as a record using the AllowArrayObjects policy */
|
|
8
16
|
function IsRecordLike(value: unknown): value is Record<keyof any, unknown>;
|
|
17
|
+
/** Asserts this value using the AllowNaN policy */
|
|
9
18
|
function IsNumberLike(value: unknown): value is number;
|
|
19
|
+
/** Asserts this value using the AllowVoidNull policy */
|
|
10
20
|
function IsVoidLike(value: unknown): value is void;
|
|
11
21
|
}
|
|
@@ -1,31 +1,71 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*--------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
@sinclair/typebox/system
|
|
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
|
+
---------------------------------------------------------------------------*/
|
|
2
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
30
|
exports.TypeSystemPolicy = void 0;
|
|
4
31
|
const index_1 = require("../value/guard/index");
|
|
5
32
|
var TypeSystemPolicy;
|
|
6
33
|
(function (TypeSystemPolicy) {
|
|
34
|
+
// ------------------------------------------------------------------
|
|
35
|
+
// TypeSystemPolicy
|
|
36
|
+
// ------------------------------------------------------------------
|
|
37
|
+
/** Shared assertion routines used by the value and errors modules */
|
|
38
|
+
/** Sets whether TypeBox should assert optional properties using the TypeScript `exactOptionalPropertyTypes` assertion policy. The default is `false` */
|
|
7
39
|
TypeSystemPolicy.ExactOptionalPropertyTypes = false;
|
|
40
|
+
/** Sets whether arrays should be treated as a kind of objects. The default is `false` */
|
|
8
41
|
TypeSystemPolicy.AllowArrayObject = false;
|
|
42
|
+
/** Sets whether `NaN` or `Infinity` should be treated as valid numeric values. The default is `false` */
|
|
9
43
|
TypeSystemPolicy.AllowNaN = false;
|
|
44
|
+
/** Sets whether `null` should validate for void types. The default is `false` */
|
|
10
45
|
TypeSystemPolicy.AllowNullVoid = false;
|
|
46
|
+
/** Asserts this value using the ExactOptionalPropertyTypes policy */
|
|
11
47
|
function IsExactOptionalProperty(value, key) {
|
|
12
48
|
return TypeSystemPolicy.ExactOptionalPropertyTypes ? key in value : value[key] !== undefined;
|
|
13
49
|
}
|
|
14
50
|
TypeSystemPolicy.IsExactOptionalProperty = IsExactOptionalProperty;
|
|
51
|
+
/** Asserts this value using the AllowArrayObjects policy */
|
|
15
52
|
function IsObjectLike(value) {
|
|
16
53
|
const isObject = (0, index_1.IsObject)(value);
|
|
17
54
|
return TypeSystemPolicy.AllowArrayObject ? isObject : isObject && !(0, index_1.IsArray)(value);
|
|
18
55
|
}
|
|
19
56
|
TypeSystemPolicy.IsObjectLike = IsObjectLike;
|
|
57
|
+
/** Asserts this value as a record using the AllowArrayObjects policy */
|
|
20
58
|
function IsRecordLike(value) {
|
|
21
59
|
return IsObjectLike(value) && !(value instanceof Date) && !(value instanceof Uint8Array);
|
|
22
60
|
}
|
|
23
61
|
TypeSystemPolicy.IsRecordLike = IsRecordLike;
|
|
62
|
+
/** Asserts this value using the AllowNaN policy */
|
|
24
63
|
function IsNumberLike(value) {
|
|
25
64
|
const isNumber = (0, index_1.IsNumber)(value);
|
|
26
65
|
return TypeSystemPolicy.AllowNaN ? isNumber : isNumber && Number.isFinite(value);
|
|
27
66
|
}
|
|
28
67
|
TypeSystemPolicy.IsNumberLike = IsNumberLike;
|
|
68
|
+
/** Asserts this value using the AllowVoidNull policy */
|
|
29
69
|
function IsVoidLike(value) {
|
|
30
70
|
const isUndefined = (0, index_1.IsUndefined)(value);
|
|
31
71
|
return TypeSystemPolicy.AllowNullVoid ? isUndefined || value === null : isUndefined;
|
|
@@ -4,7 +4,10 @@ export declare class TypeSystemDuplicateTypeKind extends Error {
|
|
|
4
4
|
export declare class TypeSystemDuplicateFormat extends Error {
|
|
5
5
|
constructor(kind: string);
|
|
6
6
|
}
|
|
7
|
+
/** Creates user defined types and formats and provides overrides for value checking behaviours */
|
|
7
8
|
export declare namespace TypeSystem {
|
|
9
|
+
/** Creates a new type */
|
|
8
10
|
function Type<Type, Options = Record<PropertyKey, unknown>>(kind: string, check: (options: Options, value: unknown) => boolean): (options?: Partial<Options>) => import("../type/unsafe/unsafe").TUnsafe<Type>;
|
|
11
|
+
/** Creates a new string format */
|
|
9
12
|
function Format<F extends string>(format: F, check: (value: string) => boolean): F;
|
|
10
13
|
}
|
|
@@ -1,9 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*--------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
@sinclair/typebox/system
|
|
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
|
+
---------------------------------------------------------------------------*/
|
|
2
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
30
|
exports.TypeSystem = exports.TypeSystemDuplicateFormat = exports.TypeSystemDuplicateTypeKind = void 0;
|
|
4
31
|
const index_1 = require("../type/registry/index");
|
|
5
32
|
const index_2 = require("../type/unsafe/index");
|
|
6
33
|
const index_3 = require("../type/symbols/index");
|
|
34
|
+
// ------------------------------------------------------------------
|
|
35
|
+
// Errors
|
|
36
|
+
// ------------------------------------------------------------------
|
|
7
37
|
class TypeSystemDuplicateTypeKind extends Error {
|
|
8
38
|
constructor(kind) {
|
|
9
39
|
super(`Duplicate type kind '${kind}' detected`);
|
|
@@ -16,8 +46,13 @@ class TypeSystemDuplicateFormat extends Error {
|
|
|
16
46
|
}
|
|
17
47
|
}
|
|
18
48
|
exports.TypeSystemDuplicateFormat = TypeSystemDuplicateFormat;
|
|
49
|
+
// ------------------------------------------------------------------
|
|
50
|
+
// TypeSystem
|
|
51
|
+
// ------------------------------------------------------------------
|
|
52
|
+
/** Creates user defined types and formats and provides overrides for value checking behaviours */
|
|
19
53
|
var TypeSystem;
|
|
20
54
|
(function (TypeSystem) {
|
|
55
|
+
/** Creates a new type */
|
|
21
56
|
function Type(kind, check) {
|
|
22
57
|
if (index_1.TypeRegistry.Has(kind))
|
|
23
58
|
throw new TypeSystemDuplicateTypeKind(kind);
|
|
@@ -25,6 +60,7 @@ var TypeSystem;
|
|
|
25
60
|
return (options = {}) => (0, index_2.Unsafe)({ ...options, [index_3.Kind]: kind });
|
|
26
61
|
}
|
|
27
62
|
TypeSystem.Type = Type;
|
|
63
|
+
/** Creates a new string format */
|
|
28
64
|
function Format(format, check) {
|
|
29
65
|
if (index_1.FormatRegistry.Has(format))
|
|
30
66
|
throw new TypeSystemDuplicateFormat(format);
|
|
@@ -1,7 +1,35 @@
|
|
|
1
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
|
+
---------------------------------------------------------------------------*/
|
|
2
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
30
|
exports.Any = void 0;
|
|
4
31
|
const index_1 = require("../symbols/index");
|
|
32
|
+
/** `[Json]` Creates an Any type */
|
|
5
33
|
function Any(options = {}) {
|
|
6
34
|
return { ...options, [index_1.Kind]: 'Any' };
|
|
7
35
|
}
|
|
@@ -1,4 +1,31 @@
|
|
|
1
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
|
+
---------------------------------------------------------------------------*/
|
|
2
29
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
30
|
if (k2 === undefined) k2 = k;
|
|
4
31
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -2,17 +2,24 @@ import type { TSchema, SchemaOptions } from '../schema/index';
|
|
|
2
2
|
import type { Static } from '../static/index';
|
|
3
3
|
import { Kind } from '../symbols/index';
|
|
4
4
|
export interface ArrayOptions extends SchemaOptions {
|
|
5
|
+
/** The minimum number of items in this array */
|
|
5
6
|
minItems?: number;
|
|
7
|
+
/** The maximum number of items in this array */
|
|
6
8
|
maxItems?: number;
|
|
9
|
+
/** Should this schema contain unique items */
|
|
7
10
|
uniqueItems?: boolean;
|
|
11
|
+
/** A schema for which some elements should match */
|
|
8
12
|
contains?: TSchema;
|
|
13
|
+
/** A minimum number of contains schema matches */
|
|
9
14
|
minContains?: number;
|
|
15
|
+
/** A maximum number of contains schema matches */
|
|
10
16
|
maxContains?: number;
|
|
11
17
|
}
|
|
12
18
|
export interface TArray<T extends TSchema = TSchema> extends TSchema, ArrayOptions {
|
|
13
19
|
[Kind]: 'Array';
|
|
14
|
-
static: Static<T, this['params']
|
|
20
|
+
static: Array<Static<T, this['params']>>;
|
|
15
21
|
type: 'array';
|
|
16
22
|
items: T;
|
|
17
23
|
}
|
|
24
|
+
/** `[Json]` Creates an Array type */
|
|
18
25
|
export declare function Array<T extends TSchema>(schema: T, options?: ArrayOptions): TArray<T>;
|
|
@@ -1,8 +1,36 @@
|
|
|
1
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
|
+
---------------------------------------------------------------------------*/
|
|
2
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
30
|
exports.Array = void 0;
|
|
4
31
|
const index_1 = require("../symbols/index");
|
|
5
32
|
const type_1 = require("../clone/type");
|
|
33
|
+
/** `[Json]` Creates an Array type */
|
|
6
34
|
function Array(schema, options = {}) {
|
|
7
35
|
return {
|
|
8
36
|
...options,
|
|
@@ -1,4 +1,31 @@
|
|
|
1
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
|
+
---------------------------------------------------------------------------*/
|
|
2
29
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
30
|
if (k2 === undefined) k2 = k;
|
|
4
31
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -7,4 +7,5 @@ export interface TAsyncIterator<T extends TSchema = TSchema> extends TSchema {
|
|
|
7
7
|
type: 'AsyncIterator';
|
|
8
8
|
items: T;
|
|
9
9
|
}
|
|
10
|
+
/** `[JavaScript]` Creates a AsyncIterator type */
|
|
10
11
|
export declare function AsyncIterator<T extends TSchema>(items: T, options?: SchemaOptions): TAsyncIterator<T>;
|
|
@@ -1,8 +1,36 @@
|
|
|
1
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
|
+
---------------------------------------------------------------------------*/
|
|
2
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
30
|
exports.AsyncIterator = void 0;
|
|
4
31
|
const index_1 = require("../symbols/index");
|
|
5
32
|
const type_1 = require("../clone/type");
|
|
33
|
+
/** `[JavaScript]` Creates a AsyncIterator type */
|
|
6
34
|
function AsyncIterator(items, options = {}) {
|
|
7
35
|
return {
|
|
8
36
|
...options,
|
|
@@ -1,4 +1,31 @@
|
|
|
1
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
|
+
---------------------------------------------------------------------------*/
|
|
2
29
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
30
|
if (k2 === undefined) k2 = k;
|
|
4
31
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -7,5 +7,6 @@ declare function AwaitedUnwrap<T extends TSchema[]>(T: [...T]): AwaitedUnwrap<T>
|
|
|
7
7
|
export type AwaitedResolve<T extends TSchema> = T extends TIntersect<infer S> ? TIntersect<AwaitedUnwrap<S>> : T extends TUnion<infer S> ? TUnion<AwaitedUnwrap<S>> : T extends TPromise<infer S> ? AwaitedResolve<S> : T;
|
|
8
8
|
export declare function Resolve<T extends TSchema>(T: T): AwaitedResolve<T>;
|
|
9
9
|
export type TAwaited<T extends TSchema> = AwaitedResolve<T>;
|
|
10
|
+
/** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */
|
|
10
11
|
export declare function Awaited<T extends TSchema>(T: T, options?: SchemaOptions): AwaitedResolve<T>;
|
|
11
12
|
export {};
|
|
@@ -1,25 +1,61 @@
|
|
|
1
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
|
+
---------------------------------------------------------------------------*/
|
|
2
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
30
|
exports.Awaited = exports.Resolve = void 0;
|
|
4
31
|
const index_1 = require("../intersect/index");
|
|
5
32
|
const index_2 = require("../union/index");
|
|
6
33
|
const type_1 = require("../clone/type");
|
|
34
|
+
// ------------------------------------------------------------------
|
|
35
|
+
// TypeGuard
|
|
36
|
+
// ------------------------------------------------------------------
|
|
37
|
+
// prettier-ignore
|
|
7
38
|
const type_2 = require("../guard/type");
|
|
39
|
+
// prettier-ignore
|
|
8
40
|
function AwaitedUnwrap(T) {
|
|
9
41
|
const [L, ...R] = T;
|
|
10
42
|
return (T.length > 0
|
|
11
43
|
? [Resolve(L), ...AwaitedUnwrap(R)]
|
|
12
44
|
: []);
|
|
13
45
|
}
|
|
46
|
+
// prettier-ignore
|
|
14
47
|
function AwaitedIntersectRest(T) {
|
|
15
48
|
return (0, index_1.Intersect)(AwaitedUnwrap(T));
|
|
16
49
|
}
|
|
50
|
+
// prettier-ignore
|
|
17
51
|
function AwaitedUnionRest(T) {
|
|
18
52
|
return (0, index_2.Union)(AwaitedUnwrap(T));
|
|
19
53
|
}
|
|
54
|
+
// prettier-ignore
|
|
20
55
|
function AwaitedPromise(T) {
|
|
21
56
|
return Resolve(T);
|
|
22
57
|
}
|
|
58
|
+
// prettier-ignore
|
|
23
59
|
function Resolve(T) {
|
|
24
60
|
return ((0, type_2.TIntersect)(T) ? AwaitedIntersectRest(T.allOf) :
|
|
25
61
|
(0, type_2.TUnion)(T) ? AwaitedUnionRest(T.anyOf) :
|
|
@@ -27,6 +63,7 @@ function Resolve(T) {
|
|
|
27
63
|
T);
|
|
28
64
|
}
|
|
29
65
|
exports.Resolve = Resolve;
|
|
66
|
+
/** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */
|
|
30
67
|
function Awaited(T, options = {}) {
|
|
31
68
|
return (0, type_1.CloneType)(Resolve(T), options);
|
|
32
69
|
}
|
|
@@ -1,4 +1,31 @@
|
|
|
1
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
|
+
---------------------------------------------------------------------------*/
|
|
2
29
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
30
|
if (k2 === undefined) k2 = k;
|
|
4
31
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|