@depup/sinclair__typebox 0.34.48-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -0
- package/build/cjs/compiler/compiler.d.ts +55 -0
- package/build/cjs/compiler/compiler.js +670 -0
- package/build/cjs/compiler/index.d.ts +2 -0
- package/build/cjs/compiler/index.js +22 -0
- package/build/cjs/errors/errors.d.ts +91 -0
- package/build/cjs/errors/errors.js +599 -0
- package/build/cjs/errors/function.d.ts +21 -0
- package/build/cjs/errors/function.js +153 -0
- package/build/cjs/errors/index.d.ts +2 -0
- package/build/cjs/errors/index.js +19 -0
- package/build/cjs/index.d.ts +71 -0
- package/build/cjs/index.js +97 -0
- package/build/cjs/parser/index.d.ts +2 -0
- package/build/cjs/parser/index.js +39 -0
- package/build/cjs/parser/runtime/guard.d.ts +23 -0
- package/build/cjs/parser/runtime/guard.js +86 -0
- package/build/cjs/parser/runtime/index.d.ts +5 -0
- package/build/cjs/parser/runtime/index.js +45 -0
- package/build/cjs/parser/runtime/module.d.ts +9 -0
- package/build/cjs/parser/runtime/module.js +22 -0
- package/build/cjs/parser/runtime/parse.d.ts +9 -0
- package/build/cjs/parser/runtime/parse.js +160 -0
- package/build/cjs/parser/runtime/token.d.ts +8 -0
- package/build/cjs/parser/runtime/token.js +230 -0
- package/build/cjs/parser/runtime/types.d.ts +98 -0
- package/build/cjs/parser/runtime/types.js +71 -0
- package/build/cjs/parser/static/index.d.ts +3 -0
- package/build/cjs/parser/static/index.js +43 -0
- package/build/cjs/parser/static/parse.d.ts +20 -0
- package/build/cjs/parser/static/parse.js +3 -0
- package/build/cjs/parser/static/token.d.ts +108 -0
- package/build/cjs/parser/static/token.js +3 -0
- package/build/cjs/parser/static/types.d.ts +69 -0
- package/build/cjs/parser/static/types.js +3 -0
- package/build/cjs/syntax/index.d.ts +1 -0
- package/build/cjs/syntax/index.js +18 -0
- package/build/cjs/syntax/mapping.d.ts +167 -0
- package/build/cjs/syntax/mapping.js +491 -0
- package/build/cjs/syntax/parser.d.ts +162 -0
- package/build/cjs/syntax/parser.js +191 -0
- package/build/cjs/syntax/syntax.d.ts +12 -0
- package/build/cjs/syntax/syntax.js +54 -0
- package/build/cjs/system/index.d.ts +2 -0
- package/build/cjs/system/index.js +19 -0
- package/build/cjs/system/policy.d.ts +29 -0
- package/build/cjs/system/policy.js +58 -0
- package/build/cjs/system/system.d.ts +16 -0
- package/build/cjs/system/system.js +43 -0
- package/build/cjs/type/any/any.d.ts +8 -0
- package/build/cjs/type/any/any.js +10 -0
- package/build/cjs/type/any/index.d.ts +1 -0
- package/build/cjs/type/any/index.js +18 -0
- package/build/cjs/type/argument/argument.d.ts +9 -0
- package/build/cjs/type/argument/argument.js +10 -0
- package/build/cjs/type/argument/index.d.ts +1 -0
- package/build/cjs/type/argument/index.js +18 -0
- package/build/cjs/type/array/array.d.ts +28 -0
- package/build/cjs/type/array/array.js +10 -0
- package/build/cjs/type/array/index.d.ts +1 -0
- package/build/cjs/type/array/index.js +18 -0
- package/build/cjs/type/async-iterator/async-iterator.d.ts +11 -0
- package/build/cjs/type/async-iterator/async-iterator.js +10 -0
- package/build/cjs/type/async-iterator/index.d.ts +1 -0
- package/build/cjs/type/async-iterator/index.js +18 -0
- package/build/cjs/type/awaited/awaited.d.ts +14 -0
- package/build/cjs/type/awaited/awaited.js +41 -0
- package/build/cjs/type/awaited/index.d.ts +1 -0
- package/build/cjs/type/awaited/index.js +18 -0
- package/build/cjs/type/bigint/bigint.d.ts +16 -0
- package/build/cjs/type/bigint/bigint.js +10 -0
- package/build/cjs/type/bigint/index.d.ts +1 -0
- package/build/cjs/type/bigint/index.js +18 -0
- package/build/cjs/type/boolean/boolean.d.ts +9 -0
- package/build/cjs/type/boolean/boolean.js +10 -0
- package/build/cjs/type/boolean/index.d.ts +1 -0
- package/build/cjs/type/boolean/index.js +18 -0
- package/build/cjs/type/clone/index.d.ts +2 -0
- package/build/cjs/type/clone/index.js +19 -0
- package/build/cjs/type/clone/type.d.ts +5 -0
- package/build/cjs/type/clone/type.js +14 -0
- package/build/cjs/type/clone/value.d.ts +2 -0
- package/build/cjs/type/clone/value.js +73 -0
- package/build/cjs/type/composite/composite.d.ts +18 -0
- package/build/cjs/type/composite/composite.js +46 -0
- package/build/cjs/type/composite/index.d.ts +1 -0
- package/build/cjs/type/composite/index.js +18 -0
- package/build/cjs/type/computed/computed.d.ts +9 -0
- package/build/cjs/type/computed/computed.js +10 -0
- package/build/cjs/type/computed/index.d.ts +1 -0
- package/build/cjs/type/computed/index.js +18 -0
- package/build/cjs/type/const/const.d.ts +27 -0
- package/build/cjs/type/const/const.js +58 -0
- package/build/cjs/type/const/index.d.ts +1 -0
- package/build/cjs/type/const/index.js +18 -0
- package/build/cjs/type/constructor/constructor.d.ts +23 -0
- package/build/cjs/type/constructor/constructor.js +10 -0
- package/build/cjs/type/constructor/index.d.ts +1 -0
- package/build/cjs/type/constructor/index.js +18 -0
- package/build/cjs/type/constructor-parameters/constructor-parameters.d.ts +7 -0
- package/build/cjs/type/constructor-parameters/constructor-parameters.js +44 -0
- package/build/cjs/type/constructor-parameters/index.d.ts +1 -0
- package/build/cjs/type/constructor-parameters/index.js +18 -0
- package/build/cjs/type/create/immutable.d.ts +2 -0
- package/build/cjs/type/create/immutable.js +70 -0
- package/build/cjs/type/create/index.d.ts +1 -0
- package/build/cjs/type/create/index.js +18 -0
- package/build/cjs/type/create/type.d.ts +3 -0
- package/build/cjs/type/create/type.js +19 -0
- package/build/cjs/type/date/date.d.ts +21 -0
- package/build/cjs/type/date/date.js +10 -0
- package/build/cjs/type/date/index.d.ts +1 -0
- package/build/cjs/type/date/index.js +18 -0
- package/build/cjs/type/discard/discard.d.ts +2 -0
- package/build/cjs/type/discard/discard.js +12 -0
- package/build/cjs/type/discard/index.d.ts +1 -0
- package/build/cjs/type/discard/index.js +18 -0
- package/build/cjs/type/enum/enum.d.ts +14 -0
- package/build/cjs/type/enum/enum.js +22 -0
- package/build/cjs/type/enum/index.d.ts +1 -0
- package/build/cjs/type/enum/index.js +18 -0
- package/build/cjs/type/error/error.d.ts +4 -0
- package/build/cjs/type/error/error.js +11 -0
- package/build/cjs/type/error/index.d.ts +1 -0
- package/build/cjs/type/error/index.js +18 -0
- package/build/cjs/type/exclude/exclude-from-mapped-result.d.ts +11 -0
- package/build/cjs/type/exclude/exclude-from-mapped-result.js +22 -0
- package/build/cjs/type/exclude/exclude-from-template-literal.d.ts +5 -0
- package/build/cjs/type/exclude/exclude-from-template-literal.js +9 -0
- package/build/cjs/type/exclude/exclude.d.ts +21 -0
- package/build/cjs/type/exclude/exclude.js +29 -0
- package/build/cjs/type/exclude/index.d.ts +3 -0
- package/build/cjs/type/exclude/index.js +20 -0
- package/build/cjs/type/extends/extends-check.d.ts +10 -0
- package/build/cjs/type/extends/extends-check.js +641 -0
- package/build/cjs/type/extends/extends-from-mapped-key.d.ts +14 -0
- package/build/cjs/type/extends/extends-from-mapped-key.js +29 -0
- package/build/cjs/type/extends/extends-from-mapped-result.d.ts +11 -0
- package/build/cjs/type/extends/extends-from-mapped-result.js +23 -0
- package/build/cjs/type/extends/extends-undefined.d.ts +3 -0
- package/build/cjs/type/extends/extends-undefined.js +24 -0
- package/build/cjs/type/extends/extends.d.ts +16 -0
- package/build/cjs/type/extends/extends.js +27 -0
- package/build/cjs/type/extends/index.d.ts +5 -0
- package/build/cjs/type/extends/index.js +22 -0
- package/build/cjs/type/extract/extract-from-mapped-result.d.ts +11 -0
- package/build/cjs/type/extract/extract-from-mapped-result.js +22 -0
- package/build/cjs/type/extract/extract-from-template-literal.d.ts +5 -0
- package/build/cjs/type/extract/extract-from-template-literal.js +9 -0
- package/build/cjs/type/extract/extract.d.ts +21 -0
- package/build/cjs/type/extract/extract.js +29 -0
- package/build/cjs/type/extract/index.d.ts +3 -0
- package/build/cjs/type/extract/index.js +20 -0
- package/build/cjs/type/function/function.d.ts +23 -0
- package/build/cjs/type/function/function.js +10 -0
- package/build/cjs/type/function/index.d.ts +1 -0
- package/build/cjs/type/function/index.js +18 -0
- package/build/cjs/type/guard/index.d.ts +3 -0
- package/build/cjs/type/guard/index.js +40 -0
- package/build/cjs/type/guard/kind.d.ts +147 -0
- package/build/cjs/type/guard/kind.js +320 -0
- package/build/cjs/type/guard/type.d.ts +152 -0
- package/build/cjs/type/guard/type.js +597 -0
- package/build/cjs/type/guard/value.d.ts +34 -0
- package/build/cjs/type/guard/value.js +89 -0
- package/build/cjs/type/helpers/helpers.d.ts +42 -0
- package/build/cjs/type/helpers/helpers.js +8 -0
- package/build/cjs/type/helpers/index.d.ts +1 -0
- package/build/cjs/type/helpers/index.js +18 -0
- package/build/cjs/type/index.d.ts +71 -0
- package/build/cjs/type/index.js +88 -0
- package/build/cjs/type/indexed/index.d.ts +4 -0
- package/build/cjs/type/indexed/index.js +21 -0
- package/build/cjs/type/indexed/indexed-from-mapped-key.d.ts +13 -0
- package/build/cjs/type/indexed/indexed-from-mapped-key.js +26 -0
- package/build/cjs/type/indexed/indexed-from-mapped-result.d.ts +12 -0
- package/build/cjs/type/indexed/indexed-from-mapped-result.js +24 -0
- package/build/cjs/type/indexed/indexed-property-keys.d.ts +14 -0
- package/build/cjs/type/indexed/indexed-property-keys.js +36 -0
- package/build/cjs/type/indexed/indexed.d.ts +52 -0
- package/build/cjs/type/indexed/indexed.js +98 -0
- package/build/cjs/type/instance-type/index.d.ts +1 -0
- package/build/cjs/type/instance-type/index.js +18 -0
- package/build/cjs/type/instance-type/instance-type.d.ts +6 -0
- package/build/cjs/type/instance-type/instance-type.js +44 -0
- package/build/cjs/type/instantiate/index.d.ts +1 -0
- package/build/cjs/type/instantiate/index.js +18 -0
- package/build/cjs/type/instantiate/instantiate.d.ts +50 -0
- package/build/cjs/type/instantiate/instantiate.js +153 -0
- package/build/cjs/type/integer/index.d.ts +1 -0
- package/build/cjs/type/integer/index.js +18 -0
- package/build/cjs/type/integer/integer.d.ts +16 -0
- package/build/cjs/type/integer/integer.js +10 -0
- package/build/cjs/type/intersect/index.d.ts +3 -0
- package/build/cjs/type/intersect/index.js +20 -0
- package/build/cjs/type/intersect/intersect-create.d.ts +3 -0
- package/build/cjs/type/intersect/intersect-create.js +23 -0
- package/build/cjs/type/intersect/intersect-evaluated.d.ts +13 -0
- package/build/cjs/type/intersect/intersect-evaluated.js +42 -0
- package/build/cjs/type/intersect/intersect-type.d.ts +15 -0
- package/build/cjs/type/intersect/intersect-type.js +4 -0
- package/build/cjs/type/intersect/intersect.d.ts +6 -0
- package/build/cjs/type/intersect/intersect.js +21 -0
- package/build/cjs/type/intrinsic/capitalize.d.ts +5 -0
- package/build/cjs/type/intrinsic/capitalize.js +9 -0
- package/build/cjs/type/intrinsic/index.d.ts +6 -0
- package/build/cjs/type/intrinsic/index.js +23 -0
- package/build/cjs/type/intrinsic/intrinsic-from-mapped-key.d.ts +14 -0
- package/build/cjs/type/intrinsic/intrinsic-from-mapped-key.js +30 -0
- package/build/cjs/type/intrinsic/intrinsic.d.ts +16 -0
- package/build/cjs/type/intrinsic/intrinsic.js +68 -0
- package/build/cjs/type/intrinsic/lowercase.d.ts +5 -0
- package/build/cjs/type/intrinsic/lowercase.js +9 -0
- package/build/cjs/type/intrinsic/uncapitalize.d.ts +5 -0
- package/build/cjs/type/intrinsic/uncapitalize.js +9 -0
- package/build/cjs/type/intrinsic/uppercase.d.ts +5 -0
- package/build/cjs/type/intrinsic/uppercase.js +9 -0
- package/build/cjs/type/iterator/index.d.ts +1 -0
- package/build/cjs/type/iterator/index.js +18 -0
- package/build/cjs/type/iterator/iterator.d.ts +11 -0
- package/build/cjs/type/iterator/iterator.js +10 -0
- package/build/cjs/type/keyof/index.d.ts +4 -0
- package/build/cjs/type/keyof/index.js +21 -0
- package/build/cjs/type/keyof/keyof-from-mapped-result.d.ts +12 -0
- package/build/cjs/type/keyof/keyof-from-mapped-result.js +23 -0
- package/build/cjs/type/keyof/keyof-property-entries.d.ts +7 -0
- package/build/cjs/type/keyof/keyof-property-entries.js +16 -0
- package/build/cjs/type/keyof/keyof-property-keys.d.ts +24 -0
- package/build/cjs/type/keyof/keyof-property-keys.js +78 -0
- package/build/cjs/type/keyof/keyof.d.ts +21 -0
- package/build/cjs/type/keyof/keyof.js +40 -0
- package/build/cjs/type/literal/index.d.ts +1 -0
- package/build/cjs/type/literal/index.js +18 -0
- package/build/cjs/type/literal/literal.d.ts +10 -0
- package/build/cjs/type/literal/literal.js +14 -0
- package/build/cjs/type/mapped/index.d.ts +3 -0
- package/build/cjs/type/mapped/index.js +20 -0
- package/build/cjs/type/mapped/mapped-key.d.ts +8 -0
- package/build/cjs/type/mapped/mapped-key.js +13 -0
- package/build/cjs/type/mapped/mapped-result.d.ts +9 -0
- package/build/cjs/type/mapped/mapped-result.js +13 -0
- package/build/cjs/type/mapped/mapped.d.ts +47 -0
- package/build/cjs/type/mapped/mapped.js +107 -0
- package/build/cjs/type/module/compute.d.ts +59 -0
- package/build/cjs/type/module/compute.js +205 -0
- package/build/cjs/type/module/index.d.ts +1 -0
- package/build/cjs/type/module/index.js +18 -0
- package/build/cjs/type/module/infer.d.ts +49 -0
- package/build/cjs/type/module/infer.js +3 -0
- package/build/cjs/type/module/module.d.ts +27 -0
- package/build/cjs/type/module/module.js +38 -0
- package/build/cjs/type/never/index.d.ts +1 -0
- package/build/cjs/type/never/index.js +18 -0
- package/build/cjs/type/never/never.d.ts +9 -0
- package/build/cjs/type/never/never.js +10 -0
- package/build/cjs/type/not/index.d.ts +1 -0
- package/build/cjs/type/not/index.js +18 -0
- package/build/cjs/type/not/not.d.ts +10 -0
- package/build/cjs/type/not/not.js +10 -0
- package/build/cjs/type/null/index.d.ts +1 -0
- package/build/cjs/type/null/index.js +18 -0
- package/build/cjs/type/null/null.d.ts +9 -0
- package/build/cjs/type/null/null.js +10 -0
- package/build/cjs/type/number/index.d.ts +1 -0
- package/build/cjs/type/number/index.js +18 -0
- package/build/cjs/type/number/number.d.ts +16 -0
- package/build/cjs/type/number/number.js +10 -0
- package/build/cjs/type/object/index.d.ts +1 -0
- package/build/cjs/type/object/index.js +18 -0
- package/build/cjs/type/object/object.d.ts +51 -0
- package/build/cjs/type/object/object.js +22 -0
- package/build/cjs/type/omit/index.d.ts +3 -0
- package/build/cjs/type/omit/index.js +20 -0
- package/build/cjs/type/omit/omit-from-mapped-key.d.ts +12 -0
- package/build/cjs/type/omit/omit-from-mapped-key.js +26 -0
- package/build/cjs/type/omit/omit-from-mapped-result.d.ts +12 -0
- package/build/cjs/type/omit/omit-from-mapped-result.js +23 -0
- package/build/cjs/type/omit/omit.d.ts +36 -0
- package/build/cjs/type/omit/omit.js +75 -0
- package/build/cjs/type/optional/index.d.ts +2 -0
- package/build/cjs/type/optional/index.js +19 -0
- package/build/cjs/type/optional/optional-from-mapped-result.d.ts +10 -0
- package/build/cjs/type/optional/optional-from-mapped-result.js +22 -0
- package/build/cjs/type/optional/optional.d.ts +20 -0
- package/build/cjs/type/optional/optional.js +26 -0
- package/build/cjs/type/parameters/index.d.ts +1 -0
- package/build/cjs/type/parameters/index.js +18 -0
- package/build/cjs/type/parameters/parameters.d.ts +7 -0
- package/build/cjs/type/parameters/parameters.js +44 -0
- package/build/cjs/type/partial/index.d.ts +2 -0
- package/build/cjs/type/partial/index.js +19 -0
- package/build/cjs/type/partial/partial-from-mapped-result.d.ts +12 -0
- package/build/cjs/type/partial/partial-from-mapped-result.js +23 -0
- package/build/cjs/type/partial/partial.d.ts +35 -0
- package/build/cjs/type/partial/partial.js +111 -0
- package/build/cjs/type/patterns/index.d.ts +1 -0
- package/build/cjs/type/patterns/index.js +18 -0
- package/build/cjs/type/patterns/patterns.d.ts +8 -0
- package/build/cjs/type/patterns/patterns.js +12 -0
- package/build/cjs/type/pick/index.d.ts +3 -0
- package/build/cjs/type/pick/index.js +20 -0
- package/build/cjs/type/pick/pick-from-mapped-key.d.ts +12 -0
- package/build/cjs/type/pick/pick-from-mapped-key.js +28 -0
- package/build/cjs/type/pick/pick-from-mapped-result.d.ts +12 -0
- package/build/cjs/type/pick/pick-from-mapped-result.js +23 -0
- package/build/cjs/type/pick/pick.d.ts +36 -0
- package/build/cjs/type/pick/pick.js +70 -0
- package/build/cjs/type/promise/index.d.ts +1 -0
- package/build/cjs/type/promise/index.js +18 -0
- package/build/cjs/type/promise/promise.d.ts +11 -0
- package/build/cjs/type/promise/promise.js +10 -0
- package/build/cjs/type/readonly/index.d.ts +2 -0
- package/build/cjs/type/readonly/index.js +19 -0
- package/build/cjs/type/readonly/readonly-from-mapped-result.d.ts +10 -0
- package/build/cjs/type/readonly/readonly-from-mapped-result.js +22 -0
- package/build/cjs/type/readonly/readonly.d.ts +20 -0
- package/build/cjs/type/readonly/readonly.js +26 -0
- package/build/cjs/type/readonly-optional/index.d.ts +1 -0
- package/build/cjs/type/readonly-optional/index.js +18 -0
- package/build/cjs/type/readonly-optional/readonly-optional.d.ts +6 -0
- package/build/cjs/type/readonly-optional/readonly-optional.js +10 -0
- package/build/cjs/type/record/index.d.ts +1 -0
- package/build/cjs/type/record/index.js +18 -0
- package/build/cjs/type/record/record.d.ts +71 -0
- package/build/cjs/type/record/record.js +123 -0
- package/build/cjs/type/recursive/index.d.ts +1 -0
- package/build/cjs/type/recursive/index.js +18 -0
- package/build/cjs/type/recursive/recursive.d.ts +16 -0
- package/build/cjs/type/recursive/recursive.js +19 -0
- package/build/cjs/type/ref/index.d.ts +1 -0
- package/build/cjs/type/ref/index.js +18 -0
- package/build/cjs/type/ref/ref.d.ts +41 -0
- package/build/cjs/type/ref/ref.js +14 -0
- package/build/cjs/type/regexp/index.d.ts +1 -0
- package/build/cjs/type/regexp/index.js +18 -0
- package/build/cjs/type/regexp/regexp.d.ts +20 -0
- package/build/cjs/type/regexp/regexp.js +12 -0
- package/build/cjs/type/registry/format.d.ts +13 -0
- package/build/cjs/type/registry/format.js +35 -0
- package/build/cjs/type/registry/index.d.ts +2 -0
- package/build/cjs/type/registry/index.js +39 -0
- package/build/cjs/type/registry/type.d.ts +13 -0
- package/build/cjs/type/registry/type.js +35 -0
- package/build/cjs/type/required/index.d.ts +2 -0
- package/build/cjs/type/required/index.js +19 -0
- package/build/cjs/type/required/required-from-mapped-result.d.ts +12 -0
- package/build/cjs/type/required/required-from-mapped-result.js +22 -0
- package/build/cjs/type/required/required.d.ts +35 -0
- package/build/cjs/type/required/required.js +110 -0
- package/build/cjs/type/rest/index.d.ts +1 -0
- package/build/cjs/type/rest/index.js +18 -0
- package/build/cjs/type/rest/rest.d.ts +10 -0
- package/build/cjs/type/rest/rest.js +19 -0
- package/build/cjs/type/return-type/index.d.ts +1 -0
- package/build/cjs/type/return-type/index.js +18 -0
- package/build/cjs/type/return-type/return-type.d.ts +6 -0
- package/build/cjs/type/return-type/return-type.js +44 -0
- package/build/cjs/type/schema/anyschema.d.ts +33 -0
- package/build/cjs/type/schema/anyschema.js +3 -0
- package/build/cjs/type/schema/index.d.ts +2 -0
- package/build/cjs/type/schema/index.js +19 -0
- package/build/cjs/type/schema/schema.d.ts +29 -0
- package/build/cjs/type/schema/schema.js +4 -0
- package/build/cjs/type/sets/index.d.ts +1 -0
- package/build/cjs/type/sets/index.js +18 -0
- package/build/cjs/type/sets/set.d.ts +28 -0
- package/build/cjs/type/sets/set.js +59 -0
- package/build/cjs/type/static/index.d.ts +1 -0
- package/build/cjs/type/static/index.js +18 -0
- package/build/cjs/type/static/static.d.ts +39 -0
- package/build/cjs/type/static/static.js +3 -0
- package/build/cjs/type/string/index.d.ts +1 -0
- package/build/cjs/type/string/index.js +18 -0
- package/build/cjs/type/string/string.d.ts +25 -0
- package/build/cjs/type/string/string.js +10 -0
- package/build/cjs/type/symbol/index.d.ts +1 -0
- package/build/cjs/type/symbol/index.js +18 -0
- package/build/cjs/type/symbol/symbol.d.ts +10 -0
- package/build/cjs/type/symbol/symbol.js +10 -0
- package/build/cjs/type/symbols/index.d.ts +1 -0
- package/build/cjs/type/symbols/index.js +18 -0
- package/build/cjs/type/symbols/symbols.d.ts +10 -0
- package/build/cjs/type/symbols/symbols.js +14 -0
- package/build/cjs/type/template-literal/finite.d.ts +19 -0
- package/build/cjs/type/template-literal/finite.js +56 -0
- package/build/cjs/type/template-literal/generate.d.ts +21 -0
- package/build/cjs/type/template-literal/generate.js +60 -0
- package/build/cjs/type/template-literal/index.d.ts +7 -0
- package/build/cjs/type/template-literal/index.js +24 -0
- package/build/cjs/type/template-literal/parse.d.ts +20 -0
- package/build/cjs/type/template-literal/parse.js +174 -0
- package/build/cjs/type/template-literal/pattern.d.ts +5 -0
- package/build/cjs/type/template-literal/pattern.js +39 -0
- package/build/cjs/type/template-literal/syntax.d.ts +20 -0
- package/build/cjs/type/template-literal/syntax.js +59 -0
- package/build/cjs/type/template-literal/template-literal.d.ts +30 -0
- package/build/cjs/type/template-literal/template-literal.js +17 -0
- package/build/cjs/type/template-literal/union.d.ts +9 -0
- package/build/cjs/type/template-literal/union.js +13 -0
- package/build/cjs/type/transform/index.d.ts +1 -0
- package/build/cjs/type/transform/index.js +18 -0
- package/build/cjs/type/transform/transform.d.ts +30 -0
- package/build/cjs/type/transform/transform.js +47 -0
- package/build/cjs/type/tuple/index.d.ts +1 -0
- package/build/cjs/type/tuple/index.js +18 -0
- package/build/cjs/type/tuple/tuple.d.ts +16 -0
- package/build/cjs/type/tuple/tuple.js +13 -0
- package/build/cjs/type/type/index.d.ts +6 -0
- package/build/cjs/type/type/index.js +51 -0
- package/build/cjs/type/type/javascript.d.ts +64 -0
- package/build/cjs/type/type/javascript.js +104 -0
- package/build/cjs/type/type/json.d.ts +208 -0
- package/build/cjs/type/type/json.js +226 -0
- package/build/cjs/type/type/type.d.ts +59 -0
- package/build/cjs/type/type/type.js +129 -0
- package/build/cjs/type/uint8array/index.d.ts +1 -0
- package/build/cjs/type/uint8array/index.js +18 -0
- package/build/cjs/type/uint8array/uint8array.d.ts +13 -0
- package/build/cjs/type/uint8array/uint8array.js +10 -0
- package/build/cjs/type/undefined/index.d.ts +1 -0
- package/build/cjs/type/undefined/index.js +18 -0
- package/build/cjs/type/undefined/undefined.d.ts +9 -0
- package/build/cjs/type/undefined/undefined.js +10 -0
- package/build/cjs/type/union/index.d.ts +3 -0
- package/build/cjs/type/union/index.js +20 -0
- package/build/cjs/type/union/union-create.d.ts +3 -0
- package/build/cjs/type/union/union-create.js +9 -0
- package/build/cjs/type/union/union-evaluated.d.ts +13 -0
- package/build/cjs/type/union/union-evaluated.js +40 -0
- package/build/cjs/type/union/union-type.d.ts +12 -0
- package/build/cjs/type/union/union-type.js +4 -0
- package/build/cjs/type/union/union.d.ts +6 -0
- package/build/cjs/type/union/union.js +14 -0
- package/build/cjs/type/unknown/index.d.ts +1 -0
- package/build/cjs/type/unknown/index.js +18 -0
- package/build/cjs/type/unknown/unknown.d.ts +8 -0
- package/build/cjs/type/unknown/unknown.js +10 -0
- package/build/cjs/type/unsafe/index.d.ts +1 -0
- package/build/cjs/type/unsafe/index.js +18 -0
- package/build/cjs/type/unsafe/unsafe.d.ts +11 -0
- package/build/cjs/type/unsafe/unsafe.js +10 -0
- package/build/cjs/type/void/index.d.ts +1 -0
- package/build/cjs/type/void/index.js +18 -0
- package/build/cjs/type/void/void.d.ts +9 -0
- package/build/cjs/type/void/void.js +10 -0
- package/build/cjs/value/assert/assert.d.ts +15 -0
- package/build/cjs/value/assert/assert.js +55 -0
- package/build/cjs/value/assert/index.d.ts +1 -0
- package/build/cjs/value/assert/index.js +18 -0
- package/build/cjs/value/cast/cast.d.ts +11 -0
- package/build/cjs/value/cast/cast.js +241 -0
- package/build/cjs/value/cast/index.d.ts +1 -0
- package/build/cjs/value/cast/index.js +18 -0
- package/build/cjs/value/check/check.d.ts +11 -0
- package/build/cjs/value/check/check.js +476 -0
- package/build/cjs/value/check/index.d.ts +1 -0
- package/build/cjs/value/check/index.js +18 -0
- package/build/cjs/value/clean/clean.d.ts +5 -0
- package/build/cjs/value/clean/clean.js +149 -0
- package/build/cjs/value/clean/index.d.ts +1 -0
- package/build/cjs/value/clean/index.js +18 -0
- package/build/cjs/value/clone/clone.d.ts +2 -0
- package/build/cjs/value/clone/clone.js +60 -0
- package/build/cjs/value/clone/index.d.ts +1 -0
- package/build/cjs/value/clone/index.js +18 -0
- package/build/cjs/value/convert/convert.d.ts +5 -0
- package/build/cjs/value/convert/convert.js +264 -0
- package/build/cjs/value/convert/index.d.ts +1 -0
- package/build/cjs/value/convert/index.js +18 -0
- package/build/cjs/value/create/create.d.ts +11 -0
- package/build/cjs/value/create/create.js +474 -0
- package/build/cjs/value/create/index.d.ts +1 -0
- package/build/cjs/value/create/index.js +18 -0
- package/build/cjs/value/decode/decode.d.ts +6 -0
- package/build/cjs/value/decode/decode.js +14 -0
- package/build/cjs/value/decode/index.d.ts +1 -0
- package/build/cjs/value/decode/index.js +18 -0
- package/build/cjs/value/default/default.d.ts +5 -0
- package/build/cjs/value/default/default.js +176 -0
- package/build/cjs/value/default/index.d.ts +1 -0
- package/build/cjs/value/default/index.js +18 -0
- package/build/cjs/value/delta/delta.d.ts +32 -0
- package/build/cjs/value/delta/delta.js +178 -0
- package/build/cjs/value/delta/index.d.ts +1 -0
- package/build/cjs/value/delta/index.js +18 -0
- package/build/cjs/value/deref/deref.d.ts +12 -0
- package/build/cjs/value/deref/deref.js +36 -0
- package/build/cjs/value/deref/index.d.ts +1 -0
- package/build/cjs/value/deref/index.js +18 -0
- package/build/cjs/value/encode/encode.d.ts +6 -0
- package/build/cjs/value/encode/encode.js +15 -0
- package/build/cjs/value/encode/index.d.ts +1 -0
- package/build/cjs/value/encode/index.js +18 -0
- package/build/cjs/value/equal/equal.d.ts +2 -0
- package/build/cjs/value/equal/equal.js +50 -0
- package/build/cjs/value/equal/index.d.ts +1 -0
- package/build/cjs/value/equal/index.js +18 -0
- package/build/cjs/value/guard/guard.d.ts +74 -0
- package/build/cjs/value/guard/guard.js +195 -0
- package/build/cjs/value/guard/index.d.ts +1 -0
- package/build/cjs/value/guard/index.js +18 -0
- package/build/cjs/value/hash/hash.d.ts +7 -0
- package/build/cjs/value/hash/hash.js +152 -0
- package/build/cjs/value/hash/index.d.ts +1 -0
- package/build/cjs/value/hash/index.js +18 -0
- package/build/cjs/value/index.d.ts +20 -0
- package/build/cjs/value/index.js +53 -0
- package/build/cjs/value/mutate/index.d.ts +1 -0
- package/build/cjs/value/mutate/index.js +18 -0
- package/build/cjs/value/mutate/mutate.d.ts +9 -0
- package/build/cjs/value/mutate/mutate.js +104 -0
- package/build/cjs/value/parse/index.d.ts +1 -0
- package/build/cjs/value/parse/index.js +18 -0
- package/build/cjs/value/parse/parse.d.ts +22 -0
- package/build/cjs/value/parse/parse.js +87 -0
- package/build/cjs/value/pointer/index.d.ts +1 -0
- package/build/cjs/value/pointer/index.js +38 -0
- package/build/cjs/value/pointer/pointer.d.ts +22 -0
- package/build/cjs/value/pointer/pointer.js +126 -0
- package/build/cjs/value/transform/decode.d.ts +22 -0
- package/build/cjs/value/transform/decode.js +214 -0
- package/build/cjs/value/transform/encode.d.ts +23 -0
- package/build/cjs/value/transform/encode.js +225 -0
- package/build/cjs/value/transform/has.d.ts +3 -0
- package/build/cjs/value/transform/has.js +133 -0
- package/build/cjs/value/transform/index.d.ts +3 -0
- package/build/cjs/value/transform/index.js +20 -0
- package/build/cjs/value/value/index.d.ts +1 -0
- package/build/cjs/value/value/index.js +38 -0
- package/build/cjs/value/value/value.d.ts +16 -0
- package/build/cjs/value/value/value.js +39 -0
- package/build/esm/compiler/compiler.d.mts +55 -0
- package/build/esm/compiler/compiler.mjs +663 -0
- package/build/esm/compiler/index.d.mts +2 -0
- package/build/esm/compiler/index.mjs +2 -0
- package/build/esm/errors/errors.d.mts +91 -0
- package/build/esm/errors/errors.mjs +592 -0
- package/build/esm/errors/function.d.mts +21 -0
- package/build/esm/errors/function.mjs +147 -0
- package/build/esm/errors/index.d.mts +2 -0
- package/build/esm/errors/index.mjs +2 -0
- package/build/esm/index.d.mts +71 -0
- package/build/esm/index.mjs +80 -0
- package/build/esm/parser/index.d.mts +2 -0
- package/build/esm/parser/index.mjs +2 -0
- package/build/esm/parser/runtime/guard.d.mts +23 -0
- package/build/esm/parser/runtime/guard.mjs +72 -0
- package/build/esm/parser/runtime/index.d.mts +5 -0
- package/build/esm/parser/runtime/index.mjs +5 -0
- package/build/esm/parser/runtime/module.d.mts +9 -0
- package/build/esm/parser/runtime/module.mjs +17 -0
- package/build/esm/parser/runtime/parse.d.mts +9 -0
- package/build/esm/parser/runtime/parse.mjs +123 -0
- package/build/esm/parser/runtime/token.d.mts +8 -0
- package/build/esm/parser/runtime/token.mjs +223 -0
- package/build/esm/parser/runtime/types.d.mts +98 -0
- package/build/esm/parser/runtime/types.mjs +55 -0
- package/build/esm/parser/static/index.d.mts +3 -0
- package/build/esm/parser/static/index.mjs +3 -0
- package/build/esm/parser/static/parse.d.mts +20 -0
- package/build/esm/parser/static/parse.mjs +1 -0
- package/build/esm/parser/static/token.d.mts +108 -0
- package/build/esm/parser/static/token.mjs +1 -0
- package/build/esm/parser/static/types.d.mts +69 -0
- package/build/esm/parser/static/types.mjs +1 -0
- package/build/esm/syntax/index.d.mts +1 -0
- package/build/esm/syntax/index.mjs +1 -0
- package/build/esm/syntax/mapping.d.mts +167 -0
- package/build/esm/syntax/mapping.mjs +386 -0
- package/build/esm/syntax/parser.d.mts +162 -0
- package/build/esm/syntax/parser.mjs +78 -0
- package/build/esm/syntax/syntax.d.mts +12 -0
- package/build/esm/syntax/syntax.mjs +16 -0
- package/build/esm/system/index.d.mts +2 -0
- package/build/esm/system/index.mjs +2 -0
- package/build/esm/system/policy.d.mts +29 -0
- package/build/esm/system/policy.mjs +54 -0
- package/build/esm/system/system.d.mts +16 -0
- package/build/esm/system/system.mjs +37 -0
- package/build/esm/type/any/any.d.mts +8 -0
- package/build/esm/type/any/any.mjs +6 -0
- package/build/esm/type/any/index.d.mts +1 -0
- package/build/esm/type/any/index.mjs +1 -0
- package/build/esm/type/argument/argument.d.mts +9 -0
- package/build/esm/type/argument/argument.mjs +6 -0
- package/build/esm/type/argument/index.d.mts +1 -0
- package/build/esm/type/argument/index.mjs +1 -0
- package/build/esm/type/array/array.d.mts +28 -0
- package/build/esm/type/array/array.mjs +6 -0
- package/build/esm/type/array/index.d.mts +1 -0
- package/build/esm/type/array/index.mjs +1 -0
- package/build/esm/type/async-iterator/async-iterator.d.mts +11 -0
- package/build/esm/type/async-iterator/async-iterator.mjs +6 -0
- package/build/esm/type/async-iterator/index.d.mts +1 -0
- package/build/esm/type/async-iterator/index.mjs +1 -0
- package/build/esm/type/awaited/awaited.d.mts +14 -0
- package/build/esm/type/awaited/awaited.mjs +37 -0
- package/build/esm/type/awaited/index.d.mts +1 -0
- package/build/esm/type/awaited/index.mjs +1 -0
- package/build/esm/type/bigint/bigint.d.mts +16 -0
- package/build/esm/type/bigint/bigint.mjs +6 -0
- package/build/esm/type/bigint/index.d.mts +1 -0
- package/build/esm/type/bigint/index.mjs +1 -0
- package/build/esm/type/boolean/boolean.d.mts +9 -0
- package/build/esm/type/boolean/boolean.mjs +6 -0
- package/build/esm/type/boolean/index.d.mts +1 -0
- package/build/esm/type/boolean/index.mjs +1 -0
- package/build/esm/type/clone/index.d.mts +2 -0
- package/build/esm/type/clone/index.mjs +2 -0
- package/build/esm/type/clone/type.d.mts +5 -0
- package/build/esm/type/clone/type.mjs +9 -0
- package/build/esm/type/clone/value.d.mts +2 -0
- package/build/esm/type/clone/value.mjs +36 -0
- package/build/esm/type/composite/composite.d.mts +18 -0
- package/build/esm/type/composite/composite.mjs +42 -0
- package/build/esm/type/composite/index.d.mts +1 -0
- package/build/esm/type/composite/index.mjs +1 -0
- package/build/esm/type/computed/computed.d.mts +9 -0
- package/build/esm/type/computed/computed.mjs +6 -0
- package/build/esm/type/computed/index.d.mts +1 -0
- package/build/esm/type/computed/index.mjs +1 -0
- package/build/esm/type/const/const.d.mts +27 -0
- package/build/esm/type/const/const.mjs +54 -0
- package/build/esm/type/const/index.d.mts +1 -0
- package/build/esm/type/const/index.mjs +1 -0
- package/build/esm/type/constructor/constructor.d.mts +23 -0
- package/build/esm/type/constructor/constructor.mjs +6 -0
- package/build/esm/type/constructor/index.d.mts +1 -0
- package/build/esm/type/constructor/index.mjs +1 -0
- package/build/esm/type/constructor-parameters/constructor-parameters.d.mts +7 -0
- package/build/esm/type/constructor-parameters/constructor-parameters.mjs +7 -0
- package/build/esm/type/constructor-parameters/index.d.mts +1 -0
- package/build/esm/type/constructor-parameters/index.mjs +1 -0
- package/build/esm/type/create/immutable.d.mts +2 -0
- package/build/esm/type/create/immutable.mjs +33 -0
- package/build/esm/type/create/index.d.mts +1 -0
- package/build/esm/type/create/index.mjs +1 -0
- package/build/esm/type/create/type.d.mts +3 -0
- package/build/esm/type/create/type.mjs +15 -0
- package/build/esm/type/date/date.d.mts +21 -0
- package/build/esm/type/date/date.mjs +6 -0
- package/build/esm/type/date/index.d.mts +1 -0
- package/build/esm/type/date/index.mjs +1 -0
- package/build/esm/type/discard/discard.d.mts +2 -0
- package/build/esm/type/discard/discard.mjs +8 -0
- package/build/esm/type/discard/index.d.mts +1 -0
- package/build/esm/type/discard/index.mjs +1 -0
- package/build/esm/type/enum/enum.d.mts +14 -0
- package/build/esm/type/enum/enum.mjs +18 -0
- package/build/esm/type/enum/index.d.mts +1 -0
- package/build/esm/type/enum/index.mjs +1 -0
- package/build/esm/type/error/error.d.mts +4 -0
- package/build/esm/type/error/error.mjs +6 -0
- package/build/esm/type/error/index.d.mts +1 -0
- package/build/esm/type/error/index.mjs +1 -0
- package/build/esm/type/exclude/exclude-from-mapped-result.d.mts +11 -0
- package/build/esm/type/exclude/exclude-from-mapped-result.mjs +18 -0
- package/build/esm/type/exclude/exclude-from-template-literal.d.mts +5 -0
- package/build/esm/type/exclude/exclude-from-template-literal.mjs +5 -0
- package/build/esm/type/exclude/exclude.d.mts +21 -0
- package/build/esm/type/exclude/exclude.mjs +25 -0
- package/build/esm/type/exclude/index.d.mts +3 -0
- package/build/esm/type/exclude/index.mjs +3 -0
- package/build/esm/type/extends/extends-check.d.mts +10 -0
- package/build/esm/type/extends/extends-check.mjs +635 -0
- package/build/esm/type/extends/extends-from-mapped-key.d.mts +14 -0
- package/build/esm/type/extends/extends-from-mapped-key.mjs +25 -0
- package/build/esm/type/extends/extends-from-mapped-result.d.mts +11 -0
- package/build/esm/type/extends/extends-from-mapped-result.mjs +19 -0
- package/build/esm/type/extends/extends-undefined.d.mts +3 -0
- package/build/esm/type/extends/extends-undefined.mjs +20 -0
- package/build/esm/type/extends/extends.d.mts +16 -0
- package/build/esm/type/extends/extends.mjs +23 -0
- package/build/esm/type/extends/index.d.mts +5 -0
- package/build/esm/type/extends/index.mjs +5 -0
- package/build/esm/type/extract/extract-from-mapped-result.d.mts +11 -0
- package/build/esm/type/extract/extract-from-mapped-result.mjs +18 -0
- package/build/esm/type/extract/extract-from-template-literal.d.mts +5 -0
- package/build/esm/type/extract/extract-from-template-literal.mjs +5 -0
- package/build/esm/type/extract/extract.d.mts +21 -0
- package/build/esm/type/extract/extract.mjs +25 -0
- package/build/esm/type/extract/index.d.mts +3 -0
- package/build/esm/type/extract/index.mjs +3 -0
- package/build/esm/type/function/function.d.mts +23 -0
- package/build/esm/type/function/function.mjs +6 -0
- package/build/esm/type/function/index.d.mts +1 -0
- package/build/esm/type/function/index.mjs +1 -0
- package/build/esm/type/guard/index.d.mts +3 -0
- package/build/esm/type/guard/index.mjs +3 -0
- package/build/esm/type/guard/kind.d.mts +147 -0
- package/build/esm/type/guard/kind.mjs +235 -0
- package/build/esm/type/guard/type.d.mts +152 -0
- package/build/esm/type/guard/type.mjs +509 -0
- package/build/esm/type/guard/value.d.mts +34 -0
- package/build/esm/type/guard/value.mjs +70 -0
- package/build/esm/type/helpers/helpers.d.mts +42 -0
- package/build/esm/type/helpers/helpers.mjs +4 -0
- package/build/esm/type/helpers/index.d.mts +1 -0
- package/build/esm/type/helpers/index.mjs +1 -0
- package/build/esm/type/index.d.mts +71 -0
- package/build/esm/type/index.mjs +71 -0
- package/build/esm/type/indexed/index.d.mts +4 -0
- package/build/esm/type/indexed/index.mjs +4 -0
- package/build/esm/type/indexed/indexed-from-mapped-key.d.mts +13 -0
- package/build/esm/type/indexed/indexed-from-mapped-key.mjs +22 -0
- package/build/esm/type/indexed/indexed-from-mapped-result.d.mts +12 -0
- package/build/esm/type/indexed/indexed-from-mapped-result.mjs +20 -0
- package/build/esm/type/indexed/indexed-property-keys.d.mts +14 -0
- package/build/esm/type/indexed/indexed-property-keys.mjs +32 -0
- package/build/esm/type/indexed/indexed.d.mts +52 -0
- package/build/esm/type/indexed/indexed.mjs +91 -0
- package/build/esm/type/instance-type/index.d.mts +1 -0
- package/build/esm/type/instance-type/index.mjs +1 -0
- package/build/esm/type/instance-type/instance-type.d.mts +6 -0
- package/build/esm/type/instance-type/instance-type.mjs +7 -0
- package/build/esm/type/instantiate/index.d.mts +1 -0
- package/build/esm/type/instantiate/index.mjs +1 -0
- package/build/esm/type/instantiate/instantiate.d.mts +50 -0
- package/build/esm/type/instantiate/instantiate.mjs +115 -0
- package/build/esm/type/integer/index.d.mts +1 -0
- package/build/esm/type/integer/index.mjs +1 -0
- package/build/esm/type/integer/integer.d.mts +16 -0
- package/build/esm/type/integer/integer.mjs +6 -0
- package/build/esm/type/intersect/index.d.mts +3 -0
- package/build/esm/type/intersect/index.mjs +3 -0
- package/build/esm/type/intersect/intersect-create.d.mts +3 -0
- package/build/esm/type/intersect/intersect-create.mjs +19 -0
- package/build/esm/type/intersect/intersect-evaluated.d.mts +13 -0
- package/build/esm/type/intersect/intersect-evaluated.mjs +38 -0
- package/build/esm/type/intersect/intersect-type.d.mts +15 -0
- package/build/esm/type/intersect/intersect-type.mjs +1 -0
- package/build/esm/type/intersect/intersect.d.mts +6 -0
- package/build/esm/type/intersect/intersect.mjs +17 -0
- package/build/esm/type/intrinsic/capitalize.d.mts +5 -0
- package/build/esm/type/intrinsic/capitalize.mjs +5 -0
- package/build/esm/type/intrinsic/index.d.mts +6 -0
- package/build/esm/type/intrinsic/index.mjs +6 -0
- package/build/esm/type/intrinsic/intrinsic-from-mapped-key.d.mts +14 -0
- package/build/esm/type/intrinsic/intrinsic-from-mapped-key.mjs +26 -0
- package/build/esm/type/intrinsic/intrinsic.d.mts +16 -0
- package/build/esm/type/intrinsic/intrinsic.mjs +64 -0
- package/build/esm/type/intrinsic/lowercase.d.mts +5 -0
- package/build/esm/type/intrinsic/lowercase.mjs +5 -0
- package/build/esm/type/intrinsic/uncapitalize.d.mts +5 -0
- package/build/esm/type/intrinsic/uncapitalize.mjs +5 -0
- package/build/esm/type/intrinsic/uppercase.d.mts +5 -0
- package/build/esm/type/intrinsic/uppercase.mjs +5 -0
- package/build/esm/type/iterator/index.d.mts +1 -0
- package/build/esm/type/iterator/index.mjs +1 -0
- package/build/esm/type/iterator/iterator.d.mts +11 -0
- package/build/esm/type/iterator/iterator.mjs +6 -0
- package/build/esm/type/keyof/index.d.mts +4 -0
- package/build/esm/type/keyof/index.mjs +4 -0
- package/build/esm/type/keyof/keyof-from-mapped-result.d.mts +12 -0
- package/build/esm/type/keyof/keyof-from-mapped-result.mjs +19 -0
- package/build/esm/type/keyof/keyof-property-entries.d.mts +7 -0
- package/build/esm/type/keyof/keyof-property-entries.mjs +12 -0
- package/build/esm/type/keyof/keyof-property-keys.d.mts +24 -0
- package/build/esm/type/keyof/keyof-property-keys.mjs +73 -0
- package/build/esm/type/keyof/keyof.d.mts +21 -0
- package/build/esm/type/keyof/keyof.mjs +35 -0
- package/build/esm/type/literal/index.d.mts +1 -0
- package/build/esm/type/literal/index.mjs +1 -0
- package/build/esm/type/literal/literal.d.mts +10 -0
- package/build/esm/type/literal/literal.mjs +10 -0
- package/build/esm/type/mapped/index.d.mts +3 -0
- package/build/esm/type/mapped/index.mjs +3 -0
- package/build/esm/type/mapped/mapped-key.d.mts +8 -0
- package/build/esm/type/mapped/mapped-key.mjs +9 -0
- package/build/esm/type/mapped/mapped-result.d.mts +9 -0
- package/build/esm/type/mapped/mapped-result.mjs +9 -0
- package/build/esm/type/mapped/mapped.d.mts +47 -0
- package/build/esm/type/mapped/mapped.mjs +102 -0
- package/build/esm/type/module/compute.d.mts +59 -0
- package/build/esm/type/module/compute.mjs +166 -0
- package/build/esm/type/module/index.d.mts +1 -0
- package/build/esm/type/module/index.mjs +1 -0
- package/build/esm/type/module/infer.d.mts +49 -0
- package/build/esm/type/module/infer.mjs +1 -0
- package/build/esm/type/module/module.d.mts +27 -0
- package/build/esm/type/module/module.mjs +32 -0
- package/build/esm/type/never/index.d.mts +1 -0
- package/build/esm/type/never/index.mjs +1 -0
- package/build/esm/type/never/never.d.mts +9 -0
- package/build/esm/type/never/never.mjs +6 -0
- package/build/esm/type/not/index.d.mts +1 -0
- package/build/esm/type/not/index.mjs +1 -0
- package/build/esm/type/not/not.d.mts +10 -0
- package/build/esm/type/not/not.mjs +6 -0
- package/build/esm/type/null/index.d.mts +1 -0
- package/build/esm/type/null/index.mjs +1 -0
- package/build/esm/type/null/null.d.mts +9 -0
- package/build/esm/type/null/null.mjs +6 -0
- package/build/esm/type/number/index.d.mts +1 -0
- package/build/esm/type/number/index.mjs +1 -0
- package/build/esm/type/number/number.d.mts +16 -0
- package/build/esm/type/number/number.mjs +6 -0
- package/build/esm/type/object/index.d.mts +1 -0
- package/build/esm/type/object/index.mjs +1 -0
- package/build/esm/type/object/object.d.mts +51 -0
- package/build/esm/type/object/object.mjs +18 -0
- package/build/esm/type/omit/index.d.mts +3 -0
- package/build/esm/type/omit/index.mjs +3 -0
- package/build/esm/type/omit/omit-from-mapped-key.d.mts +12 -0
- package/build/esm/type/omit/omit-from-mapped-key.mjs +22 -0
- package/build/esm/type/omit/omit-from-mapped-result.d.mts +12 -0
- package/build/esm/type/omit/omit-from-mapped-result.mjs +19 -0
- package/build/esm/type/omit/omit.d.mts +36 -0
- package/build/esm/type/omit/omit.mjs +71 -0
- package/build/esm/type/optional/index.d.mts +2 -0
- package/build/esm/type/optional/index.mjs +2 -0
- package/build/esm/type/optional/optional-from-mapped-result.d.mts +10 -0
- package/build/esm/type/optional/optional-from-mapped-result.mjs +18 -0
- package/build/esm/type/optional/optional.d.mts +20 -0
- package/build/esm/type/optional/optional.mjs +22 -0
- package/build/esm/type/parameters/index.d.mts +1 -0
- package/build/esm/type/parameters/index.mjs +1 -0
- package/build/esm/type/parameters/parameters.d.mts +7 -0
- package/build/esm/type/parameters/parameters.mjs +7 -0
- package/build/esm/type/partial/index.d.mts +2 -0
- package/build/esm/type/partial/index.mjs +2 -0
- package/build/esm/type/partial/partial-from-mapped-result.d.mts +12 -0
- package/build/esm/type/partial/partial-from-mapped-result.mjs +19 -0
- package/build/esm/type/partial/partial.d.mts +35 -0
- package/build/esm/type/partial/partial.mjs +74 -0
- package/build/esm/type/patterns/index.d.mts +1 -0
- package/build/esm/type/patterns/index.mjs +1 -0
- package/build/esm/type/patterns/patterns.d.mts +8 -0
- package/build/esm/type/patterns/patterns.mjs +8 -0
- package/build/esm/type/pick/index.d.mts +3 -0
- package/build/esm/type/pick/index.mjs +3 -0
- package/build/esm/type/pick/pick-from-mapped-key.d.mts +12 -0
- package/build/esm/type/pick/pick-from-mapped-key.mjs +24 -0
- package/build/esm/type/pick/pick-from-mapped-result.d.mts +12 -0
- package/build/esm/type/pick/pick-from-mapped-result.mjs +19 -0
- package/build/esm/type/pick/pick.d.mts +36 -0
- package/build/esm/type/pick/pick.mjs +66 -0
- package/build/esm/type/promise/index.d.mts +1 -0
- package/build/esm/type/promise/index.mjs +1 -0
- package/build/esm/type/promise/promise.d.mts +11 -0
- package/build/esm/type/promise/promise.mjs +6 -0
- package/build/esm/type/readonly/index.d.mts +2 -0
- package/build/esm/type/readonly/index.mjs +2 -0
- package/build/esm/type/readonly/readonly-from-mapped-result.d.mts +10 -0
- package/build/esm/type/readonly/readonly-from-mapped-result.mjs +18 -0
- package/build/esm/type/readonly/readonly.d.mts +20 -0
- package/build/esm/type/readonly/readonly.mjs +22 -0
- package/build/esm/type/readonly-optional/index.d.mts +1 -0
- package/build/esm/type/readonly-optional/index.mjs +1 -0
- package/build/esm/type/readonly-optional/readonly-optional.d.mts +6 -0
- package/build/esm/type/readonly-optional/readonly-optional.mjs +6 -0
- package/build/esm/type/record/index.d.mts +1 -0
- package/build/esm/type/record/index.mjs +1 -0
- package/build/esm/type/record/record.d.mts +71 -0
- package/build/esm/type/record/record.mjs +116 -0
- package/build/esm/type/recursive/index.d.mts +1 -0
- package/build/esm/type/recursive/index.mjs +1 -0
- package/build/esm/type/recursive/recursive.d.mts +16 -0
- package/build/esm/type/recursive/recursive.mjs +15 -0
- package/build/esm/type/ref/index.d.mts +1 -0
- package/build/esm/type/ref/index.mjs +1 -0
- package/build/esm/type/ref/ref.d.mts +41 -0
- package/build/esm/type/ref/ref.mjs +10 -0
- package/build/esm/type/regexp/index.d.mts +1 -0
- package/build/esm/type/regexp/index.mjs +1 -0
- package/build/esm/type/regexp/regexp.d.mts +20 -0
- package/build/esm/type/regexp/regexp.mjs +8 -0
- package/build/esm/type/registry/format.d.mts +13 -0
- package/build/esm/type/registry/format.mjs +26 -0
- package/build/esm/type/registry/index.d.mts +2 -0
- package/build/esm/type/registry/index.mjs +2 -0
- package/build/esm/type/registry/type.d.mts +13 -0
- package/build/esm/type/registry/type.mjs +26 -0
- package/build/esm/type/required/index.d.mts +2 -0
- package/build/esm/type/required/index.mjs +2 -0
- package/build/esm/type/required/required-from-mapped-result.d.mts +12 -0
- package/build/esm/type/required/required-from-mapped-result.mjs +18 -0
- package/build/esm/type/required/required.d.mts +35 -0
- package/build/esm/type/required/required.mjs +73 -0
- package/build/esm/type/rest/index.d.mts +1 -0
- package/build/esm/type/rest/index.mjs +1 -0
- package/build/esm/type/rest/rest.d.mts +10 -0
- package/build/esm/type/rest/rest.mjs +15 -0
- package/build/esm/type/return-type/index.d.mts +1 -0
- package/build/esm/type/return-type/index.mjs +1 -0
- package/build/esm/type/return-type/return-type.d.mts +6 -0
- package/build/esm/type/return-type/return-type.mjs +7 -0
- package/build/esm/type/schema/anyschema.d.mts +33 -0
- package/build/esm/type/schema/anyschema.mjs +1 -0
- package/build/esm/type/schema/index.d.mts +2 -0
- package/build/esm/type/schema/index.mjs +2 -0
- package/build/esm/type/schema/schema.d.mts +29 -0
- package/build/esm/type/schema/schema.mjs +1 -0
- package/build/esm/type/sets/index.d.mts +1 -0
- package/build/esm/type/sets/index.mjs +1 -0
- package/build/esm/type/sets/set.d.mts +28 -0
- package/build/esm/type/sets/set.mjs +48 -0
- package/build/esm/type/static/index.d.mts +1 -0
- package/build/esm/type/static/index.mjs +1 -0
- package/build/esm/type/static/static.d.mts +39 -0
- package/build/esm/type/static/static.mjs +1 -0
- package/build/esm/type/string/index.d.mts +1 -0
- package/build/esm/type/string/index.mjs +1 -0
- package/build/esm/type/string/string.d.mts +25 -0
- package/build/esm/type/string/string.mjs +6 -0
- package/build/esm/type/symbol/index.d.mts +1 -0
- package/build/esm/type/symbol/index.mjs +1 -0
- package/build/esm/type/symbol/symbol.d.mts +10 -0
- package/build/esm/type/symbol/symbol.mjs +6 -0
- package/build/esm/type/symbols/index.d.mts +1 -0
- package/build/esm/type/symbols/index.mjs +1 -0
- package/build/esm/type/symbols/symbols.d.mts +10 -0
- package/build/esm/type/symbols/symbols.mjs +10 -0
- package/build/esm/type/template-literal/finite.d.mts +19 -0
- package/build/esm/type/template-literal/finite.mjs +49 -0
- package/build/esm/type/template-literal/generate.d.mts +21 -0
- package/build/esm/type/template-literal/generate.mjs +53 -0
- package/build/esm/type/template-literal/index.d.mts +7 -0
- package/build/esm/type/template-literal/index.mjs +7 -0
- package/build/esm/type/template-literal/parse.d.mts +20 -0
- package/build/esm/type/template-literal/parse.mjs +167 -0
- package/build/esm/type/template-literal/pattern.d.mts +5 -0
- package/build/esm/type/template-literal/pattern.mjs +33 -0
- package/build/esm/type/template-literal/syntax.d.mts +20 -0
- package/build/esm/type/template-literal/syntax.mjs +55 -0
- package/build/esm/type/template-literal/template-literal.d.mts +30 -0
- package/build/esm/type/template-literal/template-literal.mjs +13 -0
- package/build/esm/type/template-literal/union.d.mts +9 -0
- package/build/esm/type/template-literal/union.mjs +9 -0
- package/build/esm/type/transform/index.d.mts +1 -0
- package/build/esm/type/transform/index.mjs +1 -0
- package/build/esm/type/transform/transform.d.mts +30 -0
- package/build/esm/type/transform/transform.mjs +40 -0
- package/build/esm/type/tuple/index.d.mts +1 -0
- package/build/esm/type/tuple/index.mjs +1 -0
- package/build/esm/type/tuple/tuple.d.mts +16 -0
- package/build/esm/type/tuple/tuple.mjs +9 -0
- package/build/esm/type/type/index.d.mts +6 -0
- package/build/esm/type/type/index.mjs +13 -0
- package/build/esm/type/type/javascript.d.mts +64 -0
- package/build/esm/type/type/javascript.mjs +99 -0
- package/build/esm/type/type/json.d.mts +208 -0
- package/build/esm/type/type/json.mjs +221 -0
- package/build/esm/type/type/type.d.mts +59 -0
- package/build/esm/type/type/type.mjs +62 -0
- package/build/esm/type/uint8array/index.d.mts +1 -0
- package/build/esm/type/uint8array/index.mjs +1 -0
- package/build/esm/type/uint8array/uint8array.d.mts +13 -0
- package/build/esm/type/uint8array/uint8array.mjs +6 -0
- package/build/esm/type/undefined/index.d.mts +1 -0
- package/build/esm/type/undefined/index.mjs +1 -0
- package/build/esm/type/undefined/undefined.d.mts +9 -0
- package/build/esm/type/undefined/undefined.mjs +6 -0
- package/build/esm/type/union/index.d.mts +3 -0
- package/build/esm/type/union/index.mjs +3 -0
- package/build/esm/type/union/union-create.d.mts +3 -0
- package/build/esm/type/union/union-create.mjs +5 -0
- package/build/esm/type/union/union-evaluated.d.mts +13 -0
- package/build/esm/type/union/union-evaluated.mjs +36 -0
- package/build/esm/type/union/union-type.d.mts +12 -0
- package/build/esm/type/union/union-type.mjs +1 -0
- package/build/esm/type/union/union.d.mts +6 -0
- package/build/esm/type/union/union.mjs +10 -0
- package/build/esm/type/unknown/index.d.mts +1 -0
- package/build/esm/type/unknown/index.mjs +1 -0
- package/build/esm/type/unknown/unknown.d.mts +8 -0
- package/build/esm/type/unknown/unknown.mjs +6 -0
- package/build/esm/type/unsafe/index.d.mts +1 -0
- package/build/esm/type/unsafe/index.mjs +1 -0
- package/build/esm/type/unsafe/unsafe.d.mts +11 -0
- package/build/esm/type/unsafe/unsafe.mjs +6 -0
- package/build/esm/type/void/index.d.mts +1 -0
- package/build/esm/type/void/index.mjs +1 -0
- package/build/esm/type/void/void.d.mts +9 -0
- package/build/esm/type/void/void.mjs +6 -0
- package/build/esm/value/assert/assert.d.mts +15 -0
- package/build/esm/value/assert/assert.mjs +49 -0
- package/build/esm/value/assert/index.d.mts +1 -0
- package/build/esm/value/assert/index.mjs +1 -0
- package/build/esm/value/cast/cast.d.mts +11 -0
- package/build/esm/value/cast/cast.mjs +235 -0
- package/build/esm/value/cast/index.d.mts +1 -0
- package/build/esm/value/cast/index.mjs +1 -0
- package/build/esm/value/check/check.d.mts +11 -0
- package/build/esm/value/check/check.mjs +470 -0
- package/build/esm/value/check/index.d.mts +1 -0
- package/build/esm/value/check/index.mjs +1 -0
- package/build/esm/value/clean/clean.d.mts +5 -0
- package/build/esm/value/clean/clean.mjs +145 -0
- package/build/esm/value/clean/index.d.mts +1 -0
- package/build/esm/value/clean/index.mjs +1 -0
- package/build/esm/value/clone/clone.d.mts +2 -0
- package/build/esm/value/clone/clone.mjs +56 -0
- package/build/esm/value/clone/index.d.mts +1 -0
- package/build/esm/value/clone/index.mjs +1 -0
- package/build/esm/value/convert/convert.d.mts +5 -0
- package/build/esm/value/convert/convert.mjs +260 -0
- package/build/esm/value/convert/index.d.mts +1 -0
- package/build/esm/value/convert/index.mjs +1 -0
- package/build/esm/value/create/create.d.mts +11 -0
- package/build/esm/value/create/create.mjs +468 -0
- package/build/esm/value/create/index.d.mts +1 -0
- package/build/esm/value/create/index.mjs +1 -0
- package/build/esm/value/decode/decode.d.mts +6 -0
- package/build/esm/value/decode/decode.mjs +10 -0
- package/build/esm/value/decode/index.d.mts +1 -0
- package/build/esm/value/decode/index.mjs +1 -0
- package/build/esm/value/default/default.d.mts +5 -0
- package/build/esm/value/default/default.mjs +172 -0
- package/build/esm/value/default/index.d.mts +1 -0
- package/build/esm/value/default/index.mjs +1 -0
- package/build/esm/value/delta/delta.d.mts +32 -0
- package/build/esm/value/delta/delta.mjs +171 -0
- package/build/esm/value/delta/index.d.mts +1 -0
- package/build/esm/value/delta/index.mjs +1 -0
- package/build/esm/value/deref/deref.d.mts +12 -0
- package/build/esm/value/deref/deref.mjs +29 -0
- package/build/esm/value/deref/index.d.mts +1 -0
- package/build/esm/value/deref/index.mjs +1 -0
- package/build/esm/value/encode/encode.d.mts +6 -0
- package/build/esm/value/encode/encode.mjs +11 -0
- package/build/esm/value/encode/index.d.mts +1 -0
- package/build/esm/value/encode/index.mjs +1 -0
- package/build/esm/value/equal/equal.d.mts +2 -0
- package/build/esm/value/equal/equal.mjs +46 -0
- package/build/esm/value/equal/index.d.mts +1 -0
- package/build/esm/value/equal/index.mjs +1 -0
- package/build/esm/value/guard/guard.d.mts +74 -0
- package/build/esm/value/guard/guard.mjs +158 -0
- package/build/esm/value/guard/index.d.mts +1 -0
- package/build/esm/value/guard/index.mjs +1 -0
- package/build/esm/value/hash/hash.d.mts +7 -0
- package/build/esm/value/hash/hash.mjs +146 -0
- package/build/esm/value/hash/index.d.mts +1 -0
- package/build/esm/value/hash/index.mjs +1 -0
- package/build/esm/value/index.d.mts +20 -0
- package/build/esm/value/index.mjs +32 -0
- package/build/esm/value/mutate/index.d.mts +1 -0
- package/build/esm/value/mutate/index.mjs +1 -0
- package/build/esm/value/mutate/mutate.d.mts +9 -0
- package/build/esm/value/mutate/mutate.mjs +98 -0
- package/build/esm/value/parse/index.d.mts +1 -0
- package/build/esm/value/parse/index.mjs +1 -0
- package/build/esm/value/parse/parse.d.mts +22 -0
- package/build/esm/value/parse/parse.mjs +81 -0
- package/build/esm/value/pointer/index.d.mts +1 -0
- package/build/esm/value/pointer/index.mjs +1 -0
- package/build/esm/value/pointer/pointer.d.mts +22 -0
- package/build/esm/value/pointer/pointer.mjs +115 -0
- package/build/esm/value/transform/decode.d.mts +22 -0
- package/build/esm/value/transform/decode.mjs +207 -0
- package/build/esm/value/transform/encode.d.mts +23 -0
- package/build/esm/value/transform/encode.mjs +218 -0
- package/build/esm/value/transform/has.d.mts +3 -0
- package/build/esm/value/transform/has.mjs +129 -0
- package/build/esm/value/transform/index.d.mts +3 -0
- package/build/esm/value/transform/index.mjs +3 -0
- package/build/esm/value/value/index.d.mts +1 -0
- package/build/esm/value/value/index.mjs +1 -0
- package/build/esm/value/value/value.d.mts +16 -0
- package/build/esm/value/value/value.mjs +16 -0
- package/changes.json +5 -0
- package/compiler/package.json +4 -0
- package/errors/package.json +4 -0
- package/license +25 -0
- package/package.json +128 -0
- package/parser/package.json +4 -0
- package/readme.md +1865 -0
- package/syntax/package.json +4 -0
- package/system/package.json +4 -0
- package/type/package.json +4 -0
- package/value/package.json +4 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Ensure } from '../helpers/index.mjs';
|
|
2
|
+
import type { SchemaOptions, TSchema } from '../schema/index.mjs';
|
|
3
|
+
import type { Static } from '../static/index.mjs';
|
|
4
|
+
import { Kind } from '../symbols/index.mjs';
|
|
5
|
+
export interface ArrayOptions extends SchemaOptions {
|
|
6
|
+
/** The minimum number of items in this array */
|
|
7
|
+
minItems?: number;
|
|
8
|
+
/** The maximum number of items in this array */
|
|
9
|
+
maxItems?: number;
|
|
10
|
+
/** Should this schema contain unique items */
|
|
11
|
+
uniqueItems?: boolean;
|
|
12
|
+
/** A schema for which some elements should match */
|
|
13
|
+
contains?: TSchema;
|
|
14
|
+
/** A minimum number of contains schema matches */
|
|
15
|
+
minContains?: number;
|
|
16
|
+
/** A maximum number of contains schema matches */
|
|
17
|
+
maxContains?: number;
|
|
18
|
+
}
|
|
19
|
+
type ArrayStatic<T extends TSchema, P extends unknown[]> = Ensure<Static<T, P>[]>;
|
|
20
|
+
export interface TArray<T extends TSchema = TSchema> extends TSchema, ArrayOptions {
|
|
21
|
+
[Kind]: 'Array';
|
|
22
|
+
static: ArrayStatic<T, this['params']>;
|
|
23
|
+
type: 'array';
|
|
24
|
+
items: T;
|
|
25
|
+
}
|
|
26
|
+
/** `[Json]` Creates an Array type */
|
|
27
|
+
export declare function Array<Type extends TSchema>(items: Type, options?: ArrayOptions): TArray<Type>;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './array.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './array.mjs';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
|
|
2
|
+
import type { Static } from '../static/index.mjs';
|
|
3
|
+
import { Kind } from '../symbols/index.mjs';
|
|
4
|
+
export interface TAsyncIterator<T extends TSchema = TSchema> extends TSchema {
|
|
5
|
+
[Kind]: 'AsyncIterator';
|
|
6
|
+
static: AsyncIterableIterator<Static<T, this['params']>>;
|
|
7
|
+
type: 'AsyncIterator';
|
|
8
|
+
items: T;
|
|
9
|
+
}
|
|
10
|
+
/** `[JavaScript]` Creates a AsyncIterator type */
|
|
11
|
+
export declare function AsyncIterator<T extends TSchema>(items: T, options?: SchemaOptions): TAsyncIterator<T>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Kind } from '../symbols/index.mjs';
|
|
2
|
+
import { CreateType } from '../create/type.mjs';
|
|
3
|
+
/** `[JavaScript]` Creates a AsyncIterator type */
|
|
4
|
+
export function AsyncIterator(items, options) {
|
|
5
|
+
return CreateType({ [Kind]: 'AsyncIterator', type: 'AsyncIterator', items }, options);
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './async-iterator.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './async-iterator.mjs';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Ensure } from '../helpers/index.mjs';
|
|
2
|
+
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
|
|
3
|
+
import { type TComputed } from '../computed/index.mjs';
|
|
4
|
+
import { type TIntersect } from '../intersect/index.mjs';
|
|
5
|
+
import { type TUnion } from '../union/index.mjs';
|
|
6
|
+
import { type TPromise } from '../promise/index.mjs';
|
|
7
|
+
import { type TRef } from '../ref/index.mjs';
|
|
8
|
+
type TFromComputed<Target extends string, Parameters extends TSchema[]> = Ensure<(TComputed<'Awaited', [TComputed<Target, Parameters>]>)>;
|
|
9
|
+
type TFromRef<Ref extends string> = Ensure<TComputed<'Awaited', [TRef<Ref>]>>;
|
|
10
|
+
type TFromRest<Types extends TSchema[], Result extends TSchema[] = []> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromRest<Right, [...Result, TAwaited<Left>]> : Result);
|
|
11
|
+
export type TAwaited<Type extends TSchema> = (Type extends TComputed<infer Target extends string, infer Parameters extends TSchema[]> ? TFromComputed<Target, Parameters> : Type extends TRef<infer Ref extends string> ? TFromRef<Ref> : Type extends TIntersect<infer Types extends TSchema[]> ? TIntersect<TFromRest<Types>> : Type extends TUnion<infer Types extends TSchema[]> ? TUnion<TFromRest<Types>> : Type extends TPromise<infer Type extends TSchema> ? TAwaited<Type> : Type);
|
|
12
|
+
/** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */
|
|
13
|
+
export declare function Awaited<T extends TSchema>(type: T, options?: SchemaOptions): TAwaited<T>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { CreateType } from '../create/type.mjs';
|
|
2
|
+
import { Computed } from '../computed/index.mjs';
|
|
3
|
+
import { Intersect } from '../intersect/index.mjs';
|
|
4
|
+
import { Union } from '../union/index.mjs';
|
|
5
|
+
import { Ref } from '../ref/index.mjs';
|
|
6
|
+
// ------------------------------------------------------------------
|
|
7
|
+
// TypeGuard
|
|
8
|
+
// ------------------------------------------------------------------
|
|
9
|
+
import { IsIntersect, IsUnion, IsPromise, IsRef, IsComputed } from '../guard/kind.mjs';
|
|
10
|
+
// prettier-ignore
|
|
11
|
+
function FromComputed(target, parameters) {
|
|
12
|
+
return Computed('Awaited', [Computed(target, parameters)]);
|
|
13
|
+
}
|
|
14
|
+
// prettier-ignore
|
|
15
|
+
function FromRef($ref) {
|
|
16
|
+
return Computed('Awaited', [Ref($ref)]);
|
|
17
|
+
}
|
|
18
|
+
// prettier-ignore
|
|
19
|
+
function FromIntersect(types) {
|
|
20
|
+
return Intersect(FromRest(types));
|
|
21
|
+
}
|
|
22
|
+
// prettier-ignore
|
|
23
|
+
function FromUnion(types) {
|
|
24
|
+
return Union(FromRest(types));
|
|
25
|
+
}
|
|
26
|
+
// prettier-ignore
|
|
27
|
+
function FromPromise(type) {
|
|
28
|
+
return Awaited(type);
|
|
29
|
+
}
|
|
30
|
+
// prettier-ignore
|
|
31
|
+
function FromRest(types) {
|
|
32
|
+
return types.map(type => Awaited(type));
|
|
33
|
+
}
|
|
34
|
+
/** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */
|
|
35
|
+
export function Awaited(type, options) {
|
|
36
|
+
return CreateType(IsComputed(type) ? FromComputed(type.target, type.parameters) : IsIntersect(type) ? FromIntersect(type.allOf) : IsUnion(type) ? FromUnion(type.anyOf) : IsPromise(type) ? FromPromise(type.item) : IsRef(type) ? FromRef(type.$ref) : type, options);
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './awaited.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './awaited.mjs';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
|
|
2
|
+
import { Kind } from '../symbols/index.mjs';
|
|
3
|
+
export interface BigIntOptions extends SchemaOptions {
|
|
4
|
+
exclusiveMaximum?: bigint;
|
|
5
|
+
exclusiveMinimum?: bigint;
|
|
6
|
+
maximum?: bigint;
|
|
7
|
+
minimum?: bigint;
|
|
8
|
+
multipleOf?: bigint;
|
|
9
|
+
}
|
|
10
|
+
export interface TBigInt extends TSchema, BigIntOptions {
|
|
11
|
+
[Kind]: 'BigInt';
|
|
12
|
+
static: bigint;
|
|
13
|
+
type: 'bigint';
|
|
14
|
+
}
|
|
15
|
+
/** `[JavaScript]` Creates a BigInt type */
|
|
16
|
+
export declare function BigInt(options?: BigIntOptions): TBigInt;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './bigint.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './bigint.mjs';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
|
|
2
|
+
import { Kind } from '../symbols/index.mjs';
|
|
3
|
+
export interface TBoolean extends TSchema {
|
|
4
|
+
[Kind]: 'Boolean';
|
|
5
|
+
static: boolean;
|
|
6
|
+
type: 'boolean';
|
|
7
|
+
}
|
|
8
|
+
/** `[Json]` Creates a Boolean type */
|
|
9
|
+
export declare function Boolean(options?: SchemaOptions): TBoolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './boolean.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './boolean.mjs';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TSchema, SchemaOptions } from '../schema/index.mjs';
|
|
2
|
+
/** Clones a Rest */
|
|
3
|
+
export declare function CloneRest<T extends TSchema[]>(schemas: T): T;
|
|
4
|
+
/** Clones a Type */
|
|
5
|
+
export declare function CloneType<T extends TSchema>(schema: T, options?: SchemaOptions): T;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Clone } from './value.mjs';
|
|
2
|
+
/** Clones a Rest */
|
|
3
|
+
export function CloneRest(schemas) {
|
|
4
|
+
return schemas.map((schema) => CloneType(schema));
|
|
5
|
+
}
|
|
6
|
+
/** Clones a Type */
|
|
7
|
+
export function CloneType(schema, options) {
|
|
8
|
+
return options === undefined ? Clone(schema) : Clone({ ...options, ...schema });
|
|
9
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as ValueGuard from '../guard/value.mjs';
|
|
2
|
+
function ArrayType(value) {
|
|
3
|
+
return value.map((value) => Visit(value));
|
|
4
|
+
}
|
|
5
|
+
function DateType(value) {
|
|
6
|
+
return new Date(value.getTime());
|
|
7
|
+
}
|
|
8
|
+
function Uint8ArrayType(value) {
|
|
9
|
+
return new Uint8Array(value);
|
|
10
|
+
}
|
|
11
|
+
function RegExpType(value) {
|
|
12
|
+
return new RegExp(value.source, value.flags);
|
|
13
|
+
}
|
|
14
|
+
function ObjectType(value) {
|
|
15
|
+
const result = {};
|
|
16
|
+
for (const key of Object.getOwnPropertyNames(value)) {
|
|
17
|
+
result[key] = Visit(value[key]);
|
|
18
|
+
}
|
|
19
|
+
for (const key of Object.getOwnPropertySymbols(value)) {
|
|
20
|
+
result[key] = Visit(value[key]);
|
|
21
|
+
}
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
// prettier-ignore
|
|
25
|
+
function Visit(value) {
|
|
26
|
+
return (ValueGuard.IsArray(value) ? ArrayType(value) :
|
|
27
|
+
ValueGuard.IsDate(value) ? DateType(value) :
|
|
28
|
+
ValueGuard.IsUint8Array(value) ? Uint8ArrayType(value) :
|
|
29
|
+
ValueGuard.IsRegExp(value) ? RegExpType(value) :
|
|
30
|
+
ValueGuard.IsObject(value) ? ObjectType(value) :
|
|
31
|
+
value);
|
|
32
|
+
}
|
|
33
|
+
/** Clones a value */
|
|
34
|
+
export function Clone(value) {
|
|
35
|
+
return Visit(value);
|
|
36
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TSchema } from '../schema/index.mjs';
|
|
2
|
+
import type { Evaluate } from '../helpers/index.mjs';
|
|
3
|
+
import { type TIntersectEvaluated } from '../intersect/index.mjs';
|
|
4
|
+
import { type TIndexFromPropertyKeys } from '../indexed/index.mjs';
|
|
5
|
+
import { type TKeyOfPropertyKeys } from '../keyof/index.mjs';
|
|
6
|
+
import { type TNever } from '../never/index.mjs';
|
|
7
|
+
import { type TObject, type TProperties, type ObjectOptions } from '../object/index.mjs';
|
|
8
|
+
import { TSetDistinct } from '../sets/index.mjs';
|
|
9
|
+
type TCompositeKeys<T extends TSchema[], Acc extends PropertyKey[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TCompositeKeys<R, [...Acc, ...TKeyOfPropertyKeys<L>]> : TSetDistinct<Acc>);
|
|
10
|
+
type TFilterNever<T extends TSchema[], Acc extends TSchema[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? L extends TNever ? TFilterNever<R, [...Acc]> : TFilterNever<R, [...Acc, L]> : Acc);
|
|
11
|
+
type TCompositeProperty<T extends TSchema[], K extends PropertyKey, Acc extends TSchema[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TCompositeProperty<R, K, [...Acc, ...TIndexFromPropertyKeys<L, [K]>]> : TFilterNever<Acc>);
|
|
12
|
+
type TCompositeProperties<T extends TSchema[], K extends PropertyKey[], Acc = {}> = (K extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TCompositeProperties<T, R, Acc & {
|
|
13
|
+
[_ in L]: TIntersectEvaluated<TCompositeProperty<T, L>>;
|
|
14
|
+
}> : Acc);
|
|
15
|
+
type TCompositeEvaluate<T extends TSchema[], K extends PropertyKey[] = TCompositeKeys<T>, P extends TProperties = Evaluate<TCompositeProperties<T, K>>, R extends TSchema = TObject<P>> = R;
|
|
16
|
+
export type TComposite<T extends TSchema[]> = TCompositeEvaluate<T>;
|
|
17
|
+
export declare function Composite<T extends TSchema[]>(T: [...T], options?: ObjectOptions): TComposite<T>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { IntersectEvaluated } from '../intersect/index.mjs';
|
|
2
|
+
import { IndexFromPropertyKeys } from '../indexed/index.mjs';
|
|
3
|
+
import { KeyOfPropertyKeys } from '../keyof/index.mjs';
|
|
4
|
+
import { Object } from '../object/index.mjs';
|
|
5
|
+
import { SetDistinct } from '../sets/index.mjs';
|
|
6
|
+
// ------------------------------------------------------------------
|
|
7
|
+
// TypeGuard
|
|
8
|
+
// ------------------------------------------------------------------
|
|
9
|
+
import { IsNever } from '../guard/kind.mjs';
|
|
10
|
+
// prettier-ignore
|
|
11
|
+
function CompositeKeys(T) {
|
|
12
|
+
const Acc = [];
|
|
13
|
+
for (const L of T)
|
|
14
|
+
Acc.push(...KeyOfPropertyKeys(L));
|
|
15
|
+
return SetDistinct(Acc);
|
|
16
|
+
}
|
|
17
|
+
// prettier-ignore
|
|
18
|
+
function FilterNever(T) {
|
|
19
|
+
return T.filter(L => !IsNever(L));
|
|
20
|
+
}
|
|
21
|
+
// prettier-ignore
|
|
22
|
+
function CompositeProperty(T, K) {
|
|
23
|
+
const Acc = [];
|
|
24
|
+
for (const L of T)
|
|
25
|
+
Acc.push(...IndexFromPropertyKeys(L, [K]));
|
|
26
|
+
return FilterNever(Acc);
|
|
27
|
+
}
|
|
28
|
+
// prettier-ignore
|
|
29
|
+
function CompositeProperties(T, K) {
|
|
30
|
+
const Acc = {};
|
|
31
|
+
for (const L of K) {
|
|
32
|
+
Acc[L] = IntersectEvaluated(CompositeProperty(T, L));
|
|
33
|
+
}
|
|
34
|
+
return Acc;
|
|
35
|
+
}
|
|
36
|
+
// prettier-ignore
|
|
37
|
+
export function Composite(T, options) {
|
|
38
|
+
const K = CompositeKeys(T);
|
|
39
|
+
const P = CompositeProperties(T, K);
|
|
40
|
+
const R = Object(P, options);
|
|
41
|
+
return R;
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './composite.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './composite.mjs';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
|
|
2
|
+
import { Kind } from '../symbols/symbols.mjs';
|
|
3
|
+
export interface TComputed<Target extends string = string, Parameters extends TSchema[] = []> extends TSchema {
|
|
4
|
+
[Kind]: 'Computed';
|
|
5
|
+
target: Target;
|
|
6
|
+
parameters: Parameters;
|
|
7
|
+
}
|
|
8
|
+
/** `[Internal]` Creates a deferred computed type. This type is used exclusively in modules to defer resolution of computable types that contain interior references */
|
|
9
|
+
export declare function Computed<Target extends string, Parameters extends TSchema[]>(target: Target, parameters: [...Parameters], options?: SchemaOptions): TComputed<Target, Parameters>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CreateType } from '../create/index.mjs';
|
|
2
|
+
import { Kind } from '../symbols/symbols.mjs';
|
|
3
|
+
/** `[Internal]` Creates a deferred computed type. This type is used exclusively in modules to defer resolution of computable types that contain interior references */
|
|
4
|
+
export function Computed(target, parameters, options) {
|
|
5
|
+
return CreateType({ [Kind]: 'Computed', target, parameters }, options);
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './computed.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './computed.mjs';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { AssertRest, Evaluate } from '../helpers/index.mjs';
|
|
2
|
+
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
|
|
3
|
+
import { type TAny } from '../any/index.mjs';
|
|
4
|
+
import { type TBigInt } from '../bigint/index.mjs';
|
|
5
|
+
import { type TDate } from '../date/index.mjs';
|
|
6
|
+
import { type TFunction } from '../function/index.mjs';
|
|
7
|
+
import { type TLiteral } from '../literal/index.mjs';
|
|
8
|
+
import { type TNever } from '../never/index.mjs';
|
|
9
|
+
import { type TNull } from '../null/index.mjs';
|
|
10
|
+
import { type TObject } from '../object/index.mjs';
|
|
11
|
+
import { type TSymbol } from '../symbol/index.mjs';
|
|
12
|
+
import { type TTuple } from '../tuple/index.mjs';
|
|
13
|
+
import { type TReadonly } from '../readonly/index.mjs';
|
|
14
|
+
import { type TUndefined } from '../undefined/index.mjs';
|
|
15
|
+
import { type TUint8Array } from '../uint8array/index.mjs';
|
|
16
|
+
import { type TUnknown } from '../unknown/index.mjs';
|
|
17
|
+
type TFromArray<T extends readonly unknown[]> = T extends readonly [infer L extends unknown, ...infer R extends unknown[]] ? [FromValue<L, false>, ...TFromArray<R>] : T;
|
|
18
|
+
type TFromProperties<T extends Record<PropertyKey, unknown>> = {
|
|
19
|
+
-readonly [K in keyof T]: FromValue<T[K], false> extends infer R extends TSchema ? TReadonly<R> : TReadonly<TNever>;
|
|
20
|
+
};
|
|
21
|
+
type TConditionalReadonly<T extends TSchema, Root extends boolean> = Root extends true ? T : TReadonly<T>;
|
|
22
|
+
type FromValue<T, Root extends boolean> = T extends AsyncIterableIterator<unknown> ? TConditionalReadonly<TAny, Root> : T extends IterableIterator<unknown> ? TConditionalReadonly<TAny, Root> : T extends readonly unknown[] ? TReadonly<TTuple<AssertRest<TFromArray<T>>>> : T extends Uint8Array ? TUint8Array : T extends Date ? TDate : T extends Record<PropertyKey, unknown> ? TConditionalReadonly<TObject<Evaluate<TFromProperties<T>>>, Root> : T extends Function ? TConditionalReadonly<TFunction<[], TUnknown>, Root> : T extends undefined ? TUndefined : T extends null ? TNull : T extends symbol ? TSymbol : T extends number ? TLiteral<T> : T extends boolean ? TLiteral<T> : T extends string ? TLiteral<T> : T extends bigint ? TBigInt : TObject<{}>;
|
|
23
|
+
declare function FromValue<T, Root extends boolean>(value: T, root: Root): FromValue<T, Root>;
|
|
24
|
+
export type TConst<T> = FromValue<T, true>;
|
|
25
|
+
/** `[JavaScript]` Creates a readonly const type from the given value. */
|
|
26
|
+
export declare function Const</* const (not supported in 4.0) */ T>(T: T, options?: SchemaOptions): TConst<T>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Any } from '../any/index.mjs';
|
|
2
|
+
import { BigInt } from '../bigint/index.mjs';
|
|
3
|
+
import { Date } from '../date/index.mjs';
|
|
4
|
+
import { Function as FunctionType } from '../function/index.mjs';
|
|
5
|
+
import { Literal } from '../literal/index.mjs';
|
|
6
|
+
import { Null } from '../null/index.mjs';
|
|
7
|
+
import { Object } from '../object/index.mjs';
|
|
8
|
+
import { Symbol } from '../symbol/index.mjs';
|
|
9
|
+
import { Tuple } from '../tuple/index.mjs';
|
|
10
|
+
import { Readonly } from '../readonly/index.mjs';
|
|
11
|
+
import { Undefined } from '../undefined/index.mjs';
|
|
12
|
+
import { Uint8Array } from '../uint8array/index.mjs';
|
|
13
|
+
import { Unknown } from '../unknown/index.mjs';
|
|
14
|
+
import { CreateType } from '../create/index.mjs';
|
|
15
|
+
// ------------------------------------------------------------------
|
|
16
|
+
// ValueGuard
|
|
17
|
+
// ------------------------------------------------------------------
|
|
18
|
+
import { IsArray, IsNumber, IsBigInt, IsUint8Array, IsDate, IsIterator, IsObject, IsAsyncIterator, IsFunction, IsUndefined, IsNull, IsSymbol, IsBoolean, IsString } from '../guard/value.mjs';
|
|
19
|
+
// prettier-ignore
|
|
20
|
+
function FromArray(T) {
|
|
21
|
+
return T.map(L => FromValue(L, false));
|
|
22
|
+
}
|
|
23
|
+
// prettier-ignore
|
|
24
|
+
function FromProperties(value) {
|
|
25
|
+
const Acc = {};
|
|
26
|
+
for (const K of globalThis.Object.getOwnPropertyNames(value))
|
|
27
|
+
Acc[K] = Readonly(FromValue(value[K], false));
|
|
28
|
+
return Acc;
|
|
29
|
+
}
|
|
30
|
+
function ConditionalReadonly(T, root) {
|
|
31
|
+
return (root === true ? T : Readonly(T));
|
|
32
|
+
}
|
|
33
|
+
// prettier-ignore
|
|
34
|
+
function FromValue(value, root) {
|
|
35
|
+
return (IsAsyncIterator(value) ? ConditionalReadonly(Any(), root) :
|
|
36
|
+
IsIterator(value) ? ConditionalReadonly(Any(), root) :
|
|
37
|
+
IsArray(value) ? Readonly(Tuple(FromArray(value))) :
|
|
38
|
+
IsUint8Array(value) ? Uint8Array() :
|
|
39
|
+
IsDate(value) ? Date() :
|
|
40
|
+
IsObject(value) ? ConditionalReadonly(Object(FromProperties(value)), root) :
|
|
41
|
+
IsFunction(value) ? ConditionalReadonly(FunctionType([], Unknown()), root) :
|
|
42
|
+
IsUndefined(value) ? Undefined() :
|
|
43
|
+
IsNull(value) ? Null() :
|
|
44
|
+
IsSymbol(value) ? Symbol() :
|
|
45
|
+
IsBigInt(value) ? BigInt() :
|
|
46
|
+
IsNumber(value) ? Literal(value) :
|
|
47
|
+
IsBoolean(value) ? Literal(value) :
|
|
48
|
+
IsString(value) ? Literal(value) :
|
|
49
|
+
Object({}));
|
|
50
|
+
}
|
|
51
|
+
/** `[JavaScript]` Creates a readonly const type from the given value. */
|
|
52
|
+
export function Const(T, options) {
|
|
53
|
+
return CreateType(FromValue(T, true), options);
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './const.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './const.mjs';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
|
|
2
|
+
import type { Static } from '../static/index.mjs';
|
|
3
|
+
import type { Ensure } from '../helpers/index.mjs';
|
|
4
|
+
import type { TReadonlyOptional } from '../readonly-optional/index.mjs';
|
|
5
|
+
import type { TReadonly } from '../readonly/index.mjs';
|
|
6
|
+
import type { TOptional } from '../optional/index.mjs';
|
|
7
|
+
import { Kind } from '../symbols/index.mjs';
|
|
8
|
+
type StaticReturnType<U extends TSchema, P extends unknown[]> = Static<U, P>;
|
|
9
|
+
type StaticParameter<T extends TSchema, P extends unknown[]> = T extends TReadonlyOptional<T> ? [Readonly<Static<T, P>>?] : T extends TReadonly<T> ? [Readonly<Static<T, P>>] : T extends TOptional<T> ? [Static<T, P>?] : [
|
|
10
|
+
Static<T, P>
|
|
11
|
+
];
|
|
12
|
+
type StaticParameters<T extends TSchema[], P extends unknown[], Acc extends unknown[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? StaticParameters<R, P, [...Acc, ...StaticParameter<L, P>]> : Acc);
|
|
13
|
+
type StaticConstructor<T extends TSchema[], U extends TSchema, P extends unknown[]> = Ensure<new (...param: StaticParameters<T, P>) => StaticReturnType<U, P>>;
|
|
14
|
+
export interface TConstructor<T extends TSchema[] = TSchema[], U extends TSchema = TSchema> extends TSchema {
|
|
15
|
+
[Kind]: 'Constructor';
|
|
16
|
+
static: StaticConstructor<T, U, this['params']>;
|
|
17
|
+
type: 'Constructor';
|
|
18
|
+
parameters: T;
|
|
19
|
+
returns: U;
|
|
20
|
+
}
|
|
21
|
+
/** `[JavaScript]` Creates a Constructor type */
|
|
22
|
+
export declare function Constructor<T extends TSchema[], U extends TSchema>(parameters: [...T], returns: U, options?: SchemaOptions): TConstructor<T, U>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CreateType } from '../create/type.mjs';
|
|
2
|
+
import { Kind } from '../symbols/index.mjs';
|
|
3
|
+
/** `[JavaScript]` Creates a Constructor type */
|
|
4
|
+
export function Constructor(parameters, returns, options) {
|
|
5
|
+
return CreateType({ [Kind]: 'Constructor', type: 'Constructor', parameters, returns }, options);
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './constructor.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './constructor.mjs';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
|
|
2
|
+
import type { TConstructor } from '../constructor/index.mjs';
|
|
3
|
+
import { type TTuple } from '../tuple/index.mjs';
|
|
4
|
+
import { type TNever } from '../never/index.mjs';
|
|
5
|
+
export type TConstructorParameters<Type extends TSchema> = (Type extends TConstructor<infer Parameters extends TSchema[], infer _InstanceType extends TSchema> ? TTuple<Parameters> : TNever);
|
|
6
|
+
/** `[JavaScript]` Extracts the ConstructorParameters from the given Constructor type */
|
|
7
|
+
export declare function ConstructorParameters<Type extends TSchema>(schema: Type, options?: SchemaOptions): TConstructorParameters<Type>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Tuple } from '../tuple/index.mjs';
|
|
2
|
+
import { Never } from '../never/index.mjs';
|
|
3
|
+
import * as KindGuard from '../guard/kind.mjs';
|
|
4
|
+
/** `[JavaScript]` Extracts the ConstructorParameters from the given Constructor type */
|
|
5
|
+
export function ConstructorParameters(schema, options) {
|
|
6
|
+
return (KindGuard.IsConstructor(schema) ? Tuple(schema.parameters, options) : Never(options));
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './constructor-parameters.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './constructor-parameters.mjs';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as ValueGuard from '../guard/value.mjs';
|
|
2
|
+
function ImmutableArray(value) {
|
|
3
|
+
return globalThis.Object.freeze(value).map((value) => Immutable(value));
|
|
4
|
+
}
|
|
5
|
+
function ImmutableDate(value) {
|
|
6
|
+
return value;
|
|
7
|
+
}
|
|
8
|
+
function ImmutableUint8Array(value) {
|
|
9
|
+
return value;
|
|
10
|
+
}
|
|
11
|
+
function ImmutableRegExp(value) {
|
|
12
|
+
return value;
|
|
13
|
+
}
|
|
14
|
+
function ImmutableObject(value) {
|
|
15
|
+
const result = {};
|
|
16
|
+
for (const key of Object.getOwnPropertyNames(value)) {
|
|
17
|
+
result[key] = Immutable(value[key]);
|
|
18
|
+
}
|
|
19
|
+
for (const key of Object.getOwnPropertySymbols(value)) {
|
|
20
|
+
result[key] = Immutable(value[key]);
|
|
21
|
+
}
|
|
22
|
+
return globalThis.Object.freeze(result);
|
|
23
|
+
}
|
|
24
|
+
/** Specialized deep immutable value. Applies freeze recursively to the given value */
|
|
25
|
+
// prettier-ignore
|
|
26
|
+
export function Immutable(value) {
|
|
27
|
+
return (ValueGuard.IsArray(value) ? ImmutableArray(value) :
|
|
28
|
+
ValueGuard.IsDate(value) ? ImmutableDate(value) :
|
|
29
|
+
ValueGuard.IsUint8Array(value) ? ImmutableUint8Array(value) :
|
|
30
|
+
ValueGuard.IsRegExp(value) ? ImmutableRegExp(value) :
|
|
31
|
+
ValueGuard.IsObject(value) ? ImmutableObject(value) :
|
|
32
|
+
value);
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './type.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './type.mjs';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TypeSystemPolicy } from '../../system/policy.mjs';
|
|
2
|
+
import { Immutable } from './immutable.mjs';
|
|
3
|
+
import { Clone } from '../clone/value.mjs';
|
|
4
|
+
/** Creates TypeBox schematics using the configured InstanceMode */
|
|
5
|
+
export function CreateType(schema, options) {
|
|
6
|
+
const result = options !== undefined ? { ...options, ...schema } : schema;
|
|
7
|
+
switch (TypeSystemPolicy.InstanceMode) {
|
|
8
|
+
case 'freeze':
|
|
9
|
+
return Immutable(result);
|
|
10
|
+
case 'clone':
|
|
11
|
+
return Clone(result);
|
|
12
|
+
default:
|
|
13
|
+
return result;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
|
|
2
|
+
import { Kind } from '../symbols/index.mjs';
|
|
3
|
+
export interface DateOptions extends SchemaOptions {
|
|
4
|
+
/** The exclusive maximum timestamp value */
|
|
5
|
+
exclusiveMaximumTimestamp?: number;
|
|
6
|
+
/** The exclusive minimum timestamp value */
|
|
7
|
+
exclusiveMinimumTimestamp?: number;
|
|
8
|
+
/** The maximum timestamp value */
|
|
9
|
+
maximumTimestamp?: number;
|
|
10
|
+
/** The minimum timestamp value */
|
|
11
|
+
minimumTimestamp?: number;
|
|
12
|
+
/** The multiple of timestamp value */
|
|
13
|
+
multipleOfTimestamp?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface TDate extends TSchema, DateOptions {
|
|
16
|
+
[Kind]: 'Date';
|
|
17
|
+
static: Date;
|
|
18
|
+
type: 'date';
|
|
19
|
+
}
|
|
20
|
+
/** `[JavaScript]` Creates a Date type */
|
|
21
|
+
export declare function Date(options?: DateOptions): TDate;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './date.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './date.mjs';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
function DiscardKey(value, key) {
|
|
2
|
+
const { [key]: _, ...rest } = value;
|
|
3
|
+
return rest;
|
|
4
|
+
}
|
|
5
|
+
/** Discards property keys from the given value. This function returns a shallow Clone. */
|
|
6
|
+
export function Discard(value, keys) {
|
|
7
|
+
return keys.reduce((acc, key) => DiscardKey(acc, key), value);
|
|
8
|
+
}
|