@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 @@
|
|
|
1
|
+
export * from './null.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './null.mjs';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
|
|
2
|
+
import { Kind } from '../symbols/index.mjs';
|
|
3
|
+
export interface TNull extends TSchema {
|
|
4
|
+
[Kind]: 'Null';
|
|
5
|
+
static: null;
|
|
6
|
+
type: 'null';
|
|
7
|
+
}
|
|
8
|
+
/** `[Json]` Creates a Null type */
|
|
9
|
+
export declare function Null(options?: SchemaOptions): TNull;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './number.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './number.mjs';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
|
|
2
|
+
import { Kind } from '../symbols/index.mjs';
|
|
3
|
+
export interface NumberOptions extends SchemaOptions {
|
|
4
|
+
exclusiveMaximum?: number;
|
|
5
|
+
exclusiveMinimum?: number;
|
|
6
|
+
maximum?: number;
|
|
7
|
+
minimum?: number;
|
|
8
|
+
multipleOf?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface TNumber extends TSchema, NumberOptions {
|
|
11
|
+
[Kind]: 'Number';
|
|
12
|
+
static: number;
|
|
13
|
+
type: 'number';
|
|
14
|
+
}
|
|
15
|
+
/** `[Json]` Creates a Number type */
|
|
16
|
+
export declare function Number(options?: NumberOptions): TNumber;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './object.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './object.mjs';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
|
|
2
|
+
import type { Static } from '../static/index.mjs';
|
|
3
|
+
import type { Evaluate, UnionToTuple } from '../helpers/index.mjs';
|
|
4
|
+
import type { TReadonly } from '../readonly/index.mjs';
|
|
5
|
+
import type { TOptional } from '../optional/index.mjs';
|
|
6
|
+
import { Kind } from '../symbols/index.mjs';
|
|
7
|
+
type ReadonlyOptionalPropertyKeys<T extends TProperties> = {
|
|
8
|
+
[K in keyof T]: T[K] extends TReadonly<TSchema> ? (T[K] extends TOptional<T[K]> ? K : never) : never;
|
|
9
|
+
}[keyof T];
|
|
10
|
+
type ReadonlyPropertyKeys<T extends TProperties> = {
|
|
11
|
+
[K in keyof T]: T[K] extends TReadonly<TSchema> ? (T[K] extends TOptional<T[K]> ? never : K) : never;
|
|
12
|
+
}[keyof T];
|
|
13
|
+
type OptionalPropertyKeys<T extends TProperties> = {
|
|
14
|
+
[K in keyof T]: T[K] extends TOptional<TSchema> ? (T[K] extends TReadonly<T[K]> ? never : K) : never;
|
|
15
|
+
}[keyof T];
|
|
16
|
+
type RequiredPropertyKeys<T extends TProperties> = keyof Omit<T, ReadonlyOptionalPropertyKeys<T> | ReadonlyPropertyKeys<T> | OptionalPropertyKeys<T>>;
|
|
17
|
+
type ObjectStaticProperties<T extends TProperties, R extends Record<keyof any, unknown>> = Evaluate<(Readonly<Partial<Pick<R, ReadonlyOptionalPropertyKeys<T>>>> & Readonly<Pick<R, ReadonlyPropertyKeys<T>>> & Partial<Pick<R, OptionalPropertyKeys<T>>> & Required<Pick<R, RequiredPropertyKeys<T>>>)>;
|
|
18
|
+
type ObjectStatic<T extends TProperties, P extends unknown[]> = ObjectStaticProperties<T, {
|
|
19
|
+
[K in keyof T]: Static<T[K], P>;
|
|
20
|
+
}>;
|
|
21
|
+
export type TPropertyKey = string | number;
|
|
22
|
+
export type TProperties = Record<TPropertyKey, TSchema>;
|
|
23
|
+
type TIsLiteralString<Type extends string> = ([
|
|
24
|
+
Type
|
|
25
|
+
] extends [string] ? [string] extends [Type] ? false : true : false);
|
|
26
|
+
type IsRequiredArrayLiteralConstant<RequiredTuple extends string[]> = (RequiredTuple extends [infer Left extends string, ...infer _ extends string[]] ? TIsLiteralString<Left> : false);
|
|
27
|
+
type TRequiredArray<Properties extends TProperties, RequiredProperties extends TProperties = {
|
|
28
|
+
[Key in keyof Properties as Properties[Key] extends TOptional<Properties[Key]> ? never : Key]: Properties[Key];
|
|
29
|
+
}, RequiredUnion extends string = Extract<keyof RequiredProperties, string>, RequiredTuple extends string[] = UnionToTuple<RequiredUnion>, Result extends string[] | undefined = (IsRequiredArrayLiteralConstant<RequiredTuple> extends true ? RequiredTuple : string[] | undefined)> = Result;
|
|
30
|
+
export type TAdditionalProperties = undefined | TSchema | boolean;
|
|
31
|
+
export interface ObjectOptions extends SchemaOptions {
|
|
32
|
+
/** Additional property constraints for this object */
|
|
33
|
+
additionalProperties?: TAdditionalProperties;
|
|
34
|
+
/** The minimum number of properties allowed on this object */
|
|
35
|
+
minProperties?: number;
|
|
36
|
+
/** The maximum number of properties allowed on this object */
|
|
37
|
+
maxProperties?: number;
|
|
38
|
+
}
|
|
39
|
+
export interface TObject<T extends TProperties = TProperties> extends TSchema, ObjectOptions {
|
|
40
|
+
[Kind]: 'Object';
|
|
41
|
+
static: ObjectStatic<T, this['params']>;
|
|
42
|
+
additionalProperties?: TAdditionalProperties;
|
|
43
|
+
type: 'object';
|
|
44
|
+
properties: T;
|
|
45
|
+
required: TRequiredArray<T>;
|
|
46
|
+
}
|
|
47
|
+
/** `[Json]` Creates an Object type */
|
|
48
|
+
declare function _Object<T extends TProperties>(properties: T, options?: ObjectOptions): TObject<T>;
|
|
49
|
+
/** `[Json]` Creates an Object type */
|
|
50
|
+
export declare var Object: typeof _Object;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CreateType } from '../create/type.mjs';
|
|
2
|
+
import { Kind } from '../symbols/index.mjs';
|
|
3
|
+
// ------------------------------------------------------------------
|
|
4
|
+
// TypeGuard
|
|
5
|
+
// ------------------------------------------------------------------
|
|
6
|
+
import { IsOptional } from '../guard/kind.mjs';
|
|
7
|
+
/** Creates a RequiredArray derived from the given TProperties value. */
|
|
8
|
+
function RequiredArray(properties) {
|
|
9
|
+
return globalThis.Object.keys(properties).filter((key) => !IsOptional(properties[key]));
|
|
10
|
+
}
|
|
11
|
+
/** `[Json]` Creates an Object type */
|
|
12
|
+
function _Object(properties, options) {
|
|
13
|
+
const required = RequiredArray(properties);
|
|
14
|
+
const schema = required.length > 0 ? { [Kind]: 'Object', type: 'object', required, properties } : { [Kind]: 'Object', type: 'object', properties };
|
|
15
|
+
return CreateType(schema, options);
|
|
16
|
+
}
|
|
17
|
+
/** `[Json]` Creates an Object type */
|
|
18
|
+
export var Object = _Object;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
|
|
2
|
+
import type { TProperties } from '../object/index.mjs';
|
|
3
|
+
import { type TMappedResult, type TMappedKey } from '../mapped/index.mjs';
|
|
4
|
+
import { type TOmit } from './omit.mjs';
|
|
5
|
+
type TFromPropertyKey<Type extends TSchema, Key extends PropertyKey> = {
|
|
6
|
+
[_ in Key]: TOmit<Type, [Key]>;
|
|
7
|
+
};
|
|
8
|
+
type TFromPropertyKeys<Type extends TSchema, PropertyKeys extends PropertyKey[], Result extends TProperties = {}> = (PropertyKeys extends [infer LK extends PropertyKey, ...infer RK extends PropertyKey[]] ? TFromPropertyKeys<Type, RK, Result & TFromPropertyKey<Type, LK>> : Result);
|
|
9
|
+
type TFromMappedKey<Type extends TSchema, MappedKey extends TMappedKey> = (TFromPropertyKeys<Type, MappedKey['keys']>);
|
|
10
|
+
export type TOmitFromMappedKey<Type extends TSchema, MappedKey extends TMappedKey, Properties extends TProperties = TFromMappedKey<Type, MappedKey>> = (TMappedResult<Properties>);
|
|
11
|
+
export declare function OmitFromMappedKey<Type extends TSchema, MappedKey extends TMappedKey, Properties extends TProperties = TFromMappedKey<Type, MappedKey>>(type: Type, mappedKey: MappedKey, options?: SchemaOptions): TMappedResult<Properties>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MappedResult } from '../mapped/index.mjs';
|
|
2
|
+
import { Omit } from './omit.mjs';
|
|
3
|
+
import { Clone } from '../clone/value.mjs';
|
|
4
|
+
// prettier-ignore
|
|
5
|
+
function FromPropertyKey(type, key, options) {
|
|
6
|
+
return { [key]: Omit(type, [key], Clone(options)) };
|
|
7
|
+
}
|
|
8
|
+
// prettier-ignore
|
|
9
|
+
function FromPropertyKeys(type, propertyKeys, options) {
|
|
10
|
+
return propertyKeys.reduce((Acc, LK) => {
|
|
11
|
+
return { ...Acc, ...FromPropertyKey(type, LK, options) };
|
|
12
|
+
}, {});
|
|
13
|
+
}
|
|
14
|
+
// prettier-ignore
|
|
15
|
+
function FromMappedKey(type, mappedKey, options) {
|
|
16
|
+
return FromPropertyKeys(type, mappedKey.keys, options);
|
|
17
|
+
}
|
|
18
|
+
// prettier-ignore
|
|
19
|
+
export function OmitFromMappedKey(type, mappedKey, options) {
|
|
20
|
+
const properties = FromMappedKey(type, mappedKey, options);
|
|
21
|
+
return MappedResult(properties);
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SchemaOptions } from '../schema/index.mjs';
|
|
2
|
+
import type { Ensure, Evaluate } from '../helpers/index.mjs';
|
|
3
|
+
import type { TProperties } from '../object/index.mjs';
|
|
4
|
+
import { type TMappedResult } from '../mapped/index.mjs';
|
|
5
|
+
import { type TOmit } from './omit.mjs';
|
|
6
|
+
type TFromProperties<Properties extends TProperties, PropertyKeys extends PropertyKey[]> = ({
|
|
7
|
+
[K2 in keyof Properties]: TOmit<Properties[K2], PropertyKeys>;
|
|
8
|
+
});
|
|
9
|
+
type TFromMappedResult<MappedResult extends TMappedResult, PropertyKeys extends PropertyKey[]> = (Evaluate<TFromProperties<MappedResult['properties'], PropertyKeys>>);
|
|
10
|
+
export type TOmitFromMappedResult<MappedResult extends TMappedResult, PropertyKeys extends PropertyKey[], Properties extends TProperties = TFromMappedResult<MappedResult, PropertyKeys>> = (Ensure<TMappedResult<Properties>>);
|
|
11
|
+
export declare function OmitFromMappedResult<MappedResult extends TMappedResult, PropertyKeys extends PropertyKey[], Properties extends TProperties = TFromMappedResult<MappedResult, PropertyKeys>>(mappedResult: MappedResult, propertyKeys: [...PropertyKeys], options?: SchemaOptions): TMappedResult<Properties>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MappedResult } from '../mapped/index.mjs';
|
|
2
|
+
import { Omit } from './omit.mjs';
|
|
3
|
+
import { Clone } from '../clone/value.mjs';
|
|
4
|
+
// prettier-ignore
|
|
5
|
+
function FromProperties(properties, propertyKeys, options) {
|
|
6
|
+
const result = {};
|
|
7
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
|
|
8
|
+
result[K2] = Omit(properties[K2], propertyKeys, Clone(options));
|
|
9
|
+
return result;
|
|
10
|
+
}
|
|
11
|
+
// prettier-ignore
|
|
12
|
+
function FromMappedResult(mappedResult, propertyKeys, options) {
|
|
13
|
+
return FromProperties(mappedResult.properties, propertyKeys, options);
|
|
14
|
+
}
|
|
15
|
+
// prettier-ignore
|
|
16
|
+
export function OmitFromMappedResult(mappedResult, propertyKeys, options) {
|
|
17
|
+
const properties = FromMappedResult(mappedResult, propertyKeys, options);
|
|
18
|
+
return MappedResult(properties);
|
|
19
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { SchemaOptions, TSchema } from '../schema/index.mjs';
|
|
2
|
+
import type { TupleToUnion, Evaluate } from '../helpers/index.mjs';
|
|
3
|
+
import { type TRecursive } from '../recursive/index.mjs';
|
|
4
|
+
import type { TMappedKey, TMappedResult } from '../mapped/index.mjs';
|
|
5
|
+
import { TComputed } from '../computed/index.mjs';
|
|
6
|
+
import { TLiteral, TLiteralValue } from '../literal/index.mjs';
|
|
7
|
+
import { type TIndexPropertyKeys } from '../indexed/index.mjs';
|
|
8
|
+
import { type TIntersect } from '../intersect/index.mjs';
|
|
9
|
+
import { type TUnion } from '../union/index.mjs';
|
|
10
|
+
import { type TObject, type TProperties } from '../object/index.mjs';
|
|
11
|
+
import { type TRef } from '../ref/index.mjs';
|
|
12
|
+
import { type TOmitFromMappedKey } from './omit-from-mapped-key.mjs';
|
|
13
|
+
import { type TOmitFromMappedResult } from './omit-from-mapped-result.mjs';
|
|
14
|
+
type TFromIntersect<Types extends TSchema[], PropertyKeys extends PropertyKey[], Result extends TSchema[] = []> = (Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromIntersect<R, PropertyKeys, [...Result, TOmit<L, PropertyKeys>]> : Result);
|
|
15
|
+
type TFromUnion<T extends TSchema[], K extends PropertyKey[], Result extends TSchema[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromUnion<R, K, [...Result, TOmit<L, K>]> : Result);
|
|
16
|
+
type TFromProperties<Properties extends TProperties, PropertyKeys extends PropertyKey[], UnionKey extends PropertyKey = TupleToUnion<PropertyKeys>> = (Evaluate<Omit<Properties, UnionKey>>);
|
|
17
|
+
type TFromObject<_Type extends TObject, PropertyKeys extends PropertyKey[], Properties extends TProperties, MappedProperties extends TProperties = TFromProperties<Properties, PropertyKeys>, Result extends TSchema = TObject<MappedProperties>> = Result;
|
|
18
|
+
type TUnionFromPropertyKeys<PropertyKeys extends PropertyKey[], Result extends TLiteral[] = []> = (PropertyKeys extends [infer Key extends PropertyKey, ...infer Rest extends PropertyKey[]] ? Key extends TLiteralValue ? TUnionFromPropertyKeys<Rest, [...Result, TLiteral<Key>]> : TUnionFromPropertyKeys<Rest, [...Result]> : TUnion<Result>);
|
|
19
|
+
export type TOmitResolve<Properties extends TProperties, PropertyKeys extends PropertyKey[]> = (Properties extends TRecursive<infer Types extends TSchema> ? TRecursive<TOmitResolve<Types, PropertyKeys>> : Properties extends TIntersect<infer Types extends TSchema[]> ? TIntersect<TFromIntersect<Types, PropertyKeys>> : Properties extends TUnion<infer Types extends TSchema[]> ? TUnion<TFromUnion<Types, PropertyKeys>> : Properties extends TObject<infer Properties extends TProperties> ? TFromObject<TObject, PropertyKeys, Properties> : TObject<{}>);
|
|
20
|
+
type TResolvePropertyKeys<Key extends TSchema | PropertyKey[]> = Key extends TSchema ? TIndexPropertyKeys<Key> : Key;
|
|
21
|
+
type TResolveTypeKey<Key extends TSchema | PropertyKey[]> = Key extends PropertyKey[] ? TUnionFromPropertyKeys<Key> : Key;
|
|
22
|
+
export type TOmit<Type extends TSchema, Key extends TSchema | PropertyKey[], IsTypeRef extends boolean = Type extends TRef ? true : false, IsKeyRef extends boolean = Key extends TRef ? true : false> = (Type extends TMappedResult ? TOmitFromMappedResult<Type, TResolvePropertyKeys<Key>> : Key extends TMappedKey ? TOmitFromMappedKey<Type, Key> : [
|
|
23
|
+
IsTypeRef,
|
|
24
|
+
IsKeyRef
|
|
25
|
+
] extends [true, true] ? TComputed<'Omit', [Type, TResolveTypeKey<Key>]> : [
|
|
26
|
+
IsTypeRef,
|
|
27
|
+
IsKeyRef
|
|
28
|
+
] extends [false, true] ? TComputed<'Omit', [Type, TResolveTypeKey<Key>]> : [
|
|
29
|
+
IsTypeRef,
|
|
30
|
+
IsKeyRef
|
|
31
|
+
] extends [true, false] ? TComputed<'Omit', [Type, TResolveTypeKey<Key>]> : TOmitResolve<Type, TResolvePropertyKeys<Key>>);
|
|
32
|
+
/** `[Json]` Constructs a type whose keys are picked from the given type */
|
|
33
|
+
export declare function Omit<Type extends TSchema, Key extends PropertyKey[]>(type: Type, key: readonly [...Key], options?: SchemaOptions): TOmit<Type, Key>;
|
|
34
|
+
/** `[Json]` Constructs a type whose keys are picked from the given type */
|
|
35
|
+
export declare function Omit<Type extends TSchema, Key extends TSchema>(type: Type, key: Key, options?: SchemaOptions): TOmit<Type, Key>;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { CreateType } from '../create/type.mjs';
|
|
2
|
+
import { Discard } from '../discard/discard.mjs';
|
|
3
|
+
import { TransformKind } from '../symbols/symbols.mjs';
|
|
4
|
+
import { Computed } from '../computed/index.mjs';
|
|
5
|
+
import { Literal } from '../literal/index.mjs';
|
|
6
|
+
import { IndexPropertyKeys } from '../indexed/index.mjs';
|
|
7
|
+
import { Intersect } from '../intersect/index.mjs';
|
|
8
|
+
import { Union } from '../union/index.mjs';
|
|
9
|
+
import { Object } from '../object/index.mjs';
|
|
10
|
+
// ------------------------------------------------------------------
|
|
11
|
+
// Mapped
|
|
12
|
+
// ------------------------------------------------------------------
|
|
13
|
+
import { OmitFromMappedKey } from './omit-from-mapped-key.mjs';
|
|
14
|
+
import { OmitFromMappedResult } from './omit-from-mapped-result.mjs';
|
|
15
|
+
// ------------------------------------------------------------------
|
|
16
|
+
// TypeGuard
|
|
17
|
+
// ------------------------------------------------------------------
|
|
18
|
+
import { IsMappedKey, IsIntersect, IsUnion, IsObject, IsSchema, IsMappedResult, IsLiteralValue, IsRef } from '../guard/kind.mjs';
|
|
19
|
+
import { IsArray as IsArrayValue } from '../guard/value.mjs';
|
|
20
|
+
// prettier-ignore
|
|
21
|
+
function FromIntersect(types, propertyKeys) {
|
|
22
|
+
return types.map((type) => OmitResolve(type, propertyKeys));
|
|
23
|
+
}
|
|
24
|
+
// prettier-ignore
|
|
25
|
+
function FromUnion(types, propertyKeys) {
|
|
26
|
+
return types.map((type) => OmitResolve(type, propertyKeys));
|
|
27
|
+
}
|
|
28
|
+
// ------------------------------------------------------------------
|
|
29
|
+
// FromProperty
|
|
30
|
+
// ------------------------------------------------------------------
|
|
31
|
+
// prettier-ignore
|
|
32
|
+
function FromProperty(properties, key) {
|
|
33
|
+
const { [key]: _, ...R } = properties;
|
|
34
|
+
return R;
|
|
35
|
+
}
|
|
36
|
+
// prettier-ignore
|
|
37
|
+
function FromProperties(properties, propertyKeys) {
|
|
38
|
+
return propertyKeys.reduce((T, K2) => FromProperty(T, K2), properties);
|
|
39
|
+
}
|
|
40
|
+
// prettier-ignore
|
|
41
|
+
function FromObject(type, propertyKeys, properties) {
|
|
42
|
+
const options = Discard(type, [TransformKind, '$id', 'required', 'properties']);
|
|
43
|
+
const mappedProperties = FromProperties(properties, propertyKeys);
|
|
44
|
+
return Object(mappedProperties, options);
|
|
45
|
+
}
|
|
46
|
+
// prettier-ignore
|
|
47
|
+
function UnionFromPropertyKeys(propertyKeys) {
|
|
48
|
+
const result = propertyKeys.reduce((result, key) => IsLiteralValue(key) ? [...result, Literal(key)] : result, []);
|
|
49
|
+
return Union(result);
|
|
50
|
+
}
|
|
51
|
+
// prettier-ignore
|
|
52
|
+
function OmitResolve(type, propertyKeys) {
|
|
53
|
+
return (IsIntersect(type) ? Intersect(FromIntersect(type.allOf, propertyKeys)) :
|
|
54
|
+
IsUnion(type) ? Union(FromUnion(type.anyOf, propertyKeys)) :
|
|
55
|
+
IsObject(type) ? FromObject(type, propertyKeys, type.properties) :
|
|
56
|
+
Object({}));
|
|
57
|
+
}
|
|
58
|
+
/** `[Json]` Constructs a type whose keys are picked from the given type */
|
|
59
|
+
// prettier-ignore
|
|
60
|
+
export function Omit(type, key, options) {
|
|
61
|
+
const typeKey = IsArrayValue(key) ? UnionFromPropertyKeys(key) : key;
|
|
62
|
+
const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
|
|
63
|
+
const isTypeRef = IsRef(type);
|
|
64
|
+
const isKeyRef = IsRef(key);
|
|
65
|
+
return (IsMappedResult(type) ? OmitFromMappedResult(type, propertyKeys, options) :
|
|
66
|
+
IsMappedKey(key) ? OmitFromMappedKey(type, key, options) :
|
|
67
|
+
(isTypeRef && isKeyRef) ? Computed('Omit', [type, typeKey], options) :
|
|
68
|
+
(!isTypeRef && isKeyRef) ? Computed('Omit', [type, typeKey], options) :
|
|
69
|
+
(isTypeRef && !isKeyRef) ? Computed('Omit', [type, typeKey], options) :
|
|
70
|
+
CreateType({ ...OmitResolve(type, propertyKeys), ...options }));
|
|
71
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TProperties } from '../object/index.mjs';
|
|
2
|
+
import { type TMappedResult } from '../mapped/index.mjs';
|
|
3
|
+
import { type TOptionalWithFlag } from './optional.mjs';
|
|
4
|
+
type TFromProperties<P extends TProperties, F extends boolean> = ({
|
|
5
|
+
[K2 in keyof P]: TOptionalWithFlag<P[K2], F>;
|
|
6
|
+
});
|
|
7
|
+
type TFromMappedResult<R extends TMappedResult, F extends boolean> = (TFromProperties<R['properties'], F>);
|
|
8
|
+
export type TOptionalFromMappedResult<R extends TMappedResult, F extends boolean, P extends TProperties = TFromMappedResult<R, F>> = (TMappedResult<P>);
|
|
9
|
+
export declare function OptionalFromMappedResult<R extends TMappedResult, F extends boolean, P extends TProperties = TFromMappedResult<R, F>>(R: R, F: F): TMappedResult<P>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MappedResult } from '../mapped/index.mjs';
|
|
2
|
+
import { Optional } from './optional.mjs';
|
|
3
|
+
// prettier-ignore
|
|
4
|
+
function FromProperties(P, F) {
|
|
5
|
+
const Acc = {};
|
|
6
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(P))
|
|
7
|
+
Acc[K2] = Optional(P[K2], F);
|
|
8
|
+
return Acc;
|
|
9
|
+
}
|
|
10
|
+
// prettier-ignore
|
|
11
|
+
function FromMappedResult(R, F) {
|
|
12
|
+
return FromProperties(R.properties, F);
|
|
13
|
+
}
|
|
14
|
+
// prettier-ignore
|
|
15
|
+
export function OptionalFromMappedResult(R, F) {
|
|
16
|
+
const P = FromMappedResult(R, F);
|
|
17
|
+
return MappedResult(P);
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TSchema } from '../schema/index.mjs';
|
|
2
|
+
import type { Ensure } from '../helpers/index.mjs';
|
|
3
|
+
import { OptionalKind } from '../symbols/index.mjs';
|
|
4
|
+
import type { TMappedResult } from '../mapped/index.mjs';
|
|
5
|
+
import { type TOptionalFromMappedResult } from './optional-from-mapped-result.mjs';
|
|
6
|
+
type TRemoveOptional<T extends TSchema> = T extends TOptional<infer S> ? S : T;
|
|
7
|
+
type TAddOptional<T extends TSchema> = T extends TOptional<infer S> ? TOptional<S> : Ensure<TOptional<T>>;
|
|
8
|
+
export type TOptionalWithFlag<T extends TSchema, F extends boolean> = F extends false ? TRemoveOptional<T> : TAddOptional<T>;
|
|
9
|
+
export type TOptional<T extends TSchema> = T & {
|
|
10
|
+
[OptionalKind]: 'Optional';
|
|
11
|
+
};
|
|
12
|
+
/** `[Json]` Creates a Optional property */
|
|
13
|
+
export declare function Optional<T extends TMappedResult, F extends boolean>(schema: T, enable: F): TOptionalFromMappedResult<T, F>;
|
|
14
|
+
/** `[Json]` Creates a Optional property */
|
|
15
|
+
export declare function Optional<T extends TSchema, F extends boolean>(schema: T, enable: F): TOptionalWithFlag<T, F>;
|
|
16
|
+
/** `[Json]` Creates a Optional property */
|
|
17
|
+
export declare function Optional<T extends TMappedResult>(schema: T): TOptionalFromMappedResult<T, true>;
|
|
18
|
+
/** `[Json]` Creates a Optional property */
|
|
19
|
+
export declare function Optional<T extends TSchema>(schema: T): TOptionalWithFlag<T, true>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CreateType } from '../create/type.mjs';
|
|
2
|
+
import { OptionalKind } from '../symbols/index.mjs';
|
|
3
|
+
import { Discard } from '../discard/index.mjs';
|
|
4
|
+
import { OptionalFromMappedResult } from './optional-from-mapped-result.mjs';
|
|
5
|
+
import { IsMappedResult } from '../guard/kind.mjs';
|
|
6
|
+
function RemoveOptional(schema) {
|
|
7
|
+
return CreateType(Discard(schema, [OptionalKind]));
|
|
8
|
+
}
|
|
9
|
+
function AddOptional(schema) {
|
|
10
|
+
return CreateType({ ...schema, [OptionalKind]: 'Optional' });
|
|
11
|
+
}
|
|
12
|
+
// prettier-ignore
|
|
13
|
+
function OptionalWithFlag(schema, F) {
|
|
14
|
+
return (F === false
|
|
15
|
+
? RemoveOptional(schema)
|
|
16
|
+
: AddOptional(schema));
|
|
17
|
+
}
|
|
18
|
+
/** `[Json]` Creates a Optional property */
|
|
19
|
+
export function Optional(schema, enable) {
|
|
20
|
+
const F = enable ?? true;
|
|
21
|
+
return IsMappedResult(schema) ? OptionalFromMappedResult(schema, F) : OptionalWithFlag(schema, F);
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './parameters.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './parameters.mjs';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
|
|
2
|
+
import type { TFunction } from '../function/index.mjs';
|
|
3
|
+
import { type TTuple } from '../tuple/index.mjs';
|
|
4
|
+
import { type TNever } from '../never/index.mjs';
|
|
5
|
+
export type TParameters<Type extends TSchema> = (Type extends TFunction<infer Parameters extends TSchema[], infer _ReturnType extends TSchema> ? TTuple<Parameters> : TNever);
|
|
6
|
+
/** `[JavaScript]` Extracts the Parameters from the given Function type */
|
|
7
|
+
export declare function Parameters<Type extends TSchema>(schema: Type, options?: SchemaOptions): TParameters<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 Parameters from the given Function type */
|
|
5
|
+
export function Parameters(schema, options) {
|
|
6
|
+
return (KindGuard.IsFunction(schema) ? Tuple(schema.parameters, options) : Never());
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SchemaOptions } from '../schema/index.mjs';
|
|
2
|
+
import type { Ensure, Evaluate } from '../helpers/index.mjs';
|
|
3
|
+
import type { TProperties } from '../object/index.mjs';
|
|
4
|
+
import { type TMappedResult } from '../mapped/index.mjs';
|
|
5
|
+
import { type TPartial } from './partial.mjs';
|
|
6
|
+
type TFromProperties<P extends TProperties> = ({
|
|
7
|
+
[K2 in keyof P]: TPartial<P[K2]>;
|
|
8
|
+
});
|
|
9
|
+
type TFromMappedResult<R extends TMappedResult> = (Evaluate<TFromProperties<R['properties']>>);
|
|
10
|
+
export type TPartialFromMappedResult<R extends TMappedResult, P extends TProperties = TFromMappedResult<R>> = (Ensure<TMappedResult<P>>);
|
|
11
|
+
export declare function PartialFromMappedResult<R extends TMappedResult, P extends TProperties = TFromMappedResult<R>>(R: R, options?: SchemaOptions): TMappedResult<P>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MappedResult } from '../mapped/index.mjs';
|
|
2
|
+
import { Partial } from './partial.mjs';
|
|
3
|
+
import { Clone } from '../clone/value.mjs';
|
|
4
|
+
// prettier-ignore
|
|
5
|
+
function FromProperties(K, options) {
|
|
6
|
+
const Acc = {};
|
|
7
|
+
for (const K2 of globalThis.Object.getOwnPropertyNames(K))
|
|
8
|
+
Acc[K2] = Partial(K[K2], Clone(options));
|
|
9
|
+
return Acc;
|
|
10
|
+
}
|
|
11
|
+
// prettier-ignore
|
|
12
|
+
function FromMappedResult(R, options) {
|
|
13
|
+
return FromProperties(R.properties, options);
|
|
14
|
+
}
|
|
15
|
+
// prettier-ignore
|
|
16
|
+
export function PartialFromMappedResult(R, options) {
|
|
17
|
+
const P = FromMappedResult(R, options);
|
|
18
|
+
return MappedResult(P);
|
|
19
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
|
|
2
|
+
import type { Evaluate, Ensure } from '../helpers/index.mjs';
|
|
3
|
+
import type { TMappedResult } from '../mapped/index.mjs';
|
|
4
|
+
import { type TReadonlyOptional } from '../readonly-optional/index.mjs';
|
|
5
|
+
import { type TComputed } from '../computed/index.mjs';
|
|
6
|
+
import { type TOptional } from '../optional/index.mjs';
|
|
7
|
+
import { type TReadonly } from '../readonly/index.mjs';
|
|
8
|
+
import { type TRecursive } from '../recursive/index.mjs';
|
|
9
|
+
import { type TObject, type TProperties } from '../object/index.mjs';
|
|
10
|
+
import { type TIntersect } from '../intersect/index.mjs';
|
|
11
|
+
import { type TUnion } from '../union/index.mjs';
|
|
12
|
+
import { type TRef } from '../ref/index.mjs';
|
|
13
|
+
import { type TBigInt } from '../bigint/index.mjs';
|
|
14
|
+
import { type TBoolean } from '../boolean/index.mjs';
|
|
15
|
+
import { type TInteger } from '../integer/index.mjs';
|
|
16
|
+
import { type TLiteral } from '../literal/index.mjs';
|
|
17
|
+
import { type TNull } from '../null/index.mjs';
|
|
18
|
+
import { type TNumber } from '../number/index.mjs';
|
|
19
|
+
import { type TString } from '../string/index.mjs';
|
|
20
|
+
import { type TSymbol } from '../symbol/index.mjs';
|
|
21
|
+
import { type TUndefined } from '../undefined/index.mjs';
|
|
22
|
+
import { type TPartialFromMappedResult } from './partial-from-mapped-result.mjs';
|
|
23
|
+
type TFromComputed<Target extends string, Parameters extends TSchema[]> = Ensure<TComputed<'Partial', [TComputed<Target, Parameters>]>>;
|
|
24
|
+
type TFromRef<Ref extends string> = Ensure<TComputed<'Partial', [TRef<Ref>]>>;
|
|
25
|
+
type TFromProperties<Properties extends TProperties> = Evaluate<{
|
|
26
|
+
[K in keyof Properties]: Properties[K] extends (TReadonlyOptional<infer S>) ? TReadonlyOptional<S> : Properties[K] extends (TReadonly<infer S>) ? TReadonlyOptional<S> : Properties[K] extends (TOptional<infer S>) ? TOptional<S> : TOptional<Properties[K]>;
|
|
27
|
+
}>;
|
|
28
|
+
type TFromObject<_Type extends TObject, Properties extends TProperties, MappedProperties extends TProperties = TFromProperties<Properties>, Result extends TSchema = TObject<MappedProperties>> = Result;
|
|
29
|
+
type TFromRest<Types extends TSchema[], Result extends TSchema[] = []> = (Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest<R, [...Result, TPartial<L>]> : Result);
|
|
30
|
+
export type TPartial<Type extends TSchema> = (Type extends TRecursive<infer Type extends TSchema> ? TRecursive<TPartial<Type>> : 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 TObject<infer Properties extends TProperties> ? TFromObject<TObject, Properties> : Type extends TBigInt ? Type : Type extends TBoolean ? Type : Type extends TInteger ? Type : Type extends TLiteral ? Type : Type extends TNull ? Type : Type extends TNumber ? Type : Type extends TString ? Type : Type extends TSymbol ? Type : Type extends TUndefined ? Type : TObject<{}>);
|
|
31
|
+
/** `[Json]` Constructs a type where all properties are optional */
|
|
32
|
+
export declare function Partial<MappedResult extends TMappedResult>(type: MappedResult, options?: SchemaOptions): TPartialFromMappedResult<MappedResult>;
|
|
33
|
+
/** `[Json]` Constructs a type where all properties are optional */
|
|
34
|
+
export declare function Partial<Type extends TSchema>(type: Type, options?: SchemaOptions): TPartial<Type>;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { CreateType } from '../create/type.mjs';
|
|
2
|
+
import { Computed } from '../computed/index.mjs';
|
|
3
|
+
import { Optional } from '../optional/index.mjs';
|
|
4
|
+
import { Object } from '../object/index.mjs';
|
|
5
|
+
import { Intersect } from '../intersect/index.mjs';
|
|
6
|
+
import { Union } from '../union/index.mjs';
|
|
7
|
+
import { Ref } from '../ref/index.mjs';
|
|
8
|
+
import { Discard } from '../discard/index.mjs';
|
|
9
|
+
import { TransformKind } from '../symbols/index.mjs';
|
|
10
|
+
import { PartialFromMappedResult } from './partial-from-mapped-result.mjs';
|
|
11
|
+
// ------------------------------------------------------------------
|
|
12
|
+
// KindGuard
|
|
13
|
+
// ------------------------------------------------------------------
|
|
14
|
+
import * as KindGuard from '../guard/kind.mjs';
|
|
15
|
+
// prettier-ignore
|
|
16
|
+
function FromComputed(target, parameters) {
|
|
17
|
+
return Computed('Partial', [Computed(target, parameters)]);
|
|
18
|
+
}
|
|
19
|
+
// prettier-ignore
|
|
20
|
+
function FromRef($ref) {
|
|
21
|
+
return Computed('Partial', [Ref($ref)]);
|
|
22
|
+
}
|
|
23
|
+
// prettier-ignore
|
|
24
|
+
function FromProperties(properties) {
|
|
25
|
+
const partialProperties = {};
|
|
26
|
+
for (const K of globalThis.Object.getOwnPropertyNames(properties))
|
|
27
|
+
partialProperties[K] = Optional(properties[K]);
|
|
28
|
+
return partialProperties;
|
|
29
|
+
}
|
|
30
|
+
// prettier-ignore
|
|
31
|
+
function FromObject(type, properties) {
|
|
32
|
+
const options = Discard(type, [TransformKind, '$id', 'required', 'properties']);
|
|
33
|
+
const mappedProperties = FromProperties(properties);
|
|
34
|
+
return Object(mappedProperties, options);
|
|
35
|
+
}
|
|
36
|
+
// prettier-ignore
|
|
37
|
+
function FromRest(types) {
|
|
38
|
+
return types.map(type => PartialResolve(type));
|
|
39
|
+
}
|
|
40
|
+
// ------------------------------------------------------------------
|
|
41
|
+
// PartialResolve
|
|
42
|
+
// ------------------------------------------------------------------
|
|
43
|
+
// prettier-ignore
|
|
44
|
+
function PartialResolve(type) {
|
|
45
|
+
return (
|
|
46
|
+
// Mappable
|
|
47
|
+
KindGuard.IsComputed(type) ? FromComputed(type.target, type.parameters) :
|
|
48
|
+
KindGuard.IsRef(type) ? FromRef(type.$ref) :
|
|
49
|
+
KindGuard.IsIntersect(type) ? Intersect(FromRest(type.allOf)) :
|
|
50
|
+
KindGuard.IsUnion(type) ? Union(FromRest(type.anyOf)) :
|
|
51
|
+
KindGuard.IsObject(type) ? FromObject(type, type.properties) :
|
|
52
|
+
// Intrinsic
|
|
53
|
+
KindGuard.IsBigInt(type) ? type :
|
|
54
|
+
KindGuard.IsBoolean(type) ? type :
|
|
55
|
+
KindGuard.IsInteger(type) ? type :
|
|
56
|
+
KindGuard.IsLiteral(type) ? type :
|
|
57
|
+
KindGuard.IsNull(type) ? type :
|
|
58
|
+
KindGuard.IsNumber(type) ? type :
|
|
59
|
+
KindGuard.IsString(type) ? type :
|
|
60
|
+
KindGuard.IsSymbol(type) ? type :
|
|
61
|
+
KindGuard.IsUndefined(type) ? type :
|
|
62
|
+
// Passthrough
|
|
63
|
+
Object({}));
|
|
64
|
+
}
|
|
65
|
+
/** `[Json]` Constructs a type where all properties are optional */
|
|
66
|
+
export function Partial(type, options) {
|
|
67
|
+
if (KindGuard.IsMappedResult(type)) {
|
|
68
|
+
return PartialFromMappedResult(type, options);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
// special: mapping types require overridable options
|
|
72
|
+
return CreateType({ ...PartialResolve(type), ...options });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './patterns.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './patterns.mjs';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const PatternBoolean = "(true|false)";
|
|
2
|
+
export declare const PatternNumber = "(0|[1-9][0-9]*)";
|
|
3
|
+
export declare const PatternString = "(.*)";
|
|
4
|
+
export declare const PatternNever = "(?!.*)";
|
|
5
|
+
export declare const PatternBooleanExact = "^(true|false)$";
|
|
6
|
+
export declare const PatternNumberExact = "^(0|[1-9][0-9]*)$";
|
|
7
|
+
export declare const PatternStringExact = "^(.*)$";
|
|
8
|
+
export declare const PatternNeverExact = "^(?!.*)$";
|