@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
|
@@ -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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
30
|
exports.TSchema = exports.TKind = exports.TVoid = exports.TUnsafe = exports.TUnknown = exports.TUint8Array = exports.TUnion = exports.TUnionLiteral = exports.TUndefined = exports.TTuple = exports.TTransform = exports.TThis = exports.TTemplateLiteral = exports.TSymbol = exports.TString = exports.TRef = exports.TRecursive = exports.TRecord = exports.TPromise = exports.TObject = exports.TNumber = exports.TNull = exports.TNot = exports.TNever = exports.TMappedResult = exports.TMappedKey = exports.TLiteralValue = exports.TLiteral = exports.TLiteralBoolean = exports.TLiteralNumber = exports.TLiteralString = exports.TKindOf = exports.TIterator = exports.TIntersect = exports.TProperties = exports.TInteger = exports.TFunction = exports.TDate = exports.TConstructor = exports.TBoolean = exports.TBigInt = exports.TAsyncIterator = exports.TArray = exports.TAny = exports.TOptional = exports.TReadonly = exports.TypeGuardUnknownTypeError = void 0;
|
|
4
31
|
const ValueGuard = require("./value");
|
|
@@ -84,19 +111,30 @@ function IsOptionalFormat(value) {
|
|
|
84
111
|
function IsOptionalSchema(value) {
|
|
85
112
|
return ValueGuard.IsUndefined(value) || (0, index_2.TSchema)(value);
|
|
86
113
|
}
|
|
114
|
+
// ------------------------------------------------------------------
|
|
115
|
+
// Modifiers
|
|
116
|
+
// ------------------------------------------------------------------
|
|
117
|
+
/** Returns true if this value has a Readonly symbol */
|
|
87
118
|
function TReadonly(value) {
|
|
88
119
|
return ValueGuard.IsObject(value) && value[index_1.ReadonlyKind] === 'Readonly';
|
|
89
120
|
}
|
|
90
121
|
exports.TReadonly = TReadonly;
|
|
122
|
+
/** Returns true if this value has a Optional symbol */
|
|
91
123
|
function TOptional(value) {
|
|
92
124
|
return ValueGuard.IsObject(value) && value[index_1.OptionalKind] === 'Optional';
|
|
93
125
|
}
|
|
94
126
|
exports.TOptional = TOptional;
|
|
127
|
+
// ------------------------------------------------------------------
|
|
128
|
+
// Types
|
|
129
|
+
// ------------------------------------------------------------------
|
|
130
|
+
/** Returns true if the given value is TAny */
|
|
95
131
|
function TAny(value) {
|
|
132
|
+
// prettier-ignore
|
|
96
133
|
return (TKindOf(value, 'Any') &&
|
|
97
134
|
IsOptionalString(value.$id));
|
|
98
135
|
}
|
|
99
136
|
exports.TAny = TAny;
|
|
137
|
+
/** Returns true if the given value is TArray */
|
|
100
138
|
function TArray(value) {
|
|
101
139
|
return (TKindOf(value, 'Array') &&
|
|
102
140
|
value.type === 'array' &&
|
|
@@ -110,14 +148,18 @@ function TArray(value) {
|
|
|
110
148
|
IsOptionalNumber(value.maxContains));
|
|
111
149
|
}
|
|
112
150
|
exports.TArray = TArray;
|
|
151
|
+
/** Returns true if the given value is TAsyncIterator */
|
|
113
152
|
function TAsyncIterator(value) {
|
|
153
|
+
// prettier-ignore
|
|
114
154
|
return (TKindOf(value, 'AsyncIterator') &&
|
|
115
155
|
value.type === 'AsyncIterator' &&
|
|
116
156
|
IsOptionalString(value.$id) &&
|
|
117
157
|
(0, index_2.TSchema)(value.items));
|
|
118
158
|
}
|
|
119
159
|
exports.TAsyncIterator = TAsyncIterator;
|
|
160
|
+
/** Returns true if the given value is TBigInt */
|
|
120
161
|
function TBigInt(value) {
|
|
162
|
+
// prettier-ignore
|
|
121
163
|
return (TKindOf(value, 'BigInt') &&
|
|
122
164
|
value.type === 'bigint' &&
|
|
123
165
|
IsOptionalString(value.$id) &&
|
|
@@ -128,13 +170,17 @@ function TBigInt(value) {
|
|
|
128
170
|
IsOptionalBigInt(value.multipleOf));
|
|
129
171
|
}
|
|
130
172
|
exports.TBigInt = TBigInt;
|
|
173
|
+
/** Returns true if the given value is TBoolean */
|
|
131
174
|
function TBoolean(value) {
|
|
175
|
+
// prettier-ignore
|
|
132
176
|
return (TKindOf(value, 'Boolean') &&
|
|
133
177
|
value.type === 'boolean' &&
|
|
134
178
|
IsOptionalString(value.$id));
|
|
135
179
|
}
|
|
136
180
|
exports.TBoolean = TBoolean;
|
|
181
|
+
/** Returns true if the given value is TConstructor */
|
|
137
182
|
function TConstructor(value) {
|
|
183
|
+
// prettier-ignore
|
|
138
184
|
return (TKindOf(value, 'Constructor') &&
|
|
139
185
|
value.type === 'Constructor' &&
|
|
140
186
|
IsOptionalString(value.$id) &&
|
|
@@ -143,6 +189,7 @@ function TConstructor(value) {
|
|
|
143
189
|
(0, index_2.TSchema)(value.returns));
|
|
144
190
|
}
|
|
145
191
|
exports.TConstructor = TConstructor;
|
|
192
|
+
/** Returns true if the given value is TDate */
|
|
146
193
|
function TDate(value) {
|
|
147
194
|
return (TKindOf(value, 'Date') &&
|
|
148
195
|
value.type === 'Date' &&
|
|
@@ -154,7 +201,9 @@ function TDate(value) {
|
|
|
154
201
|
IsOptionalNumber(value.multipleOfTimestamp));
|
|
155
202
|
}
|
|
156
203
|
exports.TDate = TDate;
|
|
204
|
+
/** Returns true if the given value is TFunction */
|
|
157
205
|
function TFunction(value) {
|
|
206
|
+
// prettier-ignore
|
|
158
207
|
return (TKindOf(value, 'Function') &&
|
|
159
208
|
value.type === 'Function' &&
|
|
160
209
|
IsOptionalString(value.$id) &&
|
|
@@ -163,6 +212,7 @@ function TFunction(value) {
|
|
|
163
212
|
(0, index_2.TSchema)(value.returns));
|
|
164
213
|
}
|
|
165
214
|
exports.TFunction = TFunction;
|
|
215
|
+
/** Returns true if the given value is TInteger */
|
|
166
216
|
function TInteger(value) {
|
|
167
217
|
return (TKindOf(value, 'Integer') &&
|
|
168
218
|
value.type === 'integer' &&
|
|
@@ -174,12 +224,16 @@ function TInteger(value) {
|
|
|
174
224
|
IsOptionalNumber(value.multipleOf));
|
|
175
225
|
}
|
|
176
226
|
exports.TInteger = TInteger;
|
|
227
|
+
/** Returns true if the given schema is TProperties */
|
|
177
228
|
function TProperties(value) {
|
|
229
|
+
// prettier-ignore
|
|
178
230
|
return (ValueGuard.IsObject(value) &&
|
|
179
231
|
Object.entries(value).every(([key, schema]) => IsControlCharacterFree(key) && (0, index_2.TSchema)(schema)));
|
|
180
232
|
}
|
|
181
233
|
exports.TProperties = TProperties;
|
|
234
|
+
/** Returns true if the given value is TIntersect */
|
|
182
235
|
function TIntersect(value) {
|
|
236
|
+
// prettier-ignore
|
|
183
237
|
return (TKindOf(value, 'Intersect') &&
|
|
184
238
|
(ValueGuard.IsString(value.type) && value.type !== 'object' ? false : true) &&
|
|
185
239
|
ValueGuard.IsArray(value.allOf) &&
|
|
@@ -189,66 +243,86 @@ function TIntersect(value) {
|
|
|
189
243
|
IsOptionalString(value.$id));
|
|
190
244
|
}
|
|
191
245
|
exports.TIntersect = TIntersect;
|
|
246
|
+
/** Returns true if the given value is TIterator */
|
|
192
247
|
function TIterator(value) {
|
|
248
|
+
// prettier-ignore
|
|
193
249
|
return (TKindOf(value, 'Iterator') &&
|
|
194
250
|
value.type === 'Iterator' &&
|
|
195
251
|
IsOptionalString(value.$id) &&
|
|
196
252
|
(0, index_2.TSchema)(value.items));
|
|
197
253
|
}
|
|
198
254
|
exports.TIterator = TIterator;
|
|
255
|
+
/** Returns true if the given value is a TKind with the given name. */
|
|
199
256
|
function TKindOf(value, kind) {
|
|
200
257
|
return ValueGuard.IsObject(value) && index_1.Kind in value && value[index_1.Kind] === kind;
|
|
201
258
|
}
|
|
202
259
|
exports.TKindOf = TKindOf;
|
|
260
|
+
/** Returns true if the given value is TLiteral<string> */
|
|
203
261
|
function TLiteralString(value) {
|
|
204
262
|
return (0, index_3.TLiteral)(value) && ValueGuard.IsString(value.const);
|
|
205
263
|
}
|
|
206
264
|
exports.TLiteralString = TLiteralString;
|
|
265
|
+
/** Returns true if the given value is TLiteral<number> */
|
|
207
266
|
function TLiteralNumber(value) {
|
|
208
267
|
return (0, index_3.TLiteral)(value) && ValueGuard.IsNumber(value.const);
|
|
209
268
|
}
|
|
210
269
|
exports.TLiteralNumber = TLiteralNumber;
|
|
270
|
+
/** Returns true if the given value is TLiteral<boolean> */
|
|
211
271
|
function TLiteralBoolean(value) {
|
|
212
272
|
return (0, index_3.TLiteral)(value) && ValueGuard.IsBoolean(value.const);
|
|
213
273
|
}
|
|
214
274
|
exports.TLiteralBoolean = TLiteralBoolean;
|
|
275
|
+
/** Returns true if the given value is TLiteral */
|
|
215
276
|
function TLiteral(value) {
|
|
277
|
+
// prettier-ignore
|
|
216
278
|
return (TKindOf(value, 'Literal') &&
|
|
217
279
|
IsOptionalString(value.$id) && (0, index_3.TLiteralValue)(value.const));
|
|
218
280
|
}
|
|
219
281
|
exports.TLiteral = TLiteral;
|
|
282
|
+
/** Returns true if the given value is a TLiteralValue */
|
|
220
283
|
function TLiteralValue(value) {
|
|
221
284
|
return ValueGuard.IsBoolean(value) || ValueGuard.IsNumber(value) || ValueGuard.IsString(value);
|
|
222
285
|
}
|
|
223
286
|
exports.TLiteralValue = TLiteralValue;
|
|
287
|
+
/** Returns true if the given value is a TMappedKey */
|
|
224
288
|
function TMappedKey(value) {
|
|
289
|
+
// prettier-ignore
|
|
225
290
|
return (TKindOf(value, 'MappedKey') &&
|
|
226
291
|
ValueGuard.IsArray(value.keys) &&
|
|
227
292
|
value.keys.every(key => ValueGuard.IsNumber(key) || ValueGuard.IsString(key)));
|
|
228
293
|
}
|
|
229
294
|
exports.TMappedKey = TMappedKey;
|
|
295
|
+
/** Returns true if the given value is TMappedResult */
|
|
230
296
|
function TMappedResult(value) {
|
|
297
|
+
// prettier-ignore
|
|
231
298
|
return (TKindOf(value, 'MappedResult') &&
|
|
232
299
|
(0, index_4.TProperties)(value.properties));
|
|
233
300
|
}
|
|
234
301
|
exports.TMappedResult = TMappedResult;
|
|
302
|
+
/** Returns true if the given value is TNever */
|
|
235
303
|
function TNever(value) {
|
|
304
|
+
// prettier-ignore
|
|
236
305
|
return (TKindOf(value, 'Never') &&
|
|
237
306
|
ValueGuard.IsObject(value.not) &&
|
|
238
307
|
Object.getOwnPropertyNames(value.not).length === 0);
|
|
239
308
|
}
|
|
240
309
|
exports.TNever = TNever;
|
|
310
|
+
/** Returns true if the given value is TNot */
|
|
241
311
|
function TNot(value) {
|
|
312
|
+
// prettier-ignore
|
|
242
313
|
return (TKindOf(value, 'Not') &&
|
|
243
314
|
(0, index_2.TSchema)(value.not));
|
|
244
315
|
}
|
|
245
316
|
exports.TNot = TNot;
|
|
317
|
+
/** Returns true if the given value is TNull */
|
|
246
318
|
function TNull(value) {
|
|
319
|
+
// prettier-ignore
|
|
247
320
|
return (TKindOf(value, 'Null') &&
|
|
248
321
|
value.type === 'null' &&
|
|
249
322
|
IsOptionalString(value.$id));
|
|
250
323
|
}
|
|
251
324
|
exports.TNull = TNull;
|
|
325
|
+
/** Returns true if the given value is TNumber */
|
|
252
326
|
function TNumber(value) {
|
|
253
327
|
return (TKindOf(value, 'Number') &&
|
|
254
328
|
value.type === 'number' &&
|
|
@@ -260,7 +334,9 @@ function TNumber(value) {
|
|
|
260
334
|
IsOptionalNumber(value.multipleOf));
|
|
261
335
|
}
|
|
262
336
|
exports.TNumber = TNumber;
|
|
337
|
+
/** Returns true if the given value is TObject */
|
|
263
338
|
function TObject(value) {
|
|
339
|
+
// prettier-ignore
|
|
264
340
|
return (TKindOf(value, 'Object') &&
|
|
265
341
|
value.type === 'object' &&
|
|
266
342
|
IsOptionalString(value.$id) &&
|
|
@@ -270,14 +346,18 @@ function TObject(value) {
|
|
|
270
346
|
IsOptionalNumber(value.maxProperties));
|
|
271
347
|
}
|
|
272
348
|
exports.TObject = TObject;
|
|
349
|
+
/** Returns true if the given value is TPromise */
|
|
273
350
|
function TPromise(value) {
|
|
351
|
+
// prettier-ignore
|
|
274
352
|
return (TKindOf(value, 'Promise') &&
|
|
275
353
|
value.type === 'Promise' &&
|
|
276
354
|
IsOptionalString(value.$id) &&
|
|
277
355
|
(0, index_2.TSchema)(value.item));
|
|
278
356
|
}
|
|
279
357
|
exports.TPromise = TPromise;
|
|
358
|
+
/** Returns true if the given value is TRecord */
|
|
280
359
|
function TRecord(value) {
|
|
360
|
+
// prettier-ignore
|
|
281
361
|
return (TKindOf(value, 'Record') &&
|
|
282
362
|
value.type === 'object' &&
|
|
283
363
|
IsOptionalString(value.$id) &&
|
|
@@ -292,17 +372,22 @@ function TRecord(value) {
|
|
|
292
372
|
})(value));
|
|
293
373
|
}
|
|
294
374
|
exports.TRecord = TRecord;
|
|
375
|
+
/** Returns true if this value is TRecursive */
|
|
295
376
|
function TRecursive(value) {
|
|
296
377
|
return ValueGuard.IsObject(value) && index_1.Hint in value && value[index_1.Hint] === 'Recursive';
|
|
297
378
|
}
|
|
298
379
|
exports.TRecursive = TRecursive;
|
|
380
|
+
/** Returns true if the given value is TRef */
|
|
299
381
|
function TRef(value) {
|
|
382
|
+
// prettier-ignore
|
|
300
383
|
return (TKindOf(value, 'Ref') &&
|
|
301
384
|
IsOptionalString(value.$id) &&
|
|
302
385
|
ValueGuard.IsString(value.$ref));
|
|
303
386
|
}
|
|
304
387
|
exports.TRef = TRef;
|
|
388
|
+
/** Returns true if the given value is TString */
|
|
305
389
|
function TString(value) {
|
|
390
|
+
// prettier-ignore
|
|
306
391
|
return (TKindOf(value, 'String') &&
|
|
307
392
|
value.type === 'string' &&
|
|
308
393
|
IsOptionalString(value.$id) &&
|
|
@@ -312,13 +397,17 @@ function TString(value) {
|
|
|
312
397
|
IsOptionalFormat(value.format));
|
|
313
398
|
}
|
|
314
399
|
exports.TString = TString;
|
|
400
|
+
/** Returns true if the given value is TSymbol */
|
|
315
401
|
function TSymbol(value) {
|
|
402
|
+
// prettier-ignore
|
|
316
403
|
return (TKindOf(value, 'Symbol') &&
|
|
317
404
|
value.type === 'symbol' &&
|
|
318
405
|
IsOptionalString(value.$id));
|
|
319
406
|
}
|
|
320
407
|
exports.TSymbol = TSymbol;
|
|
408
|
+
/** Returns true if the given value is TTemplateLiteral */
|
|
321
409
|
function TTemplateLiteral(value) {
|
|
410
|
+
// prettier-ignore
|
|
322
411
|
return (TKindOf(value, 'TemplateLiteral') &&
|
|
323
412
|
value.type === 'string' &&
|
|
324
413
|
ValueGuard.IsString(value.pattern) &&
|
|
@@ -326,40 +415,51 @@ function TTemplateLiteral(value) {
|
|
|
326
415
|
value.pattern[value.pattern.length - 1] === '$');
|
|
327
416
|
}
|
|
328
417
|
exports.TTemplateLiteral = TTemplateLiteral;
|
|
418
|
+
/** Returns true if the given value is TThis */
|
|
329
419
|
function TThis(value) {
|
|
420
|
+
// prettier-ignore
|
|
330
421
|
return (TKindOf(value, 'This') &&
|
|
331
422
|
IsOptionalString(value.$id) &&
|
|
332
423
|
ValueGuard.IsString(value.$ref));
|
|
333
424
|
}
|
|
334
425
|
exports.TThis = TThis;
|
|
426
|
+
/** Returns true of this value is TTransform */
|
|
335
427
|
function TTransform(value) {
|
|
336
428
|
return ValueGuard.IsObject(value) && index_1.TransformKind in value;
|
|
337
429
|
}
|
|
338
430
|
exports.TTransform = TTransform;
|
|
431
|
+
/** Returns true if the given value is TTuple */
|
|
339
432
|
function TTuple(value) {
|
|
433
|
+
// prettier-ignore
|
|
340
434
|
return (TKindOf(value, 'Tuple') &&
|
|
341
435
|
value.type === 'array' &&
|
|
342
436
|
IsOptionalString(value.$id) &&
|
|
343
437
|
ValueGuard.IsNumber(value.minItems) &&
|
|
344
438
|
ValueGuard.IsNumber(value.maxItems) &&
|
|
345
439
|
value.minItems === value.maxItems &&
|
|
346
|
-
((
|
|
440
|
+
(( // empty
|
|
441
|
+
ValueGuard.IsUndefined(value.items) &&
|
|
347
442
|
ValueGuard.IsUndefined(value.additionalItems) &&
|
|
348
443
|
value.minItems === 0) || (ValueGuard.IsArray(value.items) &&
|
|
349
444
|
value.items.every(schema => (0, index_2.TSchema)(schema)))));
|
|
350
445
|
}
|
|
351
446
|
exports.TTuple = TTuple;
|
|
447
|
+
/** Returns true if the given value is TUndefined */
|
|
352
448
|
function TUndefined(value) {
|
|
449
|
+
// prettier-ignore
|
|
353
450
|
return (TKindOf(value, 'Undefined') &&
|
|
354
451
|
value.type === 'undefined' &&
|
|
355
452
|
IsOptionalString(value.$id));
|
|
356
453
|
}
|
|
357
454
|
exports.TUndefined = TUndefined;
|
|
455
|
+
/** Returns true if the given value is TUnion<Literal<string | number>[]> */
|
|
358
456
|
function TUnionLiteral(value) {
|
|
359
457
|
return (0, index_5.TUnion)(value) && value.anyOf.every((schema) => TLiteralString(schema) || TLiteralNumber(schema));
|
|
360
458
|
}
|
|
361
459
|
exports.TUnionLiteral = TUnionLiteral;
|
|
460
|
+
/** Returns true if the given value is TUnion */
|
|
362
461
|
function TUnion(value) {
|
|
462
|
+
// prettier-ignore
|
|
363
463
|
return (TKindOf(value, 'Union') &&
|
|
364
464
|
IsOptionalString(value.$id) &&
|
|
365
465
|
ValueGuard.IsObject(value) &&
|
|
@@ -367,7 +467,9 @@ function TUnion(value) {
|
|
|
367
467
|
value.anyOf.every(schema => (0, index_2.TSchema)(schema)));
|
|
368
468
|
}
|
|
369
469
|
exports.TUnion = TUnion;
|
|
470
|
+
/** Returns true if the given value is TUint8Array */
|
|
370
471
|
function TUint8Array(value) {
|
|
472
|
+
// prettier-ignore
|
|
371
473
|
return (TKindOf(value, 'Uint8Array') &&
|
|
372
474
|
value.type === 'Uint8Array' &&
|
|
373
475
|
IsOptionalString(value.$id) &&
|
|
@@ -375,26 +477,34 @@ function TUint8Array(value) {
|
|
|
375
477
|
IsOptionalNumber(value.maxByteLength));
|
|
376
478
|
}
|
|
377
479
|
exports.TUint8Array = TUint8Array;
|
|
480
|
+
/** Returns true if the given value is TUnknown */
|
|
378
481
|
function TUnknown(value) {
|
|
482
|
+
// prettier-ignore
|
|
379
483
|
return (TKindOf(value, 'Unknown') &&
|
|
380
484
|
IsOptionalString(value.$id));
|
|
381
485
|
}
|
|
382
486
|
exports.TUnknown = TUnknown;
|
|
487
|
+
/** Returns true if the given value is a raw TUnsafe */
|
|
383
488
|
function TUnsafe(value) {
|
|
384
489
|
return TKindOf(value, 'Unsafe');
|
|
385
490
|
}
|
|
386
491
|
exports.TUnsafe = TUnsafe;
|
|
492
|
+
/** Returns true if the given value is TVoid */
|
|
387
493
|
function TVoid(value) {
|
|
494
|
+
// prettier-ignore
|
|
388
495
|
return (TKindOf(value, 'Void') &&
|
|
389
496
|
value.type === 'void' &&
|
|
390
497
|
IsOptionalString(value.$id));
|
|
391
498
|
}
|
|
392
499
|
exports.TVoid = TVoid;
|
|
500
|
+
/** Returns true if the given value is TKind */
|
|
393
501
|
function TKind(value) {
|
|
394
502
|
return ValueGuard.IsObject(value) && index_1.Kind in value && ValueGuard.IsString(value[index_1.Kind]) && !KnownTypes.includes(value[index_1.Kind]);
|
|
395
503
|
}
|
|
396
504
|
exports.TKind = TKind;
|
|
505
|
+
/** Returns true if the given value is TSchema */
|
|
397
506
|
function TSchema(value) {
|
|
507
|
+
// prettier-ignore
|
|
398
508
|
return (ValueGuard.IsObject(value)) && ((0, index_6.TAny)(value) ||
|
|
399
509
|
(0, index_7.TArray)(value) ||
|
|
400
510
|
(0, index_8.TBoolean)(value) ||
|
|
@@ -1,14 +1,28 @@
|
|
|
1
|
+
/** Returns true if this value is an async iterator */
|
|
1
2
|
export declare function IsAsyncIterator(value: unknown): value is AsyncIterableIterator<unknown>;
|
|
3
|
+
/** Returns true if this value is an array */
|
|
2
4
|
export declare function IsArray(value: unknown): value is unknown[];
|
|
5
|
+
/** Returns true if this value is bigint */
|
|
3
6
|
export declare function IsBigInt(value: unknown): value is bigint;
|
|
7
|
+
/** Returns true if this value is a boolean */
|
|
4
8
|
export declare function IsBoolean(value: unknown): value is boolean;
|
|
9
|
+
/** Returns true if this value is a Date object */
|
|
5
10
|
export declare function IsDate(value: unknown): value is Date;
|
|
11
|
+
/** Returns true if this value is a function */
|
|
6
12
|
export declare function IsFunction(value: unknown): value is Function;
|
|
13
|
+
/** Returns true if this value is an iterator */
|
|
7
14
|
export declare function IsIterator(value: unknown): value is IterableIterator<unknown>;
|
|
15
|
+
/** Returns true if this value is null */
|
|
8
16
|
export declare function IsNull(value: unknown): value is null;
|
|
17
|
+
/** Returns true if this value is number */
|
|
9
18
|
export declare function IsNumber(value: unknown): value is number;
|
|
19
|
+
/** Returns true if this value is an object */
|
|
10
20
|
export declare function IsObject(value: unknown): value is Record<PropertyKey, unknown>;
|
|
21
|
+
/** Returns true if this value is string */
|
|
11
22
|
export declare function IsString(value: unknown): value is string;
|
|
23
|
+
/** Returns true if this value is symbol */
|
|
12
24
|
export declare function IsSymbol(value: unknown): value is symbol;
|
|
25
|
+
/** Returns true if this value is a Uint8Array */
|
|
13
26
|
export declare function IsUint8Array(value: unknown): value is Uint8Array;
|
|
27
|
+
/** Returns true if this value is undefined */
|
|
14
28
|
export declare function IsUndefined(value: unknown): value is undefined;
|
|
@@ -1,58 +1,99 @@
|
|
|
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.IsUndefined = exports.IsUint8Array = exports.IsSymbol = exports.IsString = exports.IsObject = exports.IsNumber = exports.IsNull = exports.IsIterator = exports.IsFunction = exports.IsDate = exports.IsBoolean = exports.IsBigInt = exports.IsArray = exports.IsAsyncIterator = void 0;
|
|
31
|
+
/** Returns true if this value is an async iterator */
|
|
4
32
|
function IsAsyncIterator(value) {
|
|
5
33
|
return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.asyncIterator in value;
|
|
6
34
|
}
|
|
7
35
|
exports.IsAsyncIterator = IsAsyncIterator;
|
|
36
|
+
/** Returns true if this value is an array */
|
|
8
37
|
function IsArray(value) {
|
|
9
38
|
return Array.isArray(value);
|
|
10
39
|
}
|
|
11
40
|
exports.IsArray = IsArray;
|
|
41
|
+
/** Returns true if this value is bigint */
|
|
12
42
|
function IsBigInt(value) {
|
|
13
43
|
return typeof value === 'bigint';
|
|
14
44
|
}
|
|
15
45
|
exports.IsBigInt = IsBigInt;
|
|
46
|
+
/** Returns true if this value is a boolean */
|
|
16
47
|
function IsBoolean(value) {
|
|
17
48
|
return typeof value === 'boolean';
|
|
18
49
|
}
|
|
19
50
|
exports.IsBoolean = IsBoolean;
|
|
51
|
+
/** Returns true if this value is a Date object */
|
|
20
52
|
function IsDate(value) {
|
|
21
53
|
return value instanceof globalThis.Date;
|
|
22
54
|
}
|
|
23
55
|
exports.IsDate = IsDate;
|
|
56
|
+
/** Returns true if this value is a function */
|
|
24
57
|
function IsFunction(value) {
|
|
25
58
|
return typeof value === 'function';
|
|
26
59
|
}
|
|
27
60
|
exports.IsFunction = IsFunction;
|
|
61
|
+
/** Returns true if this value is an iterator */
|
|
28
62
|
function IsIterator(value) {
|
|
29
63
|
return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.iterator in value;
|
|
30
64
|
}
|
|
31
65
|
exports.IsIterator = IsIterator;
|
|
66
|
+
/** Returns true if this value is null */
|
|
32
67
|
function IsNull(value) {
|
|
33
68
|
return value === null;
|
|
34
69
|
}
|
|
35
70
|
exports.IsNull = IsNull;
|
|
71
|
+
/** Returns true if this value is number */
|
|
36
72
|
function IsNumber(value) {
|
|
37
73
|
return typeof value === 'number';
|
|
38
74
|
}
|
|
39
75
|
exports.IsNumber = IsNumber;
|
|
76
|
+
/** Returns true if this value is an object */
|
|
40
77
|
function IsObject(value) {
|
|
41
78
|
return typeof value === 'object' && value !== null;
|
|
42
79
|
}
|
|
43
80
|
exports.IsObject = IsObject;
|
|
81
|
+
/** Returns true if this value is string */
|
|
44
82
|
function IsString(value) {
|
|
45
83
|
return typeof value === 'string';
|
|
46
84
|
}
|
|
47
85
|
exports.IsString = IsString;
|
|
86
|
+
/** Returns true if this value is symbol */
|
|
48
87
|
function IsSymbol(value) {
|
|
49
88
|
return typeof value === 'symbol';
|
|
50
89
|
}
|
|
51
90
|
exports.IsSymbol = IsSymbol;
|
|
91
|
+
/** Returns true if this value is a Uint8Array */
|
|
52
92
|
function IsUint8Array(value) {
|
|
53
93
|
return value instanceof globalThis.Uint8Array;
|
|
54
94
|
}
|
|
55
95
|
exports.IsUint8Array = IsUint8Array;
|
|
96
|
+
/** Returns true if this value is undefined */
|
|
56
97
|
function IsUndefined(value) {
|
|
57
98
|
return value === undefined;
|
|
58
99
|
}
|
|
@@ -34,6 +34,7 @@ type IncrementTake<T extends keyof IncrementBase> = IncrementBase[T];
|
|
|
34
34
|
type IncrementStep<T extends string> = T extends IncrementBase['m'] ? IncrementBase['t'] : T extends `${infer L extends keyof IncrementBase}${infer R}` ? L extends IncrementBase['m'] ? `${IncrementTake<L>}${IncrementStep<R>}` : `${IncrementTake<L>}${R}` : never;
|
|
35
35
|
type IncrementReverse<T extends string> = T extends `${infer L}${infer R}` ? `${IncrementReverse<R>}${L}` : T;
|
|
36
36
|
export type Increment<T extends string> = IncrementReverse<IncrementStep<IncrementReverse<T>>>;
|
|
37
|
+
/** Increments the given string value + 1 */
|
|
37
38
|
export declare function Increment<T extends string>(T: T): Increment<T>;
|
|
38
39
|
export type AssertProperties<T> = T extends TProperties ? T : TProperties;
|
|
39
40
|
export type AssertRest<T, E extends TSchema[] = TSchema[]> = T extends E ? T : [];
|
|
@@ -1,6 +1,34 @@
|
|
|
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.Increment = void 0;
|
|
31
|
+
/** Increments the given string value + 1 */
|
|
4
32
|
function Increment(T) {
|
|
5
33
|
return (parseInt(T) + 1).toString();
|
|
6
34
|
}
|
|
@@ -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);
|
|
@@ -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);
|
|
@@ -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);
|