@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,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.DefaultErrorFunction = DefaultErrorFunction;
|
|
5
|
+
exports.SetErrorFunction = SetErrorFunction;
|
|
6
|
+
exports.GetErrorFunction = GetErrorFunction;
|
|
7
|
+
const index_1 = require("../type/symbols/index");
|
|
8
|
+
const errors_1 = require("./errors");
|
|
9
|
+
/** Creates an error message using en-US as the default locale */
|
|
10
|
+
function DefaultErrorFunction(error) {
|
|
11
|
+
switch (error.errorType) {
|
|
12
|
+
case errors_1.ValueErrorType.ArrayContains:
|
|
13
|
+
return 'Expected array to contain at least one matching value';
|
|
14
|
+
case errors_1.ValueErrorType.ArrayMaxContains:
|
|
15
|
+
return `Expected array to contain no more than ${error.schema.maxContains} matching values`;
|
|
16
|
+
case errors_1.ValueErrorType.ArrayMinContains:
|
|
17
|
+
return `Expected array to contain at least ${error.schema.minContains} matching values`;
|
|
18
|
+
case errors_1.ValueErrorType.ArrayMaxItems:
|
|
19
|
+
return `Expected array length to be less or equal to ${error.schema.maxItems}`;
|
|
20
|
+
case errors_1.ValueErrorType.ArrayMinItems:
|
|
21
|
+
return `Expected array length to be greater or equal to ${error.schema.minItems}`;
|
|
22
|
+
case errors_1.ValueErrorType.ArrayUniqueItems:
|
|
23
|
+
return 'Expected array elements to be unique';
|
|
24
|
+
case errors_1.ValueErrorType.Array:
|
|
25
|
+
return 'Expected array';
|
|
26
|
+
case errors_1.ValueErrorType.AsyncIterator:
|
|
27
|
+
return 'Expected AsyncIterator';
|
|
28
|
+
case errors_1.ValueErrorType.BigIntExclusiveMaximum:
|
|
29
|
+
return `Expected bigint to be less than ${error.schema.exclusiveMaximum}`;
|
|
30
|
+
case errors_1.ValueErrorType.BigIntExclusiveMinimum:
|
|
31
|
+
return `Expected bigint to be greater than ${error.schema.exclusiveMinimum}`;
|
|
32
|
+
case errors_1.ValueErrorType.BigIntMaximum:
|
|
33
|
+
return `Expected bigint to be less or equal to ${error.schema.maximum}`;
|
|
34
|
+
case errors_1.ValueErrorType.BigIntMinimum:
|
|
35
|
+
return `Expected bigint to be greater or equal to ${error.schema.minimum}`;
|
|
36
|
+
case errors_1.ValueErrorType.BigIntMultipleOf:
|
|
37
|
+
return `Expected bigint to be a multiple of ${error.schema.multipleOf}`;
|
|
38
|
+
case errors_1.ValueErrorType.BigInt:
|
|
39
|
+
return 'Expected bigint';
|
|
40
|
+
case errors_1.ValueErrorType.Boolean:
|
|
41
|
+
return 'Expected boolean';
|
|
42
|
+
case errors_1.ValueErrorType.DateExclusiveMinimumTimestamp:
|
|
43
|
+
return `Expected Date timestamp to be greater than ${error.schema.exclusiveMinimumTimestamp}`;
|
|
44
|
+
case errors_1.ValueErrorType.DateExclusiveMaximumTimestamp:
|
|
45
|
+
return `Expected Date timestamp to be less than ${error.schema.exclusiveMaximumTimestamp}`;
|
|
46
|
+
case errors_1.ValueErrorType.DateMinimumTimestamp:
|
|
47
|
+
return `Expected Date timestamp to be greater or equal to ${error.schema.minimumTimestamp}`;
|
|
48
|
+
case errors_1.ValueErrorType.DateMaximumTimestamp:
|
|
49
|
+
return `Expected Date timestamp to be less or equal to ${error.schema.maximumTimestamp}`;
|
|
50
|
+
case errors_1.ValueErrorType.DateMultipleOfTimestamp:
|
|
51
|
+
return `Expected Date timestamp to be a multiple of ${error.schema.multipleOfTimestamp}`;
|
|
52
|
+
case errors_1.ValueErrorType.Date:
|
|
53
|
+
return 'Expected Date';
|
|
54
|
+
case errors_1.ValueErrorType.Function:
|
|
55
|
+
return 'Expected function';
|
|
56
|
+
case errors_1.ValueErrorType.IntegerExclusiveMaximum:
|
|
57
|
+
return `Expected integer to be less than ${error.schema.exclusiveMaximum}`;
|
|
58
|
+
case errors_1.ValueErrorType.IntegerExclusiveMinimum:
|
|
59
|
+
return `Expected integer to be greater than ${error.schema.exclusiveMinimum}`;
|
|
60
|
+
case errors_1.ValueErrorType.IntegerMaximum:
|
|
61
|
+
return `Expected integer to be less or equal to ${error.schema.maximum}`;
|
|
62
|
+
case errors_1.ValueErrorType.IntegerMinimum:
|
|
63
|
+
return `Expected integer to be greater or equal to ${error.schema.minimum}`;
|
|
64
|
+
case errors_1.ValueErrorType.IntegerMultipleOf:
|
|
65
|
+
return `Expected integer to be a multiple of ${error.schema.multipleOf}`;
|
|
66
|
+
case errors_1.ValueErrorType.Integer:
|
|
67
|
+
return 'Expected integer';
|
|
68
|
+
case errors_1.ValueErrorType.IntersectUnevaluatedProperties:
|
|
69
|
+
return 'Unexpected property';
|
|
70
|
+
case errors_1.ValueErrorType.Intersect:
|
|
71
|
+
return 'Expected all values to match';
|
|
72
|
+
case errors_1.ValueErrorType.Iterator:
|
|
73
|
+
return 'Expected Iterator';
|
|
74
|
+
case errors_1.ValueErrorType.Literal:
|
|
75
|
+
return `Expected ${typeof error.schema.const === 'string' ? `'${error.schema.const}'` : error.schema.const}`;
|
|
76
|
+
case errors_1.ValueErrorType.Never:
|
|
77
|
+
return 'Never';
|
|
78
|
+
case errors_1.ValueErrorType.Not:
|
|
79
|
+
return 'Value should not match';
|
|
80
|
+
case errors_1.ValueErrorType.Null:
|
|
81
|
+
return 'Expected null';
|
|
82
|
+
case errors_1.ValueErrorType.NumberExclusiveMaximum:
|
|
83
|
+
return `Expected number to be less than ${error.schema.exclusiveMaximum}`;
|
|
84
|
+
case errors_1.ValueErrorType.NumberExclusiveMinimum:
|
|
85
|
+
return `Expected number to be greater than ${error.schema.exclusiveMinimum}`;
|
|
86
|
+
case errors_1.ValueErrorType.NumberMaximum:
|
|
87
|
+
return `Expected number to be less or equal to ${error.schema.maximum}`;
|
|
88
|
+
case errors_1.ValueErrorType.NumberMinimum:
|
|
89
|
+
return `Expected number to be greater or equal to ${error.schema.minimum}`;
|
|
90
|
+
case errors_1.ValueErrorType.NumberMultipleOf:
|
|
91
|
+
return `Expected number to be a multiple of ${error.schema.multipleOf}`;
|
|
92
|
+
case errors_1.ValueErrorType.Number:
|
|
93
|
+
return 'Expected number';
|
|
94
|
+
case errors_1.ValueErrorType.Object:
|
|
95
|
+
return 'Expected object';
|
|
96
|
+
case errors_1.ValueErrorType.ObjectAdditionalProperties:
|
|
97
|
+
return 'Unexpected property';
|
|
98
|
+
case errors_1.ValueErrorType.ObjectMaxProperties:
|
|
99
|
+
return `Expected object to have no more than ${error.schema.maxProperties} properties`;
|
|
100
|
+
case errors_1.ValueErrorType.ObjectMinProperties:
|
|
101
|
+
return `Expected object to have at least ${error.schema.minProperties} properties`;
|
|
102
|
+
case errors_1.ValueErrorType.ObjectRequiredProperty:
|
|
103
|
+
return 'Expected required property';
|
|
104
|
+
case errors_1.ValueErrorType.Promise:
|
|
105
|
+
return 'Expected Promise';
|
|
106
|
+
case errors_1.ValueErrorType.RegExp:
|
|
107
|
+
return 'Expected string to match regular expression';
|
|
108
|
+
case errors_1.ValueErrorType.StringFormatUnknown:
|
|
109
|
+
return `Unknown format '${error.schema.format}'`;
|
|
110
|
+
case errors_1.ValueErrorType.StringFormat:
|
|
111
|
+
return `Expected string to match '${error.schema.format}' format`;
|
|
112
|
+
case errors_1.ValueErrorType.StringMaxLength:
|
|
113
|
+
return `Expected string length less or equal to ${error.schema.maxLength}`;
|
|
114
|
+
case errors_1.ValueErrorType.StringMinLength:
|
|
115
|
+
return `Expected string length greater or equal to ${error.schema.minLength}`;
|
|
116
|
+
case errors_1.ValueErrorType.StringPattern:
|
|
117
|
+
return `Expected string to match '${error.schema.pattern}'`;
|
|
118
|
+
case errors_1.ValueErrorType.String:
|
|
119
|
+
return 'Expected string';
|
|
120
|
+
case errors_1.ValueErrorType.Symbol:
|
|
121
|
+
return 'Expected symbol';
|
|
122
|
+
case errors_1.ValueErrorType.TupleLength:
|
|
123
|
+
return `Expected tuple to have ${error.schema.maxItems || 0} elements`;
|
|
124
|
+
case errors_1.ValueErrorType.Tuple:
|
|
125
|
+
return 'Expected tuple';
|
|
126
|
+
case errors_1.ValueErrorType.Uint8ArrayMaxByteLength:
|
|
127
|
+
return `Expected byte length less or equal to ${error.schema.maxByteLength}`;
|
|
128
|
+
case errors_1.ValueErrorType.Uint8ArrayMinByteLength:
|
|
129
|
+
return `Expected byte length greater or equal to ${error.schema.minByteLength}`;
|
|
130
|
+
case errors_1.ValueErrorType.Uint8Array:
|
|
131
|
+
return 'Expected Uint8Array';
|
|
132
|
+
case errors_1.ValueErrorType.Undefined:
|
|
133
|
+
return 'Expected undefined';
|
|
134
|
+
case errors_1.ValueErrorType.Union:
|
|
135
|
+
return 'Expected union value';
|
|
136
|
+
case errors_1.ValueErrorType.Void:
|
|
137
|
+
return 'Expected void';
|
|
138
|
+
case errors_1.ValueErrorType.Kind:
|
|
139
|
+
return `Expected kind '${error.schema[index_1.Kind]}'`;
|
|
140
|
+
default:
|
|
141
|
+
return 'Unknown error type';
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/** Manages error message providers */
|
|
145
|
+
let errorFunction = DefaultErrorFunction;
|
|
146
|
+
/** Sets the error function used to generate error messages. */
|
|
147
|
+
function SetErrorFunction(callback) {
|
|
148
|
+
errorFunction = callback;
|
|
149
|
+
}
|
|
150
|
+
/** Gets the error function used to generate error messages */
|
|
151
|
+
function GetErrorFunction() {
|
|
152
|
+
return errorFunction;
|
|
153
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
__exportStar(require("./errors"), exports);
|
|
19
|
+
__exportStar(require("./function"), exports);
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export * from './type/clone/index';
|
|
2
|
+
export * from './type/create/index';
|
|
3
|
+
export * from './type/error/index';
|
|
4
|
+
export * from './type/guard/index';
|
|
5
|
+
export * from './type/helpers/index';
|
|
6
|
+
export * from './type/patterns/index';
|
|
7
|
+
export * from './type/registry/index';
|
|
8
|
+
export * from './type/sets/index';
|
|
9
|
+
export * from './type/symbols/index';
|
|
10
|
+
export * from './type/any/index';
|
|
11
|
+
export * from './type/array/index';
|
|
12
|
+
export * from './type/argument/index';
|
|
13
|
+
export * from './type/async-iterator/index';
|
|
14
|
+
export * from './type/awaited/index';
|
|
15
|
+
export * from './type/bigint/index';
|
|
16
|
+
export * from './type/boolean/index';
|
|
17
|
+
export * from './type/composite/index';
|
|
18
|
+
export * from './type/const/index';
|
|
19
|
+
export * from './type/constructor/index';
|
|
20
|
+
export * from './type/constructor-parameters/index';
|
|
21
|
+
export * from './type/date/index';
|
|
22
|
+
export * from './type/enum/index';
|
|
23
|
+
export * from './type/exclude/index';
|
|
24
|
+
export * from './type/extends/index';
|
|
25
|
+
export * from './type/extract/index';
|
|
26
|
+
export * from './type/function/index';
|
|
27
|
+
export * from './type/indexed/index';
|
|
28
|
+
export * from './type/instance-type/index';
|
|
29
|
+
export * from './type/instantiate/index';
|
|
30
|
+
export * from './type/integer/index';
|
|
31
|
+
export * from './type/intersect/index';
|
|
32
|
+
export * from './type/iterator/index';
|
|
33
|
+
export * from './type/intrinsic/index';
|
|
34
|
+
export * from './type/keyof/index';
|
|
35
|
+
export * from './type/literal/index';
|
|
36
|
+
export * from './type/module/index';
|
|
37
|
+
export * from './type/mapped/index';
|
|
38
|
+
export * from './type/never/index';
|
|
39
|
+
export * from './type/not/index';
|
|
40
|
+
export * from './type/null/index';
|
|
41
|
+
export * from './type/number/index';
|
|
42
|
+
export * from './type/object/index';
|
|
43
|
+
export * from './type/omit/index';
|
|
44
|
+
export * from './type/optional/index';
|
|
45
|
+
export * from './type/parameters/index';
|
|
46
|
+
export * from './type/partial/index';
|
|
47
|
+
export * from './type/pick/index';
|
|
48
|
+
export * from './type/promise/index';
|
|
49
|
+
export * from './type/readonly/index';
|
|
50
|
+
export * from './type/readonly-optional/index';
|
|
51
|
+
export * from './type/record/index';
|
|
52
|
+
export * from './type/recursive/index';
|
|
53
|
+
export * from './type/ref/index';
|
|
54
|
+
export * from './type/regexp/index';
|
|
55
|
+
export * from './type/required/index';
|
|
56
|
+
export * from './type/rest/index';
|
|
57
|
+
export * from './type/return-type/index';
|
|
58
|
+
export * from './type/schema/index';
|
|
59
|
+
export * from './type/static/index';
|
|
60
|
+
export * from './type/string/index';
|
|
61
|
+
export * from './type/symbol/index';
|
|
62
|
+
export * from './type/template-literal/index';
|
|
63
|
+
export * from './type/transform/index';
|
|
64
|
+
export * from './type/tuple/index';
|
|
65
|
+
export * from './type/uint8array/index';
|
|
66
|
+
export * from './type/undefined/index';
|
|
67
|
+
export * from './type/union/index';
|
|
68
|
+
export * from './type/unknown/index';
|
|
69
|
+
export * from './type/unsafe/index';
|
|
70
|
+
export * from './type/void/index';
|
|
71
|
+
export * from './type/type/index';
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
// ------------------------------------------------------------------
|
|
19
|
+
// Infrastructure
|
|
20
|
+
// ------------------------------------------------------------------
|
|
21
|
+
__exportStar(require("./type/clone/index"), exports);
|
|
22
|
+
__exportStar(require("./type/create/index"), exports);
|
|
23
|
+
__exportStar(require("./type/error/index"), exports);
|
|
24
|
+
__exportStar(require("./type/guard/index"), exports);
|
|
25
|
+
__exportStar(require("./type/helpers/index"), exports);
|
|
26
|
+
__exportStar(require("./type/patterns/index"), exports);
|
|
27
|
+
__exportStar(require("./type/registry/index"), exports);
|
|
28
|
+
__exportStar(require("./type/sets/index"), exports);
|
|
29
|
+
__exportStar(require("./type/symbols/index"), exports);
|
|
30
|
+
// ------------------------------------------------------------------
|
|
31
|
+
// Types
|
|
32
|
+
// ------------------------------------------------------------------
|
|
33
|
+
__exportStar(require("./type/any/index"), exports);
|
|
34
|
+
__exportStar(require("./type/array/index"), exports);
|
|
35
|
+
__exportStar(require("./type/argument/index"), exports);
|
|
36
|
+
__exportStar(require("./type/async-iterator/index"), exports);
|
|
37
|
+
__exportStar(require("./type/awaited/index"), exports);
|
|
38
|
+
__exportStar(require("./type/bigint/index"), exports);
|
|
39
|
+
__exportStar(require("./type/boolean/index"), exports);
|
|
40
|
+
__exportStar(require("./type/composite/index"), exports);
|
|
41
|
+
__exportStar(require("./type/const/index"), exports);
|
|
42
|
+
__exportStar(require("./type/constructor/index"), exports);
|
|
43
|
+
__exportStar(require("./type/constructor-parameters/index"), exports);
|
|
44
|
+
__exportStar(require("./type/date/index"), exports);
|
|
45
|
+
__exportStar(require("./type/enum/index"), exports);
|
|
46
|
+
__exportStar(require("./type/exclude/index"), exports);
|
|
47
|
+
__exportStar(require("./type/extends/index"), exports);
|
|
48
|
+
__exportStar(require("./type/extract/index"), exports);
|
|
49
|
+
__exportStar(require("./type/function/index"), exports);
|
|
50
|
+
__exportStar(require("./type/indexed/index"), exports);
|
|
51
|
+
__exportStar(require("./type/instance-type/index"), exports);
|
|
52
|
+
__exportStar(require("./type/instantiate/index"), exports);
|
|
53
|
+
__exportStar(require("./type/integer/index"), exports);
|
|
54
|
+
__exportStar(require("./type/intersect/index"), exports);
|
|
55
|
+
__exportStar(require("./type/iterator/index"), exports);
|
|
56
|
+
__exportStar(require("./type/intrinsic/index"), exports);
|
|
57
|
+
__exportStar(require("./type/keyof/index"), exports);
|
|
58
|
+
__exportStar(require("./type/literal/index"), exports);
|
|
59
|
+
__exportStar(require("./type/module/index"), exports);
|
|
60
|
+
__exportStar(require("./type/mapped/index"), exports);
|
|
61
|
+
__exportStar(require("./type/never/index"), exports);
|
|
62
|
+
__exportStar(require("./type/not/index"), exports);
|
|
63
|
+
__exportStar(require("./type/null/index"), exports);
|
|
64
|
+
__exportStar(require("./type/number/index"), exports);
|
|
65
|
+
__exportStar(require("./type/object/index"), exports);
|
|
66
|
+
__exportStar(require("./type/omit/index"), exports);
|
|
67
|
+
__exportStar(require("./type/optional/index"), exports);
|
|
68
|
+
__exportStar(require("./type/parameters/index"), exports);
|
|
69
|
+
__exportStar(require("./type/partial/index"), exports);
|
|
70
|
+
__exportStar(require("./type/pick/index"), exports);
|
|
71
|
+
__exportStar(require("./type/promise/index"), exports);
|
|
72
|
+
__exportStar(require("./type/readonly/index"), exports);
|
|
73
|
+
__exportStar(require("./type/readonly-optional/index"), exports);
|
|
74
|
+
__exportStar(require("./type/record/index"), exports);
|
|
75
|
+
__exportStar(require("./type/recursive/index"), exports);
|
|
76
|
+
__exportStar(require("./type/ref/index"), exports);
|
|
77
|
+
__exportStar(require("./type/regexp/index"), exports);
|
|
78
|
+
__exportStar(require("./type/required/index"), exports);
|
|
79
|
+
__exportStar(require("./type/rest/index"), exports);
|
|
80
|
+
__exportStar(require("./type/return-type/index"), exports);
|
|
81
|
+
__exportStar(require("./type/schema/index"), exports);
|
|
82
|
+
__exportStar(require("./type/static/index"), exports);
|
|
83
|
+
__exportStar(require("./type/string/index"), exports);
|
|
84
|
+
__exportStar(require("./type/symbol/index"), exports);
|
|
85
|
+
__exportStar(require("./type/template-literal/index"), exports);
|
|
86
|
+
__exportStar(require("./type/transform/index"), exports);
|
|
87
|
+
__exportStar(require("./type/tuple/index"), exports);
|
|
88
|
+
__exportStar(require("./type/uint8array/index"), exports);
|
|
89
|
+
__exportStar(require("./type/undefined/index"), exports);
|
|
90
|
+
__exportStar(require("./type/union/index"), exports);
|
|
91
|
+
__exportStar(require("./type/unknown/index"), exports);
|
|
92
|
+
__exportStar(require("./type/unsafe/index"), exports);
|
|
93
|
+
__exportStar(require("./type/void/index"), exports);
|
|
94
|
+
// ------------------------------------------------------------------
|
|
95
|
+
// Type.*
|
|
96
|
+
// ------------------------------------------------------------------
|
|
97
|
+
__exportStar(require("./type/type/index"), exports);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.Static = exports.Runtime = void 0;
|
|
38
|
+
exports.Runtime = __importStar(require("./runtime/index"));
|
|
39
|
+
exports.Static = __importStar(require("./static/index"));
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IArray, IConst, IContext, IIdent, INumber, IOptional, IRef, IString, ITuple, IUnion } from './types';
|
|
2
|
+
/** Returns true if the value is a Array Parser */
|
|
3
|
+
export declare function IsArray(value: unknown): value is IArray;
|
|
4
|
+
/** Returns true if the value is a Const Parser */
|
|
5
|
+
export declare function IsConst(value: unknown): value is IConst;
|
|
6
|
+
/** Returns true if the value is a Context Parser */
|
|
7
|
+
export declare function IsContext(value: unknown): value is IContext;
|
|
8
|
+
/** Returns true if the value is a Ident Parser */
|
|
9
|
+
export declare function IsIdent(value: unknown): value is IIdent;
|
|
10
|
+
/** Returns true if the value is a Number Parser */
|
|
11
|
+
export declare function IsNumber(value: unknown): value is INumber;
|
|
12
|
+
/** Returns true if the value is a Optional Parser */
|
|
13
|
+
export declare function IsOptional(value: unknown): value is IOptional;
|
|
14
|
+
/** Returns true if the value is a Ref Parser */
|
|
15
|
+
export declare function IsRef(value: unknown): value is IRef;
|
|
16
|
+
/** Returns true if the value is a String Parser */
|
|
17
|
+
export declare function IsString(value: unknown): value is IString;
|
|
18
|
+
/** Returns true if the value is a Tuple Parser */
|
|
19
|
+
export declare function IsTuple(value: unknown): value is ITuple;
|
|
20
|
+
/** Returns true if the value is a Union Parser */
|
|
21
|
+
export declare function IsUnion(value: unknown): value is IUnion;
|
|
22
|
+
/** Returns true if the value is a Parser */
|
|
23
|
+
export declare function IsParser(value: unknown): value is IContext<unknown> | IUnion<unknown> | IArray<unknown> | IConst<unknown> | IIdent<unknown> | INumber<unknown> | IOptional<unknown> | IRef<unknown> | IString<unknown> | ITuple<unknown>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.IsArray = IsArray;
|
|
5
|
+
exports.IsConst = IsConst;
|
|
6
|
+
exports.IsContext = IsContext;
|
|
7
|
+
exports.IsIdent = IsIdent;
|
|
8
|
+
exports.IsNumber = IsNumber;
|
|
9
|
+
exports.IsOptional = IsOptional;
|
|
10
|
+
exports.IsRef = IsRef;
|
|
11
|
+
exports.IsString = IsString;
|
|
12
|
+
exports.IsTuple = IsTuple;
|
|
13
|
+
exports.IsUnion = IsUnion;
|
|
14
|
+
exports.IsParser = IsParser;
|
|
15
|
+
// ------------------------------------------------------------------
|
|
16
|
+
// Value Guard
|
|
17
|
+
// ------------------------------------------------------------------
|
|
18
|
+
// prettier-ignore
|
|
19
|
+
function HasPropertyKey(value, key) {
|
|
20
|
+
return key in value;
|
|
21
|
+
}
|
|
22
|
+
// prettier-ignore
|
|
23
|
+
function IsObjectValue(value) {
|
|
24
|
+
return typeof value === 'object' && value !== null;
|
|
25
|
+
}
|
|
26
|
+
// prettier-ignore
|
|
27
|
+
function IsArrayValue(value) {
|
|
28
|
+
return globalThis.Array.isArray(value);
|
|
29
|
+
}
|
|
30
|
+
// ------------------------------------------------------------------
|
|
31
|
+
// Parser Guard
|
|
32
|
+
// ------------------------------------------------------------------
|
|
33
|
+
/** Returns true if the value is a Array Parser */
|
|
34
|
+
function IsArray(value) {
|
|
35
|
+
return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Array' && HasPropertyKey(value, 'parser') && IsObjectValue(value.parser);
|
|
36
|
+
}
|
|
37
|
+
/** Returns true if the value is a Const Parser */
|
|
38
|
+
function IsConst(value) {
|
|
39
|
+
return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Const' && HasPropertyKey(value, 'value') && typeof value.value === 'string';
|
|
40
|
+
}
|
|
41
|
+
/** Returns true if the value is a Context Parser */
|
|
42
|
+
function IsContext(value) {
|
|
43
|
+
return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Context' && HasPropertyKey(value, 'left') && IsParser(value.left) && HasPropertyKey(value, 'right') && IsParser(value.right);
|
|
44
|
+
}
|
|
45
|
+
/** Returns true if the value is a Ident Parser */
|
|
46
|
+
function IsIdent(value) {
|
|
47
|
+
return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Ident';
|
|
48
|
+
}
|
|
49
|
+
/** Returns true if the value is a Number Parser */
|
|
50
|
+
function IsNumber(value) {
|
|
51
|
+
return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Number';
|
|
52
|
+
}
|
|
53
|
+
/** Returns true if the value is a Optional Parser */
|
|
54
|
+
function IsOptional(value) {
|
|
55
|
+
return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Optional' && HasPropertyKey(value, 'parser') && IsObjectValue(value.parser);
|
|
56
|
+
}
|
|
57
|
+
/** Returns true if the value is a Ref Parser */
|
|
58
|
+
function IsRef(value) {
|
|
59
|
+
return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Ref' && HasPropertyKey(value, 'ref') && typeof value.ref === 'string';
|
|
60
|
+
}
|
|
61
|
+
/** Returns true if the value is a String Parser */
|
|
62
|
+
function IsString(value) {
|
|
63
|
+
return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'String' && HasPropertyKey(value, 'options') && IsArrayValue(value.options);
|
|
64
|
+
}
|
|
65
|
+
/** Returns true if the value is a Tuple Parser */
|
|
66
|
+
function IsTuple(value) {
|
|
67
|
+
return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Tuple' && HasPropertyKey(value, 'parsers') && IsArrayValue(value.parsers);
|
|
68
|
+
}
|
|
69
|
+
/** Returns true if the value is a Union Parser */
|
|
70
|
+
function IsUnion(value) {
|
|
71
|
+
return IsObjectValue(value) && HasPropertyKey(value, 'type') && value.type === 'Union' && HasPropertyKey(value, 'parsers') && IsArrayValue(value.parsers);
|
|
72
|
+
}
|
|
73
|
+
/** Returns true if the value is a Parser */
|
|
74
|
+
function IsParser(value) {
|
|
75
|
+
// prettier-ignore
|
|
76
|
+
return (IsArray(value) ||
|
|
77
|
+
IsConst(value) ||
|
|
78
|
+
IsContext(value) ||
|
|
79
|
+
IsIdent(value) ||
|
|
80
|
+
IsNumber(value) ||
|
|
81
|
+
IsOptional(value) ||
|
|
82
|
+
IsRef(value) ||
|
|
83
|
+
IsString(value) ||
|
|
84
|
+
IsTuple(value) ||
|
|
85
|
+
IsUnion(value));
|
|
86
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
37
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.Token = exports.Guard = void 0;
|
|
41
|
+
exports.Guard = __importStar(require("./guard"));
|
|
42
|
+
exports.Token = __importStar(require("./token"));
|
|
43
|
+
__exportStar(require("./types"), exports);
|
|
44
|
+
__exportStar(require("./module"), exports);
|
|
45
|
+
__exportStar(require("./parse"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as Types from './types';
|
|
2
|
+
export declare class Module<Properties extends Types.IModuleProperties = Types.IModuleProperties> {
|
|
3
|
+
private readonly properties;
|
|
4
|
+
constructor(properties: Properties);
|
|
5
|
+
/** Parses using one of the parsers defined on this instance */
|
|
6
|
+
Parse<Key extends keyof Properties>(key: Key, content: string, context: unknown): [] | [Types.StaticParser<Properties[Key]>, string];
|
|
7
|
+
/** Parses using one of the parsers defined on this instance */
|
|
8
|
+
Parse<Key extends keyof Properties>(key: Key, content: string): [] | [Types.StaticParser<Properties[Key]>, string];
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Module = void 0;
|
|
5
|
+
const parse_1 = require("./parse");
|
|
6
|
+
// ------------------------------------------------------------------
|
|
7
|
+
// Module
|
|
8
|
+
// ------------------------------------------------------------------
|
|
9
|
+
class Module {
|
|
10
|
+
constructor(properties) {
|
|
11
|
+
this.properties = properties;
|
|
12
|
+
}
|
|
13
|
+
/** Parses using one of the parsers defined on this instance */
|
|
14
|
+
Parse(...args) {
|
|
15
|
+
// prettier-ignore
|
|
16
|
+
const [key, content, context] = (args.length === 3 ? [args[0], args[1], args[2]] :
|
|
17
|
+
args.length === 2 ? [args[0], args[1], undefined] :
|
|
18
|
+
(() => { throw Error('Invalid parse arguments'); })());
|
|
19
|
+
return (0, parse_1.Parse)(this.properties, this.properties[key], content, context);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.Module = Module;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as Types from './types';
|
|
2
|
+
/** Parses content using the given Parser */
|
|
3
|
+
export declare function Parse<Parser extends Types.IParser>(moduleProperties: Types.IModuleProperties, parser: Parser, code: string, context: unknown): [] | [Types.StaticParser<Parser>, string];
|
|
4
|
+
/** Parses content using the given Parser */
|
|
5
|
+
export declare function Parse<Parser extends Types.IParser>(moduleProperties: Types.IModuleProperties, parser: Parser, code: string): [] | [Types.StaticParser<Parser>, string];
|
|
6
|
+
/** Parses content using the given Parser */
|
|
7
|
+
export declare function Parse<Parser extends Types.IParser>(parser: Parser, content: string, context: unknown): [] | [Types.StaticParser<Parser>, string];
|
|
8
|
+
/** Parses content using the given Parser */
|
|
9
|
+
export declare function Parse<Parser extends Types.IParser>(parser: Parser, content: string): [] | [Types.StaticParser<Parser>, string];
|