From 023208a4f2f4fc9349023a098651fe9b6a77531b Mon Sep 17 00:00:00 2001 From: sinclair Date: Thu, 30 Nov 2023 20:05:28 +0900 Subject: [PATCH] Support ESM --- examples/index.ts | 41 +----- examples/typedef/typedef.ts | 2 +- index.mjs | 4 + package.json | 16 +- src/compiler/{compiler.ts => compiler.mts} | 86 +++++------ src/compiler/{index.ts => index.mts} | 4 +- src/errors/{errors.ts => errors.mts} | 78 +++++----- src/errors/{index.ts => index.mts} | 2 +- src/{index.ts => index.mts} | 138 +++++++++--------- src/system/{errors.ts => errors.mts} | 6 +- src/system/{index.ts => index.mts} | 8 +- src/system/{policy.ts => policy.mts} | 2 +- src/system/{system.ts => system.mts} | 6 +- src/tsconfig.json | 2 +- src/type/any/{any.ts => any.mts} | 4 +- src/type/{array/index.ts => any/index.mts} | 2 +- src/type/array/{array.ts => array.mts} | 8 +- src/type/array/index.mts | 29 ++++ .../{async-iterator.ts => async-iterator.mts} | 8 +- src/type/async-iterator/index.mts | 29 ++++ src/type/awaited/{awaited.ts => awaited.mts} | 12 +- src/type/awaited/index.mts | 29 ++++ src/type/bigint/{bigint.ts => bigint.mts} | 4 +- src/type/bigint/index.mts | 29 ++++ src/type/boolean/{boolean.ts => boolean.mts} | 4 +- src/type/boolean/index.mts | 29 ++++ src/type/boolean/index.ts | 29 ---- src/type/clone/index.mts | 30 ++++ src/type/clone/index.ts | 30 ---- src/type/clone/{type.ts => type.mts} | 4 +- src/type/clone/{value.ts => value.mts} | 2 +- .../composite/{composite.ts => composite.mts} | 14 +- src/type/composite/index.mts | 29 ++++ src/type/composite/index.ts | 29 ---- src/type/const/{const.ts => const.mts} | 38 ++--- src/type/const/index.mts | 29 ++++ src/type/const/index.ts | 29 ---- ...rameters.ts => constructor-parameters.mts} | 10 +- src/type/constructor-parameters/index.mts | 29 ++++ src/type/constructor-parameters/index.ts | 29 ---- .../{constructor.ts => constructor.mts} | 10 +- src/type/constructor/index.mts | 29 ++++ src/type/constructor/index.ts | 29 ---- src/type/date/{date.ts => date.mts} | 4 +- src/type/{awaited/index.ts => date/index.mts} | 2 +- src/type/date/index.ts | 29 ---- src/type/deref/{deref.ts => deref.mts} | 34 ++--- src/type/deref/index.mts | 29 ++++ src/type/deref/index.ts | 29 ---- src/type/discard/{discard.ts => discard.mts} | 0 src/type/discard/index.mts | 29 ++++ src/type/discard/index.ts | 29 ---- .../distinct/{distinct.ts => distinct.mts} | 4 +- src/type/distinct/index.mts | 29 ++++ src/type/distinct/index.ts | 29 ---- src/type/enum/{enum.ts => enum.mts} | 10 +- src/type/enum/index.mts | 29 ++++ src/type/enum/index.ts | 29 ---- src/type/exclude/{exclude.ts => exclude.mts} | 22 +-- src/type/exclude/index.mts | 29 ++++ src/type/exclude/index.ts | 29 ---- .../{extends-check.ts => extends-check.mts} | 64 ++++---- ...nds-undefined.ts => extends-undefined.mts} | 10 +- src/type/extends/{extends.ts => extends.mts} | 12 +- src/type/extends/index.mts | 31 ++++ src/type/extends/index.ts | 31 ---- src/type/extract/{extract.ts => extract.mts} | 22 +-- src/type/extract/index.mts | 29 ++++ src/type/extract/index.ts | 29 ---- .../function/{function.ts => function.mts} | 10 +- src/type/function/index.mts | 29 ++++ src/type/function/index.ts | 29 ---- src/type/guard/index.mts | 30 ++++ src/type/guard/index.ts | 30 ---- src/type/guard/{type.ts => type.mts} | 74 +++++----- src/type/guard/{value.ts => value.mts} | 0 src/type/helpers/{helpers.ts => helpers.mts} | 6 +- src/type/helpers/index.mts | 29 ++++ src/type/helpers/index.ts | 29 ---- src/type/index.mts | 98 +++++++++++++ src/type/index.ts | 98 ------------- src/type/indexed/index.mts | 31 ++++ src/type/indexed/index.ts | 31 ---- .../{indexed-key.ts => indexed-key.mts} | 14 +- .../{indexed-type.ts => indexed-type.mts} | 22 +-- src/type/indexed/{indexed.ts => indexed.mts} | 10 +- src/type/instance-type/index.mts | 29 ++++ src/type/instance-type/index.ts | 29 ---- .../{instance-type.ts => instance-type.mts} | 6 +- src/type/integer/index.mts | 29 ++++ src/type/integer/index.ts | 29 ---- src/type/integer/{integer.ts => integer.mts} | 4 +- src/type/intersect/index.mts | 29 ++++ src/type/intersect/index.ts | 29 ---- .../intersect/{intersect.ts => intersect.mts} | 16 +- src/type/intrinsic/index.mts | 29 ++++ src/type/intrinsic/index.ts | 29 ---- .../intrinsic/{intrinsic.ts => intrinsic.mts} | 12 +- src/type/iterator/index.mts | 29 ++++ src/type/iterator/index.ts | 29 ---- .../iterator/{iterator.ts => iterator.mts} | 8 +- src/type/keyof/index.mts | 31 ++++ src/type/keyof/index.ts | 31 ---- .../{keyof-string.ts => keyof-string.mts} | 20 +-- .../keyof/{keyof-type.ts => keyof-type.mts} | 12 +- src/type/keyof/{keyof.ts => keyof.mts} | 6 +- src/type/literal/index.mts | 29 ++++ src/type/literal/index.ts | 29 ---- src/type/literal/{literal.ts => literal.mts} | 4 +- src/type/mapped/index.mts | 29 ++++ src/type/mapped/index.ts | 29 ---- src/type/mapped/{mapped.ts => mapped.mts} | 16 +- src/type/modifiers/index.mts | 29 ++++ src/type/modifiers/index.ts | 29 ---- .../modifiers/{modifiers.ts => modifiers.mts} | 16 +- src/type/never/index.mts | 28 ++++ src/type/never/index.ts | 28 ---- src/type/never/{never.ts => never.mts} | 4 +- src/type/{bigint/index.ts => not/index.mts} | 2 +- src/type/not/index.ts | 29 ---- src/type/not/{not.ts => not.mts} | 8 +- src/type/null/index.mts | 29 ++++ src/type/null/index.ts | 29 ---- src/type/null/{null.ts => null.mts} | 4 +- src/type/number/index.mts | 29 ++++ src/type/number/index.ts | 29 ---- src/type/number/{number.ts => number.mts} | 4 +- src/type/object/index.mts | 29 ++++ src/type/object/index.ts | 29 ---- src/type/object/{object.ts => object.mts} | 16 +- src/type/omit/index.mts | 29 ++++ src/type/omit/index.ts | 29 ---- src/type/omit/{omit.ts => omit.mts} | 22 +-- src/type/operators/index.mts | 29 ++++ src/type/operators/index.ts | 29 ---- .../operators/{operators.ts => operators.mts} | 0 src/type/optional/index.mts | 29 ++++ src/type/optional/index.ts | 29 ---- .../optional/{optional.ts => optional.mts} | 6 +- .../index.ts => parameters/index.mts} | 2 +- src/type/parameters/index.ts | 29 ---- .../{parameters.ts => parameters.mts} | 10 +- src/type/partial/index.mts | 29 ++++ src/type/partial/index.ts | 29 ---- src/type/partial/{partial.ts => partial.mts} | 26 ++-- src/type/patterns/index.mts | 29 ++++ src/type/patterns/index.ts | 29 ---- .../patterns/{patterns.ts => patterns.mts} | 0 src/type/pick/index.mts | 29 ++++ src/type/pick/index.ts | 29 ---- src/type/pick/{pick.ts => pick.mts} | 22 +-- src/type/promise/index.mts | 29 ++++ src/type/promise/index.ts | 29 ---- src/type/promise/{promise.ts => promise.mts} | 8 +- src/type/readonly-optional/index.mts | 29 ++++ src/type/readonly-optional/index.ts | 29 ---- ...only-optional.ts => readonly-optional.mts} | 6 +- src/type/readonly/index.mts | 29 ++++ src/type/readonly/index.ts | 29 ---- .../readonly/{readonly.ts => readonly.mts} | 6 +- src/type/record/index.mts | 29 ++++ src/type/record/index.ts | 29 ---- src/type/record/{record.ts => record.mts} | 36 ++--- src/type/recursive/index.mts | 29 ++++ src/type/recursive/index.ts | 29 ---- .../recursive/{recursive.ts => recursive.mts} | 10 +- src/type/{any/index.ts => ref/index.mts} | 2 +- src/type/ref/index.ts | 29 ---- src/type/ref/{ref.ts => ref.mts} | 8 +- src/type/regexp/index.mts | 29 ++++ src/type/regexp/index.ts | 29 ---- src/type/regexp/{regexp.ts => regexp.mts} | 8 +- src/type/registry/{format.ts => format.mts} | 0 src/type/registry/index.mts | 30 ++++ src/type/registry/index.ts | 30 ---- src/type/registry/{type.ts => type.mts} | 0 src/type/required/index.mts | 29 ++++ src/type/required/index.ts | 29 ---- .../required/{required.ts => required.mts} | 26 ++-- src/type/rest/index.mts | 29 ++++ src/type/rest/index.ts | 29 ---- src/type/rest/{rest.ts => rest.mts} | 12 +- src/type/return-type/index.mts | 29 ++++ src/type/return-type/index.ts | 29 ---- .../{return-type.ts => return-type.mts} | 6 +- .../schema/{anyschema.ts => anyschema.mts} | 62 ++++---- src/type/schema/index.mts | 30 ++++ src/type/schema/index.ts | 30 ---- src/type/schema/{schema.ts => schema.mts} | 2 +- src/type/static/index.mts | 29 ++++ src/type/static/index.ts | 29 ---- src/type/static/{static.ts => static.mts} | 42 +++--- src/type/strict/index.mts | 29 ++++ src/type/strict/index.ts | 29 ---- src/type/strict/{strict.ts => strict.mts} | 2 +- src/type/string/index.mts | 29 ++++ src/type/string/index.ts | 29 ---- src/type/string/{string.ts => string.mts} | 4 +- src/type/symbol/index.mts | 29 ++++ src/type/symbol/index.ts | 29 ---- src/type/symbol/{symbol.ts => symbol.mts} | 4 +- src/type/symbols/index.mts | 29 ++++ src/type/symbols/index.ts | 29 ---- src/type/symbols/{symbols.ts => symbols.mts} | 0 .../{finite.ts => finite.mts} | 18 +-- .../{generate.ts => generate.mts} | 8 +- src/type/template-literal/index.mts | 35 +++++ src/type/template-literal/index.ts | 35 ----- .../{parser.ts => parser.mts} | 0 .../{pattern.ts => pattern.mts} | 10 +- .../{syntax.ts => syntax.mts} | 18 +-- ...mplate-literal.ts => template-literal.mts} | 32 ++-- .../template-literal/{union.ts => union.mts} | 16 +- src/type/transform/index.mts | 29 ++++ src/type/transform/index.ts | 29 ---- .../transform/{transform.ts => transform.mts} | 10 +- src/type/tuple/index.mts | 29 ++++ src/type/tuple/index.ts | 29 ---- src/type/tuple/{tuple.ts => tuple.mts} | 8 +- src/type/type/{index.ts => index.mts} | 6 +- .../type/{javascript.ts => javascript.mts} | 38 ++--- src/type/type/{json.ts => json.mts} | 82 +++++------ src/type/type/type.mts | 89 +++++++++++ src/type/type/type.ts | 89 ----------- src/type/uint8array/index.mts | 29 ++++ src/type/uint8array/index.ts | 29 ---- .../{uint8array.ts => uint8array.mts} | 4 +- src/type/undefined/index.mts | 29 ++++ src/type/undefined/index.ts | 29 ---- .../undefined/{undefined.ts => undefined.mts} | 4 +- src/type/union/index.mts | 29 ++++ src/type/union/index.ts | 29 ---- src/type/union/{union.ts => union.mts} | 12 +- src/type/unknown/index.mts | 29 ++++ src/type/unknown/index.ts | 29 ---- src/type/unknown/{unknown.ts => unknown.mts} | 4 +- src/type/unsafe/index.mts | 29 ++++ src/type/unsafe/index.ts | 29 ---- src/type/unsafe/{unsafe.ts => unsafe.mts} | 4 +- src/type/void/index.mts | 29 ++++ src/type/void/index.ts | 29 ---- src/type/void/{void.ts => void.mts} | 4 +- src/value/cast/{cast.ts => cast.mts} | 36 ++--- src/value/cast/{index.ts => index.mts} | 2 +- src/value/check/{check.ts => check.mts} | 82 +++++------ src/value/{clean/index.ts => check/index.mts} | 2 +- src/value/clean/{clean.ts => clean.mts} | 32 ++-- src/value/{clone/index.ts => clean/index.mts} | 2 +- src/value/clone/{clone.ts => clone.mts} | 4 +- src/value/clone/index.mts | 29 ++++ src/value/convert/{convert.ts => convert.mts} | 52 +++---- src/value/convert/index.mts | 29 ++++ src/value/convert/index.ts | 29 ---- src/value/create/{create.ts => create.mts} | 78 +++++----- src/value/create/index.mts | 29 ++++ src/value/create/index.ts | 29 ---- src/value/default/{default.ts => default.mts} | 28 ++-- src/value/default/index.mts | 29 ++++ src/value/default/index.ts | 29 ---- src/value/delta/{delta.ts => delta.mts} | 20 +-- src/value/delta/index.mts | 29 ++++ src/value/delta/index.ts | 29 ---- src/value/deref/{deref.ts => deref.mts} | 6 +- src/value/deref/index.mts | 29 ++++ src/value/deref/index.ts | 29 ---- src/value/equal/{equal.ts => equal.mts} | 4 +- src/value/equal/index.mts | 29 ++++ src/value/equal/index.ts | 29 ---- src/value/guard/{guard.ts => guard.mts} | 0 src/value/guard/index.mts | 29 ++++ src/value/guard/index.ts | 29 ---- src/value/hash/{hash.ts => hash.mts} | 2 +- src/value/{check/index.ts => hash/index.mts} | 2 +- src/value/hash/index.ts | 29 ---- src/value/{index.ts => index.mts} | 32 ++-- src/value/mutate/index.mts | 29 ++++ src/value/mutate/index.ts | 29 ---- src/value/mutate/{mutate.ts => mutate.mts} | 6 +- src/value/pointer/index.mts | 29 ++++ src/value/pointer/index.ts | 29 ---- src/value/pointer/{pointer.ts => pointer.mts} | 0 src/value/transform/{decode.ts => decode.mts} | 36 ++--- src/value/transform/{encode.ts => encode.mts} | 36 ++--- src/value/transform/{has.ts => has.mts} | 38 ++--- src/value/transform/index.mts | 31 ++++ src/value/transform/index.ts | 31 ---- src/value/value/index.mts | 29 ++++ src/value/value/index.ts | 29 ---- src/value/value/{value.ts => value.mts} | 30 ++-- tsconfig.json | 16 +- 290 files changed, 3494 insertions(+), 3529 deletions(-) create mode 100644 index.mjs rename src/compiler/{compiler.ts => compiler.mts} (93%) rename src/compiler/{index.ts => index.mts} (96%) rename src/errors/{errors.ts => errors.mts} (93%) rename src/errors/{index.ts => index.mts} (97%) rename src/{index.ts => index.mts} (59%) rename src/system/{errors.ts => errors.mts} (98%) rename src/system/{index.ts => index.mts} (89%) rename src/system/{policy.ts => policy.mts} (99%) rename src/system/{system.ts => system.mts} (96%) rename src/type/any/{any.ts => any.mts} (93%) rename src/type/{array/index.ts => any/index.mts} (98%) rename src/type/array/{array.ts => array.mts} (92%) create mode 100644 src/type/array/index.mts rename src/type/async-iterator/{async-iterator.ts => async-iterator.mts} (90%) create mode 100644 src/type/async-iterator/index.mts rename src/type/awaited/{awaited.ts => awaited.mts} (92%) create mode 100644 src/type/awaited/index.mts rename src/type/bigint/{bigint.ts => bigint.mts} (94%) create mode 100644 src/type/bigint/index.mts rename src/type/boolean/{boolean.ts => boolean.mts} (94%) create mode 100644 src/type/boolean/index.mts delete mode 100644 src/type/boolean/index.ts create mode 100644 src/type/clone/index.mts delete mode 100644 src/type/clone/index.ts rename src/type/clone/{type.ts => type.mts} (94%) rename src/type/clone/{value.ts => value.mts} (97%) rename src/type/composite/{composite.ts => composite.mts} (90%) create mode 100644 src/type/composite/index.mts delete mode 100644 src/type/composite/index.ts rename src/type/const/{const.ts => const.mts} (84%) create mode 100644 src/type/const/index.mts delete mode 100644 src/type/const/index.ts rename src/type/constructor-parameters/{constructor-parameters.ts => constructor-parameters.mts} (87%) create mode 100644 src/type/constructor-parameters/index.mts delete mode 100644 src/type/constructor-parameters/index.ts rename src/type/constructor/{constructor.ts => constructor.mts} (91%) create mode 100644 src/type/constructor/index.mts delete mode 100644 src/type/constructor/index.ts rename src/type/date/{date.ts => date.mts} (95%) rename src/type/{awaited/index.ts => date/index.mts} (97%) delete mode 100644 src/type/date/index.ts rename src/type/deref/{deref.ts => deref.mts} (88%) create mode 100644 src/type/deref/index.mts delete mode 100644 src/type/deref/index.ts rename src/type/discard/{discard.ts => discard.mts} (100%) create mode 100644 src/type/discard/index.mts delete mode 100644 src/type/discard/index.ts rename src/type/distinct/{distinct.ts => distinct.mts} (95%) create mode 100644 src/type/distinct/index.mts delete mode 100644 src/type/distinct/index.ts rename src/type/enum/{enum.ts => enum.mts} (89%) create mode 100644 src/type/enum/index.mts delete mode 100644 src/type/enum/index.ts rename src/type/exclude/{exclude.ts => exclude.mts} (87%) create mode 100644 src/type/exclude/index.mts delete mode 100644 src/type/exclude/index.ts rename src/type/extends/{extends-check.ts => extends-check.mts} (94%) rename src/type/extends/{extends-undefined.ts => extends-undefined.mts} (89%) rename src/type/extends/{extends.ts => extends.mts} (88%) create mode 100644 src/type/extends/index.mts delete mode 100644 src/type/extends/index.ts rename src/type/extract/{extract.ts => extract.mts} (87%) create mode 100644 src/type/extract/index.mts delete mode 100644 src/type/extract/index.ts rename src/type/function/{function.ts => function.mts} (91%) create mode 100644 src/type/function/index.mts delete mode 100644 src/type/function/index.ts create mode 100644 src/type/guard/index.mts delete mode 100644 src/type/guard/index.ts rename src/type/guard/{type.ts => type.mts} (90%) rename src/type/guard/{value.ts => value.mts} (100%) rename src/type/helpers/{helpers.ts => helpers.mts} (96%) create mode 100644 src/type/helpers/index.mts delete mode 100644 src/type/helpers/index.ts create mode 100644 src/type/index.mts delete mode 100644 src/type/index.ts create mode 100644 src/type/indexed/index.mts delete mode 100644 src/type/indexed/index.ts rename src/type/indexed/{indexed-key.ts => indexed-key.mts} (93%) rename src/type/indexed/{indexed-type.ts => indexed-type.mts} (92%) rename src/type/indexed/{indexed.ts => indexed.mts} (88%) create mode 100644 src/type/instance-type/index.mts delete mode 100644 src/type/instance-type/index.ts rename src/type/instance-type/{instance-type.ts => instance-type.mts} (91%) create mode 100644 src/type/integer/index.mts delete mode 100644 src/type/integer/index.ts rename src/type/integer/{integer.ts => integer.mts} (94%) create mode 100644 src/type/intersect/index.mts delete mode 100644 src/type/intersect/index.ts rename src/type/intersect/{intersect.ts => intersect.mts} (89%) create mode 100644 src/type/intrinsic/index.mts delete mode 100644 src/type/intrinsic/index.ts rename src/type/intrinsic/{intrinsic.ts => intrinsic.mts} (96%) create mode 100644 src/type/iterator/index.mts delete mode 100644 src/type/iterator/index.ts rename src/type/iterator/{iterator.ts => iterator.mts} (90%) create mode 100644 src/type/keyof/index.mts delete mode 100644 src/type/keyof/index.ts rename src/type/keyof/{keyof-string.ts => keyof-string.mts} (93%) rename src/type/keyof/{keyof-type.ts => keyof-type.mts} (90%) rename src/type/keyof/{keyof.ts => keyof.mts} (91%) create mode 100644 src/type/literal/index.mts delete mode 100644 src/type/literal/index.ts rename src/type/literal/{literal.ts => literal.mts} (95%) create mode 100644 src/type/mapped/index.mts delete mode 100644 src/type/mapped/index.ts rename src/type/mapped/{mapped.ts => mapped.mts} (92%) create mode 100644 src/type/modifiers/index.mts delete mode 100644 src/type/modifiers/index.ts rename src/type/modifiers/{modifiers.ts => modifiers.mts} (92%) create mode 100644 src/type/never/index.mts delete mode 100644 src/type/never/index.ts rename src/type/never/{never.ts => never.mts} (94%) rename src/type/{bigint/index.ts => not/index.mts} (98%) delete mode 100644 src/type/not/index.ts rename src/type/not/{not.ts => not.mts} (89%) create mode 100644 src/type/null/index.mts delete mode 100644 src/type/null/index.ts rename src/type/null/{null.ts => null.mts} (94%) create mode 100644 src/type/number/index.mts delete mode 100644 src/type/number/index.ts rename src/type/number/{number.ts => number.mts} (94%) create mode 100644 src/type/object/index.mts delete mode 100644 src/type/object/index.ts rename src/type/object/{object.ts => object.mts} (92%) create mode 100644 src/type/omit/index.mts delete mode 100644 src/type/omit/index.ts rename src/type/omit/{omit.ts => omit.mts} (90%) create mode 100644 src/type/operators/index.mts delete mode 100644 src/type/operators/index.ts rename src/type/operators/{operators.ts => operators.mts} (100%) create mode 100644 src/type/optional/index.mts delete mode 100644 src/type/optional/index.ts rename src/type/optional/{optional.ts => optional.mts} (92%) rename src/type/{async-iterator/index.ts => parameters/index.mts} (97%) delete mode 100644 src/type/parameters/index.ts rename src/type/parameters/{parameters.ts => parameters.mts} (86%) create mode 100644 src/type/partial/index.mts delete mode 100644 src/type/partial/index.ts rename src/type/partial/{partial.ts => partial.mts} (86%) create mode 100644 src/type/patterns/index.mts delete mode 100644 src/type/patterns/index.ts rename src/type/patterns/{patterns.ts => patterns.mts} (100%) create mode 100644 src/type/pick/index.mts delete mode 100644 src/type/pick/index.ts rename src/type/pick/{pick.ts => pick.mts} (90%) create mode 100644 src/type/promise/index.mts delete mode 100644 src/type/promise/index.ts rename src/type/promise/{promise.ts => promise.mts} (90%) create mode 100644 src/type/readonly-optional/index.mts delete mode 100644 src/type/readonly-optional/index.ts rename src/type/readonly-optional/{readonly-optional.ts => readonly-optional.mts} (90%) create mode 100644 src/type/readonly/index.mts delete mode 100644 src/type/readonly/index.ts rename src/type/readonly/{readonly.ts => readonly.mts} (92%) create mode 100644 src/type/record/index.mts delete mode 100644 src/type/record/index.ts rename src/type/record/{record.ts => record.mts} (90%) create mode 100644 src/type/recursive/index.mts delete mode 100644 src/type/recursive/index.ts rename src/type/recursive/{recursive.ts => recursive.mts} (91%) rename src/type/{any/index.ts => ref/index.mts} (98%) delete mode 100644 src/type/ref/index.ts rename src/type/ref/{ref.ts => ref.mts} (91%) create mode 100644 src/type/regexp/index.mts delete mode 100644 src/type/regexp/index.ts rename src/type/regexp/{regexp.ts => regexp.mts} (91%) rename src/type/registry/{format.ts => format.mts} (100%) create mode 100644 src/type/registry/index.mts delete mode 100644 src/type/registry/index.ts rename src/type/registry/{type.ts => type.mts} (100%) create mode 100644 src/type/required/index.mts delete mode 100644 src/type/required/index.ts rename src/type/required/{required.ts => required.mts} (87%) create mode 100644 src/type/rest/index.mts delete mode 100644 src/type/rest/index.ts rename src/type/rest/{rest.ts => rest.mts} (88%) create mode 100644 src/type/return-type/index.mts delete mode 100644 src/type/return-type/index.ts rename src/type/return-type/{return-type.ts => return-type.mts} (91%) rename src/type/schema/{anyschema.ts => anyschema.mts} (57%) create mode 100644 src/type/schema/index.mts delete mode 100644 src/type/schema/index.ts rename src/type/schema/{schema.ts => schema.mts} (99%) create mode 100644 src/type/static/index.mts delete mode 100644 src/type/static/index.ts rename src/type/static/{static.ts => static.mts} (77%) create mode 100644 src/type/strict/index.mts delete mode 100644 src/type/strict/index.ts rename src/type/strict/{strict.ts => strict.mts} (96%) create mode 100644 src/type/string/index.mts delete mode 100644 src/type/string/index.ts rename src/type/string/{string.ts => string.mts} (96%) create mode 100644 src/type/symbol/index.mts delete mode 100644 src/type/symbol/index.ts rename src/type/symbol/{symbol.ts => symbol.mts} (94%) create mode 100644 src/type/symbols/index.mts delete mode 100644 src/type/symbols/index.ts rename src/type/symbols/{symbols.ts => symbols.mts} (100%) rename src/type/template-literal/{finite.ts => finite.mts} (89%) rename src/type/template-literal/{generate.ts => generate.mts} (97%) create mode 100644 src/type/template-literal/index.mts delete mode 100644 src/type/template-literal/index.ts rename src/type/template-literal/{parser.ts => parser.mts} (100%) rename src/type/template-literal/{pattern.ts => pattern.mts} (93%) rename src/type/template-literal/{syntax.ts => syntax.mts} (88%) rename src/type/template-literal/{template-literal.ts => template-literal.mts} (81%) rename src/type/template-literal/{union.ts => union.mts} (80%) create mode 100644 src/type/transform/index.mts delete mode 100644 src/type/transform/index.ts rename src/type/transform/{transform.ts => transform.mts} (93%) create mode 100644 src/type/tuple/index.mts delete mode 100644 src/type/tuple/index.ts rename src/type/tuple/{tuple.ts => tuple.mts} (92%) rename src/type/type/{index.ts => index.mts} (92%) rename src/type/type/{javascript.ts => javascript.mts} (88%) rename src/type/type/{json.ts => json.mts} (88%) create mode 100644 src/type/type/type.mts delete mode 100644 src/type/type/type.ts create mode 100644 src/type/uint8array/index.mts delete mode 100644 src/type/uint8array/index.ts rename src/type/uint8array/{uint8array.ts => uint8array.mts} (94%) create mode 100644 src/type/undefined/index.mts delete mode 100644 src/type/undefined/index.ts rename src/type/undefined/{undefined.ts => undefined.mts} (94%) create mode 100644 src/type/union/index.mts delete mode 100644 src/type/union/index.ts rename src/type/union/{union.ts => union.mts} (88%) create mode 100644 src/type/unknown/index.mts delete mode 100644 src/type/unknown/index.ts rename src/type/unknown/{unknown.ts => unknown.mts} (94%) create mode 100644 src/type/unsafe/index.mts delete mode 100644 src/type/unsafe/index.ts rename src/type/unsafe/{unsafe.ts => unsafe.mts} (94%) create mode 100644 src/type/void/index.mts delete mode 100644 src/type/void/index.ts rename src/type/void/{void.ts => void.mts} (94%) rename src/value/cast/{cast.ts => cast.mts} (92%) rename src/value/cast/{index.ts => index.mts} (97%) rename src/value/check/{check.ts => check.mts} (88%) rename src/value/{clean/index.ts => check/index.mts} (97%) rename src/value/clean/{clean.ts => clean.mts} (90%) rename src/value/{clone/index.ts => clean/index.mts} (97%) rename src/value/clone/{clone.ts => clone.mts} (97%) create mode 100644 src/value/clone/index.mts rename src/value/convert/{convert.ts => convert.mts} (89%) create mode 100644 src/value/convert/index.mts delete mode 100644 src/value/convert/index.ts rename src/value/create/{create.ts => create.mts} (87%) create mode 100644 src/value/create/index.mts delete mode 100644 src/value/create/index.ts rename src/value/default/{default.ts => default.mts} (91%) create mode 100644 src/value/default/index.mts delete mode 100644 src/value/default/index.ts rename src/value/delta/{delta.ts => delta.mts} (94%) create mode 100644 src/value/delta/index.mts delete mode 100644 src/value/delta/index.ts rename src/value/deref/{deref.ts => deref.mts} (91%) create mode 100644 src/value/deref/index.mts delete mode 100644 src/value/deref/index.ts rename src/value/equal/{equal.ts => equal.mts} (98%) create mode 100644 src/value/equal/index.mts delete mode 100644 src/value/equal/index.ts rename src/value/guard/{guard.ts => guard.mts} (100%) create mode 100644 src/value/guard/index.mts delete mode 100644 src/value/guard/index.ts rename src/value/hash/{hash.ts => hash.mts} (99%) rename src/value/{check/index.ts => hash/index.mts} (97%) delete mode 100644 src/value/hash/index.ts rename src/value/{index.ts => index.mts} (83%) create mode 100644 src/value/mutate/index.mts delete mode 100644 src/value/mutate/index.ts rename src/value/mutate/{mutate.ts => mutate.mts} (97%) create mode 100644 src/value/pointer/index.mts delete mode 100644 src/value/pointer/index.ts rename src/value/pointer/{pointer.ts => pointer.mts} (100%) rename src/value/transform/{decode.ts => decode.mts} (89%) rename src/value/transform/{encode.ts => encode.mts} (89%) rename src/value/transform/{has.ts => has.mts} (84%) create mode 100644 src/value/transform/index.mts delete mode 100644 src/value/transform/index.ts create mode 100644 src/value/value/index.mts delete mode 100644 src/value/value/index.ts rename src/value/value/{value.ts => value.mts} (93%) diff --git a/examples/index.ts b/examples/index.ts index ed52156bd..4f3ea9ee4 100644 --- a/examples/index.ts +++ b/examples/index.ts @@ -1,40 +1 @@ -import { TypeSystem } from '@sinclair/typebox/system' -import { TypeCompiler } from '@sinclair/typebox/compiler' -import { Value, ValuePointer } from '@sinclair/typebox/value' -import { Type, TypeGuard, Kind, Static, TSchema } from '@sinclair/typebox' - -// ----------------------------------------------------------- -// Create: Type -// ----------------------------------------------------------- - -const T = Type.Object({ - x: Type.Number(), - y: Type.Number(), - z: Type.Number(), -}) - -type T = Static - -console.log(T) - -// ----------------------------------------------------------- -// Create: Value -// ----------------------------------------------------------- - -const V = Value.Create(T) - -console.log(V) - -// ----------------------------------------------------------- -// Compile: Type -// ----------------------------------------------------------- - -const C = TypeCompiler.Compile(T) - -console.log(C.Code()) - -// ----------------------------------------------------------- -// Check: Value -// ----------------------------------------------------------- - -console.log(C.Check(V)) +import { String } from 'typebox' \ No newline at end of file diff --git a/examples/typedef/typedef.ts b/examples/typedef/typedef.ts index de35fa9bd..a5a59d497 100644 --- a/examples/typedef/typedef.ts +++ b/examples/typedef/typedef.ts @@ -27,7 +27,7 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ import { TypeSystemErrorFunction, DefaultErrorFunction } from '@sinclair/typebox/system' -import * as Types from '@sinclair/typebox/type' +import * as Types from '@sinclair/typebox/type/index.mjs' // -------------------------------------------------------------------------- // Metadata diff --git a/index.mjs b/index.mjs new file mode 100644 index 000000000..291ddffc1 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ + +import { Any } from 'typebox' + + diff --git a/package.json b/package.json index 74821ee41..f7e8f2c47 100644 --- a/package.json +++ b/package.json @@ -10,15 +10,15 @@ ], "author": "sinclairzx81", "license": "MIT", - "main": "./typebox.js", - "types": "./typebox.d.ts", + "module": "./index.mjs", + "types": "./index.d.mts", "exports": { - "./compiler": "./compiler/index.js", - "./errors": "./errors/index.js", - "./system": "./system/index.js", - "./type": "./type/index.js", - "./value": "./value/index.js", - ".": "./index.js" + "./compiler": "./compiler/index.mjs", + "./errors": "./errors/index.mjs", + "./system": "./system/index.mjs", + "./type": "./type/index.mjs", + "./value": "./value/index.mjs", + ".": "./index.mjs" }, "repository": { "type": "git", diff --git a/src/compiler/compiler.ts b/src/compiler/compiler.mts similarity index 93% rename from src/compiler/compiler.ts rename to src/compiler/compiler.mts index 6f7805709..76c9d2cc1 100644 --- a/src/compiler/compiler.ts +++ b/src/compiler/compiler.mts @@ -26,51 +26,51 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { Encode as TransformEncode, Decode as TransformDecode, HasTransform, TransformDecodeCheckError, TransformEncodeCheckError } from '../value/transform/index' -import { IsArray, IsString, IsNumber, IsBigInt } from '../value/guard/index' -import { Errors, ValueErrorIterator } from '../errors/index' -import { TypeSystemPolicy } from '../system/index' -import { Deref } from '../value/deref/index' -import { Hash } from '../value/hash/index' -import { Kind } from '../type/symbols/index' +import { Encode as TransformEncode, Decode as TransformDecode, HasTransform, TransformDecodeCheckError, TransformEncodeCheckError } from '../value/transform/index.mjs' +import { IsArray, IsString, IsNumber, IsBigInt } from '../value/guard/index.mjs' +import { Errors, ValueErrorIterator } from '../errors/index.mjs' +import { TypeSystemPolicy } from '../system/index.mjs' +import { Deref } from '../value/deref/index.mjs' +import { Hash } from '../value/hash/index.mjs' +import { Kind } from '../type/symbols/index.mjs' -import { TSchema as IsSchemaType } from '../type/guard/type' -import { TypeRegistry, FormatRegistry } from '../type/registry/index' -import { KeyOfStringResolvePattern } from '../type/keyof/index' -import { ExtendsUndefinedCheck } from '../type/extends/extends-undefined' +import { TSchema as IsSchemaType } from '../type/guard/type.mjs' +import { TypeRegistry, FormatRegistry } from '../type/registry/index.mjs' +import { KeyOfStringResolvePattern } from '../type/keyof/index.mjs' +import { ExtendsUndefinedCheck } from '../type/extends/extends-undefined.mjs' -import type { TSchema } from '../type/schema/index' -import type { TAsyncIterator } from '../type/async-iterator/index' -import type { TAny } from '../type/any/index' -import type { TArray } from '../type/array/index' -import type { TBigInt } from '../type/bigint/index' -import type { TBoolean } from '../type/boolean/index' -import type { TDate } from '../type/date/index' -import type { TConstructor } from '../type/constructor/index' -import type { TFunction } from '../type/function/index' -import type { TInteger } from '../type/integer/index' -import type { TIntersect } from '../type/intersect/index' -import type { TIterator } from '../type/iterator/index' -import type { TLiteral } from '../type/literal/index' -import { Never, type TNever } from '../type/never/index' -import type { TNot } from '../type/not/index' -import type { TNull } from '../type/null/index' -import type { TNumber } from '../type/number/index' -import type { TObject } from '../type/object/index' -import type { TPromise } from '../type/promise/index' -import type { TRecord } from '../type/record/index' -import type { TRef } from '../type/ref/index' -import type { TTemplateLiteral } from '../type/template-literal/index' -import type { TThis } from '../type/recursive/index' -import type { TTuple } from '../type/tuple/index' -import type { TUnion } from '../type/union/index' -import type { TUnknown } from '../type/unknown/index' -import type { Static, StaticDecode, StaticEncode } from '../type/static/index' -import type { TString } from '../type/string/index' -import type { TSymbol } from '../type/symbol/index' -import type { TUndefined } from '../type/undefined/index' -import type { TUint8Array } from '../type/uint8array/index' -import type { TVoid } from '../type/void/index' +import type { TSchema } from '../type/schema/index.mjs' +import type { TAsyncIterator } from '../type/async-iterator/index.mjs' +import type { TAny } from '../type/any/index.mjs' +import type { TArray } from '../type/array/index.mjs' +import type { TBigInt } from '../type/bigint/index.mjs' +import type { TBoolean } from '../type/boolean/index.mjs' +import type { TDate } from '../type/date/index.mjs' +import type { TConstructor } from '../type/constructor/index.mjs' +import type { TFunction } from '../type/function/index.mjs' +import type { TInteger } from '../type/integer/index.mjs' +import type { TIntersect } from '../type/intersect/index.mjs' +import type { TIterator } from '../type/iterator/index.mjs' +import type { TLiteral } from '../type/literal/index.mjs' +import { Never, type TNever } from '../type/never/index.mjs' +import type { TNot } from '../type/not/index.mjs' +import type { TNull } from '../type/null/index.mjs' +import type { TNumber } from '../type/number/index.mjs' +import type { TObject } from '../type/object/index.mjs' +import type { TPromise } from '../type/promise/index.mjs' +import type { TRecord } from '../type/record/index.mjs' +import type { TRef } from '../type/ref/index.mjs' +import type { TTemplateLiteral } from '../type/template-literal/index.mjs' +import type { TThis } from '../type/recursive/index.mjs' +import type { TTuple } from '../type/tuple/index.mjs' +import type { TUnion } from '../type/union/index.mjs' +import type { TUnknown } from '../type/unknown/index.mjs' +import type { Static, StaticDecode, StaticEncode } from '../type/static/index.mjs' +import type { TString } from '../type/string/index.mjs' +import type { TSymbol } from '../type/symbol/index.mjs' +import type { TUndefined } from '../type/undefined/index.mjs' +import type { TUint8Array } from '../type/uint8array/index.mjs' +import type { TVoid } from '../type/void/index.mjs' // ------------------------------------------------------------------ // CheckFunction diff --git a/src/compiler/index.ts b/src/compiler/index.mts similarity index 96% rename from src/compiler/index.ts rename to src/compiler/index.mts index cc91cb40b..0a3591d0e 100644 --- a/src/compiler/index.ts +++ b/src/compiler/index.mts @@ -26,5 +26,5 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -export { ValueError, ValueErrorType, ValueErrorIterator } from '../errors/index' -export * from './compiler' +export { ValueError, ValueErrorType, ValueErrorIterator } from '../errors/index.mjs' +export * from './compiler.mjs' diff --git a/src/errors/errors.ts b/src/errors/errors.mts similarity index 93% rename from src/errors/errors.ts rename to src/errors/errors.mts index 20198717e..864b4a5b0 100644 --- a/src/errors/errors.ts +++ b/src/errors/errors.mts @@ -26,46 +26,46 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { IsArray, IsUint8Array, IsDate, IsPromise, IsFunction, IsAsyncIterator, IsIterator, IsBoolean, IsNumber, IsBigInt, IsString, IsSymbol, IsInteger, IsNull, IsUndefined } from '../value/guard/index' -import { TypeSystemPolicy, TypeSystemErrorFunction } from '../system/index' -import { KeyOfStringResolvePattern } from '../type/keyof/index' -import { TypeRegistry, FormatRegistry } from '../type/registry/index' -import { ExtendsUndefinedCheck } from '../type/extends/extends-undefined' -import { Deref } from '../value/deref/index' -import { Hash } from '../value/hash/index' -import { Kind } from '../type/symbols/index' +import { IsArray, IsUint8Array, IsDate, IsPromise, IsFunction, IsAsyncIterator, IsIterator, IsBoolean, IsNumber, IsBigInt, IsString, IsSymbol, IsInteger, IsNull, IsUndefined } from '../value/guard/index.mjs' +import { TypeSystemPolicy, TypeSystemErrorFunction } from '../system/index.mjs' +import { KeyOfStringResolvePattern } from '../type/keyof/index.mjs' +import { TypeRegistry, FormatRegistry } from '../type/registry/index.mjs' +import { ExtendsUndefinedCheck } from '../type/extends/extends-undefined.mjs' +import { Deref } from '../value/deref/index.mjs' +import { Hash } from '../value/hash/index.mjs' +import { Kind } from '../type/symbols/index.mjs' -import type { TSchema } from '../type/schema/index' -import type { TAsyncIterator } from '../type/async-iterator/index' -import type { TAny } from '../type/any/index' -import type { TArray } from '../type/array/index' -import type { TBigInt } from '../type/bigint/index' -import type { TBoolean } from '../type/boolean/index' -import type { TDate } from '../type/date/index' -import type { TConstructor } from '../type/constructor/index' -import type { TFunction } from '../type/function/index' -import type { TInteger } from '../type/integer/index' -import type { TIntersect } from '../type/intersect/index' -import type { TIterator } from '../type/iterator/index' -import type { TLiteral } from '../type/literal/index' -import { Never, type TNever } from '../type/never/index' -import type { TNot } from '../type/not/index' -import type { TNull } from '../type/null/index' -import type { TNumber } from '../type/number/index' -import type { TObject } from '../type/object/index' -import type { TPromise } from '../type/promise/index' -import type { TRecord } from '../type/record/index' -import type { TRef } from '../type/ref/index' -import type { TTemplateLiteral } from '../type/template-literal/index' -import type { TThis } from '../type/recursive/index' -import type { TTuple } from '../type/tuple/index' -import type { TUnion } from '../type/union/index' -import type { TUnknown } from '../type/unknown/index' -import type { TString } from '../type/string/index' -import type { TSymbol } from '../type/symbol/index' -import type { TUndefined } from '../type/undefined/index' -import type { TUint8Array } from '../type/uint8array/index' -import type { TVoid } from '../type/void/index' +import type { TSchema } from '../type/schema/index.mjs' +import type { TAsyncIterator } from '../type/async-iterator/index.mjs' +import type { TAny } from '../type/any/index.mjs' +import type { TArray } from '../type/array/index.mjs' +import type { TBigInt } from '../type/bigint/index.mjs' +import type { TBoolean } from '../type/boolean/index.mjs' +import type { TDate } from '../type/date/index.mjs' +import type { TConstructor } from '../type/constructor/index.mjs' +import type { TFunction } from '../type/function/index.mjs' +import type { TInteger } from '../type/integer/index.mjs' +import type { TIntersect } from '../type/intersect/index.mjs' +import type { TIterator } from '../type/iterator/index.mjs' +import type { TLiteral } from '../type/literal/index.mjs' +import { Never, type TNever } from '../type/never/index.mjs' +import type { TNot } from '../type/not/index.mjs' +import type { TNull } from '../type/null/index.mjs' +import type { TNumber } from '../type/number/index.mjs' +import type { TObject } from '../type/object/index.mjs' +import type { TPromise } from '../type/promise/index.mjs' +import type { TRecord } from '../type/record/index.mjs' +import type { TRef } from '../type/ref/index.mjs' +import type { TTemplateLiteral } from '../type/template-literal/index.mjs' +import type { TThis } from '../type/recursive/index.mjs' +import type { TTuple } from '../type/tuple/index.mjs' +import type { TUnion } from '../type/union/index.mjs' +import type { TUnknown } from '../type/unknown/index.mjs' +import type { TString } from '../type/string/index.mjs' +import type { TSymbol } from '../type/symbol/index.mjs' +import type { TUndefined } from '../type/undefined/index.mjs' +import type { TUint8Array } from '../type/uint8array/index.mjs' +import type { TVoid } from '../type/void/index.mjs' // -------------------------------------------------------------------------- // ValueErrorType diff --git a/src/errors/index.ts b/src/errors/index.mts similarity index 97% rename from src/errors/index.ts rename to src/errors/index.mts index 71cdce9af..3e82dd77e 100644 --- a/src/errors/index.ts +++ b/src/errors/index.mts @@ -26,4 +26,4 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -export * from './errors' +export * from './errors.mjs' diff --git a/src/index.ts b/src/index.mts similarity index 59% rename from src/index.ts rename to src/index.mts index 5a69d7882..83338096a 100644 --- a/src/index.ts +++ b/src/index.mts @@ -29,82 +29,82 @@ THE SOFTWARE. // ------------------------------------------------------------------ // Infrastructure // ------------------------------------------------------------------ -export { Kind, Hint, ReadonlyKind, OptionalKind, TransformKind } from './type/symbols/index' -export { PatternBoolean, PatternBooleanExact, PatternNumber, PatternNumberExact, PatternString, PatternStringExact } from './type/patterns/index' -export { TypeRegistry, FormatRegistry } from './type/registry/index' -export { TypeGuard, ValueGuard } from './type/guard/index' -export { CloneType, CloneRest } from './type/clone/type' -export { Clone } from './type/clone/value' +export { Kind, Hint, ReadonlyKind, OptionalKind, TransformKind } from './type/symbols/index.mjs' +export { PatternBoolean, PatternBooleanExact, PatternNumber, PatternNumberExact, PatternString, PatternStringExact } from './type/patterns/index.mjs' +export { TypeRegistry, FormatRegistry } from './type/registry/index.mjs' +export { TypeGuard, ValueGuard } from './type/guard/index.mjs' +export { CloneType, CloneRest } from './type/clone/type.mjs' +export { Clone } from './type/clone/value.mjs' // ------------------------------------------------------------------ // Type // ------------------------------------------------------------------ -export { Any, type TAny } from './type/any/index' -export { Array, type TArray, type ArrayOptions } from './type/array/index' -export { AsyncIterator, type TAsyncIterator } from './type/async-iterator/index' -export { Awaited, type TAwaited } from './type/awaited/index' -export { BigInt, type TBigInt, BigIntOptions } from './type/bigint/index' -export { Boolean, type TBoolean } from './type/boolean/index' -export { Composite, type TComposite } from './type/composite/index' -export { Const, type TConst } from './type/const/index' -export { Constructor, type TConstructor } from './type/constructor/index' -export { ConstructorParameters, type TConstructorParameters } from './type/constructor-parameters/index' -export { Date, type TDate, type DateOptions } from './type/date/index' -export { Deref, type TDeref } from './type/deref/index' -export { Enum, type TEnum } from './type/enum/index' -export { Exclude, type TExclude } from './type/exclude/index' -export { Extends, type TExtends, ExtendsCheck, ExtendsResult, ExtendsUndefinedCheck } from './type/extends/index' -export { Extract, type TExtract } from './type/extract/index' -export { Function, type TFunction } from './type/function/index' -export { Increment, type Assert, type AssertType, type AssertRest, type AssertProperties, type Ensure, type Evaluate, type TupleToIntersect, type TupleToUnion, type UnionToTuple } from './type/helpers/index' -export { Index, type TIndex, IndexedKeyResolve, IndexedTypeResolve } from './type/indexed/index' -export { InstanceType, type TInstanceType } from './type/instance-type/index' -export { Integer, type TInteger, type IntegerOptions } from './type/integer/index' -export { Intersect, type TIntersect, type IntersectOptions } from './type/intersect/index' -export { Iterator, type TIterator } from './type/iterator/index' -export { Capitalize, type TCapitalize, Lowercase, type TLowercase, Uncapitalize, type TUncapitalize, Uppercase, type TUppercase, IntrinsicResolve } from './type/intrinsic/index' -export { KeyOf, type TKeyOf, KeyOfStringResolve, KeyOfStringResolvePattern, KeyOfTypeResolve } from './type/keyof/index' -export { Literal, type TLiteral } from './type/literal/index' -export { Mapped, type TMappedKey, type MappedFunction, type TMappedResult } from './type/mapped/index' -export { Never, type TNever } from './type/never/index' -export { Not, type TNot } from './type/not/index' -export { Null, type TNull } from './type/null/index' -export { Number, type TNumber, type NumberOptions } from './type/number/index' -export { Object, type TObject, type TProperties, type ObjectOptions } from './type/object/index' -export { Omit, type TOmit } from './type/omit/index' -export { Optional, type TOptional } from './type/optional/index' -export { Parameters, type TParameters } from './type/parameters/index' -export { Partial, type TPartial } from './type/partial/index' -export { Pick, type TPick } from './type/pick/index' -export { Promise, type TPromise } from './type/promise/index' -export { Readonly, type TReadonly } from './type/readonly/index' -export { ReadonlyOptional, type TReadonlyOptional } from './type/readonly-optional/index' -export { Record, type TRecord } from './type/record/index' -export { Recursive, type TRecursive, type TThis } from './type/recursive/index' -export { Ref, type TRef } from './type/ref/index' -export { RegExp, type TRegExp } from './type/regexp/index' -export { Required, type TRequired } from './type/required/index' -export { Rest, type TRest } from './type/rest/index' -export { ReturnType, type TReturnType } from './type/return-type/index' -export { type TSchema, type TKind, type SchemaOptions, type TAnySchema } from './type/schema/index' -export { type Static, type StaticDecode, type StaticEncode } from './type/static/index' -export { Strict } from './type/strict/index' -export { String, type TString, type StringOptions, type StringFormatOption, type StringContentEncodingOption } from './type/string/index' -export { Symbol, type TSymbol, type SymbolValue } from './type/symbol/index' -export { TemplateLiteral, IsTemplateLiteralFinite, TemplateLiteralParse, TemplateLiteralGenerate, type TTemplateLiteral, type TTemplateLiteralKind } from './type/template-literal/index' -export { Transform, type TTransform, type TransformOptions, type TransformFunction, TransformDecodeBuilder, TransformEncodeBuilder } from './type/transform/index' -export { Tuple, type TTuple } from './type/tuple/index' -export { Uint8Array, type TUint8Array, type Uint8ArrayOptions } from './type/uint8array/index' -export { Undefined, type TUndefined } from './type/undefined/index' -export { Union, type TUnion } from './type/union/index' -export { Unknown, type TUnknown } from './type/unknown/index' -export { Unsafe, type TUnsafe } from './type/unsafe/index' -export { Void, type TVoid } from './type/void/index' +export { Any, type TAny } from './type/any/index.mjs' +export { Array, type TArray, type ArrayOptions } from './type/array/index.mjs' +export { AsyncIterator, type TAsyncIterator } from './type/async-iterator/index.mjs' +export { Awaited, type TAwaited } from './type/awaited/index.mjs' +export { BigInt, type TBigInt, BigIntOptions } from './type/bigint/index.mjs' +export { Boolean, type TBoolean } from './type/boolean/index.mjs' +export { Composite, type TComposite } from './type/composite/index.mjs' +export { Const, type TConst } from './type/const/index.mjs' +export { Constructor, type TConstructor } from './type/constructor/index.mjs' +export { ConstructorParameters, type TConstructorParameters } from './type/constructor-parameters/index.mjs' +export { Date, type TDate, type DateOptions } from './type/date/index.mjs' +export { Deref, type TDeref } from './type/deref/index.mjs' +export { Enum, type TEnum } from './type/enum/index.mjs' +export { Exclude, type TExclude } from './type/exclude/index.mjs' +export { Extends, type TExtends, ExtendsCheck, ExtendsResult, ExtendsUndefinedCheck } from './type/extends/index.mjs' +export { Extract, type TExtract } from './type/extract/index.mjs' +export { Function, type TFunction } from './type/function/index.mjs' +export { Increment, type Assert, type AssertType, type AssertRest, type AssertProperties, type Ensure, type Evaluate, type TupleToIntersect, type TupleToUnion, type UnionToTuple } from './type/helpers/index.mjs' +export { Index, type TIndex, IndexedKeyResolve, IndexedTypeResolve } from './type/indexed/index.mjs' +export { InstanceType, type TInstanceType } from './type/instance-type/index.mjs' +export { Integer, type TInteger, type IntegerOptions } from './type/integer/index.mjs' +export { Intersect, type TIntersect, type IntersectOptions } from './type/intersect/index.mjs' +export { Iterator, type TIterator } from './type/iterator/index.mjs' +export { Capitalize, type TCapitalize, Lowercase, type TLowercase, Uncapitalize, type TUncapitalize, Uppercase, type TUppercase, IntrinsicResolve } from './type/intrinsic/index.mjs' +export { KeyOf, type TKeyOf, KeyOfStringResolve, KeyOfStringResolvePattern, KeyOfTypeResolve } from './type/keyof/index.mjs' +export { Literal, type TLiteral } from './type/literal/index.mjs' +export { Mapped, type TMappedKey, type MappedFunction, type TMappedResult } from './type/mapped/index.mjs' +export { Never, type TNever } from './type/never/index.mjs' +export { Not, type TNot } from './type/not/index.mjs' +export { Null, type TNull } from './type/null/index.mjs' +export { Number, type TNumber, type NumberOptions } from './type/number/index.mjs' +export { Object, type TObject, type TProperties, type ObjectOptions } from './type/object/index.mjs' +export { Omit, type TOmit } from './type/omit/index.mjs' +export { Optional, type TOptional } from './type/optional/index.mjs' +export { Parameters, type TParameters } from './type/parameters/index.mjs' +export { Partial, type TPartial } from './type/partial/index.mjs' +export { Pick, type TPick } from './type/pick/index.mjs' +export { Promise, type TPromise } from './type/promise/index.mjs' +export { Readonly, type TReadonly } from './type/readonly/index.mjs' +export { ReadonlyOptional, type TReadonlyOptional } from './type/readonly-optional/index.mjs' +export { Record, type TRecord } from './type/record/index.mjs' +export { Recursive, type TRecursive, type TThis } from './type/recursive/index.mjs' +export { Ref, type TRef } from './type/ref/index.mjs' +export { RegExp, type TRegExp } from './type/regexp/index.mjs' +export { Required, type TRequired } from './type/required/index.mjs' +export { Rest, type TRest } from './type/rest/index.mjs' +export { ReturnType, type TReturnType } from './type/return-type/index.mjs' +export { type TSchema, type TKind, type SchemaOptions, type TAnySchema } from './type/schema/index.mjs' +export { type Static, type StaticDecode, type StaticEncode } from './type/static/index.mjs' +export { Strict } from './type/strict/index.mjs' +export { String, type TString, type StringOptions, type StringFormatOption, type StringContentEncodingOption } from './type/string/index.mjs' +export { Symbol, type TSymbol, type SymbolValue } from './type/symbol/index.mjs' +export { TemplateLiteral, IsTemplateLiteralFinite, TemplateLiteralParse, TemplateLiteralGenerate, type TTemplateLiteral, type TTemplateLiteralKind } from './type/template-literal/index.mjs' +export { Transform, type TTransform, type TransformOptions, type TransformFunction, TransformDecodeBuilder, TransformEncodeBuilder } from './type/transform/index.mjs' +export { Tuple, type TTuple } from './type/tuple/index.mjs' +export { Uint8Array, type TUint8Array, type Uint8ArrayOptions } from './type/uint8array/index.mjs' +export { Undefined, type TUndefined } from './type/undefined/index.mjs' +export { Union, type TUnion } from './type/union/index.mjs' +export { Unknown, type TUnknown } from './type/unknown/index.mjs' +export { Unsafe, type TUnsafe } from './type/unsafe/index.mjs' +export { Void, type TVoid } from './type/void/index.mjs' // ------------------------------------------------------------------ // Namespace // ------------------------------------------------------------------ -export { JsonTypeBuilder, JavaScriptTypeBuilder } from './type/type/index' -import { Type } from './type/type/index' +export { JsonTypeBuilder, JavaScriptTypeBuilder } from './type/type/index.mjs' +import { Type } from './type/type/index.mjs' export { Type } export default Type diff --git a/src/system/errors.ts b/src/system/errors.mts similarity index 98% rename from src/system/errors.ts rename to src/system/errors.mts index ab8439906..71b920bc3 100644 --- a/src/system/errors.ts +++ b/src/system/errors.mts @@ -26,9 +26,9 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { ValueErrorType } from '../errors/errors' -import { TSchema } from '../type/schema/index' -import { Kind } from '../type/symbols/index' +import { ValueErrorType } from '../errors/errors.mjs' +import { TSchema } from '../type/schema/index.mjs' +import { Kind } from '../type/symbols/index.mjs' // ------------------------------------------------------------------ // ErrorFunction diff --git a/src/system/index.ts b/src/system/index.mts similarity index 89% rename from src/system/index.ts rename to src/system/index.mts index ead7f9713..ce955392f 100644 --- a/src/system/index.ts +++ b/src/system/index.mts @@ -26,7 +26,7 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -export { ValueErrorType } from '../errors/errors' -export { DefaultErrorFunction, ErrorFunction, TypeSystemErrorFunction } from './errors' -export { TypeSystemPolicy } from './policy' -export { TypeSystem, TypeSystemDuplicateFormat, TypeSystemDuplicateTypeKind } from './system' +export { ValueErrorType } from '../errors/errors.mjs' +export { DefaultErrorFunction, ErrorFunction, TypeSystemErrorFunction } from './errors.mjs' +export { TypeSystemPolicy } from './policy.mjs' +export { TypeSystem, TypeSystemDuplicateFormat, TypeSystemDuplicateTypeKind } from './system.mjs' diff --git a/src/system/policy.ts b/src/system/policy.mts similarity index 99% rename from src/system/policy.ts rename to src/system/policy.mts index ffb7ba772..8f1fc1952 100644 --- a/src/system/policy.ts +++ b/src/system/policy.mts @@ -26,7 +26,7 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { IsObject, IsArray, IsNumber, IsUndefined } from '../value/guard/index' +import { IsObject, IsArray, IsNumber, IsUndefined } from '../value/guard/index.mjs' // ------------------------------------------------------------------ // TypeSystemPolicy diff --git a/src/system/system.ts b/src/system/system.mts similarity index 96% rename from src/system/system.ts rename to src/system/system.mts index 91acedeec..99ab263a2 100644 --- a/src/system/system.ts +++ b/src/system/system.mts @@ -26,9 +26,9 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { TypeRegistry, FormatRegistry } from '../type/registry/index' -import { Unsafe } from '../type/unsafe/index' -import { Kind } from '../type/symbols/index' +import { TypeRegistry, FormatRegistry } from '../type/registry/index.mjs' +import { Unsafe } from '../type/unsafe/index.mjs' +import { Kind } from '../type/symbols/index.mjs' // ------------------------------------------------------------------ // Errors diff --git a/src/tsconfig.json b/src/tsconfig.json index e53e3ebf1..54d7c650c 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "../tsconfig.json", - "files": ["compiler/index.ts", "errors/index.ts", "system/index.ts", "type/index.ts", "value/index.ts", "index.ts"] + "files": ["compiler/index.mts", "errors/index.mts", "system/index.mts", "type/index.mts", "value/index.mts", "index.mts"] } diff --git a/src/type/any/any.ts b/src/type/any/any.mts similarity index 93% rename from src/type/any/any.ts rename to src/type/any/any.mts index c5b166f80..62bf97e12 100644 --- a/src/type/any/any.ts +++ b/src/type/any/any.mts @@ -26,8 +26,8 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import { Kind } from '../symbols/index' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import { Kind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // TAny diff --git a/src/type/array/index.ts b/src/type/any/index.mts similarity index 98% rename from src/type/array/index.ts rename to src/type/any/index.mts index ae02b63c0..dd15bae27 100644 --- a/src/type/array/index.ts +++ b/src/type/any/index.mts @@ -26,4 +26,4 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -export * from './array' +export * from './any.mjs' diff --git a/src/type/array/array.ts b/src/type/array/array.mts similarity index 92% rename from src/type/array/array.ts rename to src/type/array/array.mts index 02c0f0375..e415e599c 100644 --- a/src/type/array/array.ts +++ b/src/type/array/array.mts @@ -26,10 +26,10 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import type { Static } from '../static/index' -import { Kind } from '../symbols/index' -import { CloneType } from '../clone/type' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { Static } from '../static/index.mjs' +import { Kind } from '../symbols/index.mjs' +import { CloneType } from '../clone/type.mjs' // ------------------------------------------------------------------ // TArray diff --git a/src/type/array/index.mts b/src/type/array/index.mts new file mode 100644 index 000000000..9793be9cf --- /dev/null +++ b/src/type/array/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './array.mjs' diff --git a/src/type/async-iterator/async-iterator.ts b/src/type/async-iterator/async-iterator.mts similarity index 90% rename from src/type/async-iterator/async-iterator.ts rename to src/type/async-iterator/async-iterator.mts index 476057f13..85872ae6b 100644 --- a/src/type/async-iterator/async-iterator.ts +++ b/src/type/async-iterator/async-iterator.mts @@ -26,10 +26,10 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import type { Static } from '../static/index' -import { Kind } from '../symbols/index' -import { CloneType } from '../clone/type' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { Static } from '../static/index.mjs' +import { Kind } from '../symbols/index.mjs' +import { CloneType } from '../clone/type.mjs' // ------------------------------------------------------------------ // TAsyncIterator diff --git a/src/type/async-iterator/index.mts b/src/type/async-iterator/index.mts new file mode 100644 index 000000000..6b4529c5f --- /dev/null +++ b/src/type/async-iterator/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './async-iterator.mjs' diff --git a/src/type/awaited/awaited.ts b/src/type/awaited/awaited.mts similarity index 92% rename from src/type/awaited/awaited.ts rename to src/type/awaited/awaited.mts index 16a55c972..9d5edd6d5 100644 --- a/src/type/awaited/awaited.ts +++ b/src/type/awaited/awaited.mts @@ -26,12 +26,12 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import { type TIntersect, Intersect } from '../intersect/index' -import { type TUnion, Union } from '../union/index' -import { type TPromise } from '../promise/index' -import { CloneType } from '../clone/type' -import { TIntersect as IsIntersectType, TUnion as IsUnionType, TPromise as IsPromiseType } from '../guard/type' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import { type TIntersect, Intersect } from '../intersect/index.mjs' +import { type TUnion, Union } from '../union/index.mjs' +import { type TPromise } from '../promise/index.mjs' +import { CloneType } from '../clone/type.mjs' +import { TIntersect as IsIntersectType, TUnion as IsUnionType, TPromise as IsPromiseType } from '../guard/type.mjs' // ------------------------------------------------------------------ // AwaitedResolve diff --git a/src/type/awaited/index.mts b/src/type/awaited/index.mts new file mode 100644 index 000000000..f141f9c58 --- /dev/null +++ b/src/type/awaited/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './awaited.mjs' diff --git a/src/type/bigint/bigint.ts b/src/type/bigint/bigint.mts similarity index 94% rename from src/type/bigint/bigint.ts rename to src/type/bigint/bigint.mts index 976397d85..2410bc667 100644 --- a/src/type/bigint/bigint.ts +++ b/src/type/bigint/bigint.mts @@ -26,8 +26,8 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import { Kind } from '../symbols/index' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import { Kind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // TBigInt diff --git a/src/type/bigint/index.mts b/src/type/bigint/index.mts new file mode 100644 index 000000000..28d04edf2 --- /dev/null +++ b/src/type/bigint/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './bigint.mjs' diff --git a/src/type/boolean/boolean.ts b/src/type/boolean/boolean.mts similarity index 94% rename from src/type/boolean/boolean.ts rename to src/type/boolean/boolean.mts index 5516a07f2..cb02a1cfd 100644 --- a/src/type/boolean/boolean.ts +++ b/src/type/boolean/boolean.mts @@ -26,8 +26,8 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import { Kind } from '../symbols/index' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import { Kind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // TBoolean diff --git a/src/type/boolean/index.mts b/src/type/boolean/index.mts new file mode 100644 index 000000000..ddcbfb175 --- /dev/null +++ b/src/type/boolean/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './boolean.mjs' diff --git a/src/type/boolean/index.ts b/src/type/boolean/index.ts deleted file mode 100644 index aad153cb3..000000000 --- a/src/type/boolean/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './boolean' diff --git a/src/type/clone/index.mts b/src/type/clone/index.mts new file mode 100644 index 000000000..6ebd5d33c --- /dev/null +++ b/src/type/clone/index.mts @@ -0,0 +1,30 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * as TypeClone from './type.mjs' +export * as ValueClone from './value.mjs' diff --git a/src/type/clone/index.ts b/src/type/clone/index.ts deleted file mode 100644 index 44bd8cb28..000000000 --- a/src/type/clone/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * as TypeClone from './type' -export * as ValueClone from './value' diff --git a/src/type/clone/type.ts b/src/type/clone/type.mts similarity index 94% rename from src/type/clone/type.ts rename to src/type/clone/type.mts index 08d1c3f43..400153aac 100644 --- a/src/type/clone/type.ts +++ b/src/type/clone/type.mts @@ -26,8 +26,8 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import { Clone } from './value' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import { Clone } from './value.mjs' /** Clones a Rest */ export function CloneRest(schemas: T): T { diff --git a/src/type/clone/value.ts b/src/type/clone/value.mts similarity index 97% rename from src/type/clone/value.ts rename to src/type/clone/value.mts index 0f2ea9450..068f33b57 100644 --- a/src/type/clone/value.ts +++ b/src/type/clone/value.mts @@ -26,7 +26,7 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import * as ValueGuard from '../guard/value' +import * as ValueGuard from '../guard/value.mjs' function ArrayType(value: unknown[]) { return (value as any).map((value: unknown) => Visit(value as any)) diff --git a/src/type/composite/composite.ts b/src/type/composite/composite.mts similarity index 90% rename from src/type/composite/composite.ts rename to src/type/composite/composite.mts index 545464973..a607e2727 100644 --- a/src/type/composite/composite.ts +++ b/src/type/composite/composite.mts @@ -26,13 +26,13 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema } from '../schema/index' -import type { UnionToTuple, Assert, Evaluate } from '../helpers/index' -import { type TObject, type TProperties, type ObjectOptions, Object } from '../object/index' -import { type TIntersect, Intersect } from '../intersect/index' -import { KeyOfStringResolve } from '../keyof/index' -import { IndexedTypeResolve, Index } from '../indexed/index' -import { CloneType } from '../clone/type' +import type { TSchema } from '../schema/index.mjs' +import type { UnionToTuple, Assert, Evaluate } from '../helpers/index.mjs' +import { type TObject, type TProperties, type ObjectOptions, Object } from '../object/index.mjs' +import { type TIntersect, Intersect } from '../intersect/index.mjs' +import { KeyOfStringResolve } from '../keyof/index.mjs' +import { IndexedTypeResolve, Index } from '../indexed/index.mjs' +import { CloneType } from '../clone/type.mjs' // ------------------------------------------------------------------ // CompositeResolve diff --git a/src/type/composite/index.mts b/src/type/composite/index.mts new file mode 100644 index 000000000..186d54f17 --- /dev/null +++ b/src/type/composite/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './composite.mjs' diff --git a/src/type/composite/index.ts b/src/type/composite/index.ts deleted file mode 100644 index 2fe294b71..000000000 --- a/src/type/composite/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './composite' diff --git a/src/type/const/const.ts b/src/type/const/const.mts similarity index 84% rename from src/type/const/const.ts rename to src/type/const/const.mts index 7d42fe875..492ebf4cd 100644 --- a/src/type/const/const.ts +++ b/src/type/const/const.mts @@ -26,25 +26,25 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { AssertRest, Evaluate } from '../helpers/index' -import type { TSchema, SchemaOptions } from '../schema/index' -import type { TProperties } from '../object/index' -import { IsArray, IsNumber, IsBigInt, IsUint8Array, IsDate, IsIterator, IsObject, IsAsyncIterator, IsFunction, IsUndefined, IsNull, IsSymbol, IsBoolean, IsString } from '../guard/value' -import { Any, type TAny } from '../any' -import { BigInt, type TBigInt } from '../bigint/index' -import { Date, type TDate } from '../date/index' -import { Function, type TFunction } from '../function/index' -import { Literal, type TLiteral } from '../literal/index' -import { type TNever } from '../never/index' -import { Null, type TNull } from '../null/index' -import { Object, type TObject } from '../object/index' -import { Symbol, type TSymbol } from '../symbol/index' -import { Tuple, type TTuple } from '../tuple/index' -import { Readonly, type TReadonly } from '../readonly/index' -import { Undefined, type TUndefined } from '../undefined/index' -import { Uint8Array, type TUint8Array } from '../uint8array/index' -import { Unknown, type TUnknown } from '../unknown/index' -import { TypeClone } from '../clone/index' +import type { AssertRest, Evaluate } from '../helpers/index.mjs' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { TProperties } from '../object/index.mjs' +import { IsArray, IsNumber, IsBigInt, IsUint8Array, IsDate, IsIterator, IsObject, IsAsyncIterator, IsFunction, IsUndefined, IsNull, IsSymbol, IsBoolean, IsString } from '../guard/value.mjs' +import { Any, type TAny } from '../any/index.mjs' +import { BigInt, type TBigInt } from '../bigint/index.mjs' +import { Date, type TDate } from '../date/index.mjs' +import { Function, type TFunction } from '../function/index.mjs' +import { Literal, type TLiteral } from '../literal/index.mjs' +import { type TNever } from '../never/index.mjs' +import { Null, type TNull } from '../null/index.mjs' +import { Object, type TObject } from '../object/index.mjs' +import { Symbol, type TSymbol } from '../symbol/index.mjs' +import { Tuple, type TTuple } from '../tuple/index.mjs' +import { Readonly, type TReadonly } from '../readonly/index.mjs' +import { Undefined, type TUndefined } from '../undefined/index.mjs' +import { Uint8Array, type TUint8Array } from '../uint8array/index.mjs' +import { Unknown, type TUnknown } from '../unknown/index.mjs' +import { TypeClone } from '../clone/index.mjs' // ------------------------------------------------------------------ // FromArray diff --git a/src/type/const/index.mts b/src/type/const/index.mts new file mode 100644 index 000000000..1de953cef --- /dev/null +++ b/src/type/const/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './const.mjs' diff --git a/src/type/const/index.ts b/src/type/const/index.ts deleted file mode 100644 index f13d0f549..000000000 --- a/src/type/const/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './const' diff --git a/src/type/constructor-parameters/constructor-parameters.ts b/src/type/constructor-parameters/constructor-parameters.mts similarity index 87% rename from src/type/constructor-parameters/constructor-parameters.ts rename to src/type/constructor-parameters/constructor-parameters.mts index 1ff7c55cb..0f41ea2f0 100644 --- a/src/type/constructor-parameters/constructor-parameters.ts +++ b/src/type/constructor-parameters/constructor-parameters.mts @@ -26,11 +26,11 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import type { Ensure } from '../helpers/index' -import type { TConstructor } from '../constructor/index' -import { type TTuple, Tuple } from '../tuple/index' -import { CloneRest } from '../clone/type' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { Ensure } from '../helpers/index.mjs' +import type { TConstructor } from '../constructor/index.mjs' +import { type TTuple, Tuple } from '../tuple/index.mjs' +import { CloneRest } from '../clone/type.mjs' // ------------------------------------------------------------------ // ConstructorParameters diff --git a/src/type/constructor-parameters/index.mts b/src/type/constructor-parameters/index.mts new file mode 100644 index 000000000..59dff6367 --- /dev/null +++ b/src/type/constructor-parameters/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './constructor-parameters.mjs' diff --git a/src/type/constructor-parameters/index.ts b/src/type/constructor-parameters/index.ts deleted file mode 100644 index 23f9c265b..000000000 --- a/src/type/constructor-parameters/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './constructor-parameters' diff --git a/src/type/constructor/constructor.ts b/src/type/constructor/constructor.mts similarity index 91% rename from src/type/constructor/constructor.ts rename to src/type/constructor/constructor.mts index 3764e5558..df06a5281 100644 --- a/src/type/constructor/constructor.ts +++ b/src/type/constructor/constructor.mts @@ -26,11 +26,11 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import type { Static } from '../static/index' -import type { Ensure } from '../helpers/index' -import { Kind } from '../symbols/index' -import { CloneType, CloneRest } from '../clone/type' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { Static } from '../static/index.mjs' +import type { Ensure } from '../helpers/index.mjs' +import { Kind } from '../symbols/index.mjs' +import { CloneType, CloneRest } from '../clone/type.mjs' // ------------------------------------------------------------------ // TConstructorResolve diff --git a/src/type/constructor/index.mts b/src/type/constructor/index.mts new file mode 100644 index 000000000..63a1126db --- /dev/null +++ b/src/type/constructor/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './constructor.mjs' diff --git a/src/type/constructor/index.ts b/src/type/constructor/index.ts deleted file mode 100644 index 8e75965f7..000000000 --- a/src/type/constructor/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './constructor' diff --git a/src/type/date/date.ts b/src/type/date/date.mts similarity index 95% rename from src/type/date/date.ts rename to src/type/date/date.mts index a4bf5fa5a..123c96e1e 100644 --- a/src/type/date/date.ts +++ b/src/type/date/date.mts @@ -26,8 +26,8 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import { Kind } from '../symbols/index' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import { Kind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // TDate diff --git a/src/type/awaited/index.ts b/src/type/date/index.mts similarity index 97% rename from src/type/awaited/index.ts rename to src/type/date/index.mts index 26a23a571..fcc2292ac 100644 --- a/src/type/awaited/index.ts +++ b/src/type/date/index.mts @@ -26,4 +26,4 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -export * from './awaited' +export * from './date.mjs' diff --git a/src/type/date/index.ts b/src/type/date/index.ts deleted file mode 100644 index 932ee5def..000000000 --- a/src/type/date/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './date' diff --git a/src/type/deref/deref.ts b/src/type/deref/deref.mts similarity index 88% rename from src/type/deref/deref.ts rename to src/type/deref/deref.mts index 519725af2..325a09f23 100644 --- a/src/type/deref/deref.ts +++ b/src/type/deref/deref.mts @@ -26,22 +26,22 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema } from '../schema/index' -import type { Evaluate } from '../helpers/index' -import type { TTuple } from '../tuple/index' -import type { TIntersect } from '../intersect/index' -import type { TUnion } from '../union/index' -import type { TPromise } from '../promise/index' -import type { TAsyncIterator } from '../async-iterator/index' -import type { TIterator } from '../iterator/index' -import type { TArray } from '../array/index' -import type { TConstructor } from '../constructor/index' -import type { TFunction } from '../function/index' -import type { TRef } from '../ref/index' -import type { TObject, TProperties } from '../object/index' -import { CloneType } from '../clone/type' -import { Discard } from '../discard/index' -import { IsUndefined } from '../guard/value' +import type { TSchema } from '../schema/index.mjs' +import type { Evaluate } from '../helpers/index.mjs' +import type { TTuple } from '../tuple/index.mjs' +import type { TIntersect } from '../intersect/index.mjs' +import type { TUnion } from '../union/index.mjs' +import type { TPromise } from '../promise/index.mjs' +import type { TAsyncIterator } from '../async-iterator/index.mjs' +import type { TIterator } from '../iterator/index.mjs' +import type { TArray } from '../array/index.mjs' +import type { TConstructor } from '../constructor/index.mjs' +import type { TFunction } from '../function/index.mjs' +import type { TRef } from '../ref/index.mjs' +import type { TObject, TProperties } from '../object/index.mjs' +import { CloneType } from '../clone/type.mjs' +import { Discard } from '../discard/index.mjs' +import { IsUndefined } from '../guard/value.mjs' import { TConstructor as IsConstructorType, @@ -55,7 +55,7 @@ import { TAsyncIterator as IsAsyncIteratorType, TIterator as IsIteratorType, TRef as IsRefType, -} from '../guard/type' +} from '../guard/type.mjs' // ------------------------------------------------------------------ // DerefResolve diff --git a/src/type/deref/index.mts b/src/type/deref/index.mts new file mode 100644 index 000000000..c8a91241c --- /dev/null +++ b/src/type/deref/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './deref.mjs' diff --git a/src/type/deref/index.ts b/src/type/deref/index.ts deleted file mode 100644 index 496b4d6f0..000000000 --- a/src/type/deref/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './deref' diff --git a/src/type/discard/discard.ts b/src/type/discard/discard.mts similarity index 100% rename from src/type/discard/discard.ts rename to src/type/discard/discard.mts diff --git a/src/type/discard/index.mts b/src/type/discard/index.mts new file mode 100644 index 000000000..6febdc38f --- /dev/null +++ b/src/type/discard/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './discard.mjs' diff --git a/src/type/discard/index.ts b/src/type/discard/index.ts deleted file mode 100644 index 43fb9af56..000000000 --- a/src/type/discard/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './discard' diff --git a/src/type/distinct/distinct.ts b/src/type/distinct/distinct.mts similarity index 95% rename from src/type/distinct/distinct.ts rename to src/type/distinct/distinct.mts index 079dcab9e..6a56d0189 100644 --- a/src/type/distinct/distinct.ts +++ b/src/type/distinct/distinct.mts @@ -26,8 +26,8 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { ExtendsCheck, ExtendsResult } from '../extends/index' -import { TSchema } from '../schema/index' +import { ExtendsCheck, ExtendsResult } from '../extends/index.mjs' +import { TSchema } from '../schema/index.mjs' // ------------------------------------------------------------------ // Includes diff --git a/src/type/distinct/index.mts b/src/type/distinct/index.mts new file mode 100644 index 000000000..525fc11ad --- /dev/null +++ b/src/type/distinct/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './distinct.mjs' diff --git a/src/type/distinct/index.ts b/src/type/distinct/index.ts deleted file mode 100644 index 2fcd7f1f3..000000000 --- a/src/type/distinct/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './distinct' diff --git a/src/type/enum/enum.ts b/src/type/enum/enum.mts similarity index 89% rename from src/type/enum/enum.ts rename to src/type/enum/enum.mts index 9740f9aaa..4993f4204 100644 --- a/src/type/enum/enum.ts +++ b/src/type/enum/enum.mts @@ -26,11 +26,11 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import { type TLiteral, Literal } from '../literal/index' -import { Kind, Hint } from '../symbols/index' -import { Union } from '../union/index' -import { IsUndefined } from '../guard/value' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import { type TLiteral, Literal } from '../literal/index.mjs' +import { Kind, Hint } from '../symbols/index.mjs' +import { Union } from '../union/index.mjs' +import { IsUndefined } from '../guard/value.mjs' // ------------------------------------------------------------------ // TEnum diff --git a/src/type/enum/index.mts b/src/type/enum/index.mts new file mode 100644 index 000000000..64ced75e8 --- /dev/null +++ b/src/type/enum/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './enum.mjs' diff --git a/src/type/enum/index.ts b/src/type/enum/index.ts deleted file mode 100644 index d5dfd4a6f..000000000 --- a/src/type/enum/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './enum' diff --git a/src/type/exclude/exclude.ts b/src/type/exclude/exclude.mts similarity index 87% rename from src/type/exclude/exclude.ts rename to src/type/exclude/exclude.mts index 9dda8a71f..61611809c 100644 --- a/src/type/exclude/exclude.ts +++ b/src/type/exclude/exclude.mts @@ -26,17 +26,17 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import type { UnionToTuple, AssertRest, AssertType, Assert } from '../helpers/index' -import { type TTemplateLiteral, TemplateLiteralToUnion } from '../template-literal/index' -import { type TUnion, Union } from '../union/index' -import { type TNever, Never } from '../never/index' -import { type TLiteral } from '../literal/index' -import { type Static } from '../static/index' -import { ExtendsCheck, ExtendsResult } from '../extends/index' -import { UnionResolve } from '../union/index' -import { CloneType } from '../clone/type' -import { TTemplateLiteral as IsTemplateLiteralType, TUnion as IsUnionType } from '../guard/type' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { UnionToTuple, AssertRest, AssertType, Assert } from '../helpers/index.mjs' +import { type TTemplateLiteral, TemplateLiteralToUnion } from '../template-literal/index.mjs' +import { type TUnion, Union } from '../union/index.mjs' +import { type TNever, Never } from '../never/index.mjs' +import { type TLiteral } from '../literal/index.mjs' +import { type Static } from '../static/index.mjs' +import { ExtendsCheck, ExtendsResult } from '../extends/index.mjs' +import { UnionResolve } from '../union/index.mjs' +import { CloneType } from '../clone/type.mjs' +import { TTemplateLiteral as IsTemplateLiteralType, TUnion as IsUnionType } from '../guard/type.mjs' // ------------------------------------------------------------------ // ExcludeResolve diff --git a/src/type/exclude/index.mts b/src/type/exclude/index.mts new file mode 100644 index 000000000..32d3997f6 --- /dev/null +++ b/src/type/exclude/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './exclude.mjs' diff --git a/src/type/exclude/index.ts b/src/type/exclude/index.ts deleted file mode 100644 index 4ed911329..000000000 --- a/src/type/exclude/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './exclude' diff --git a/src/type/extends/extends-check.ts b/src/type/extends/extends-check.mts similarity index 94% rename from src/type/extends/extends-check.ts rename to src/type/extends/extends-check.mts index 13fdfd736..68189abd8 100644 --- a/src/type/extends/extends-check.ts +++ b/src/type/extends/extends-check.mts @@ -26,39 +26,39 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { type TAny, Any } from '../any/index' -import { type TArray } from '../array/index' -import { type TAsyncIterator } from '../async-iterator/index' -import { type TBigInt } from '../bigint/index' -import { type TBoolean } from '../boolean/index' -import { type TConstructor } from '../constructor/index' -import { type TDate } from '../date/index' -import { type TFunction, Function } from '../function/index' -import { type TInteger } from '../integer/index' -import { type TIntersect } from '../intersect/index' -import { type TIterator } from '../iterator/index' -import { type TLiteral } from '../literal/index' -import { type TNever } from '../never/index' -import { type TNot } from '../not/index' -import { type TNull } from '../null/index' -import { type TNumber, Number } from '../number/index' -import { type TObject } from '../object/index' -import { type TPromise } from '../promise/index' -import { type TRecord } from '../record/index' -import { type TSchema } from '../schema/index' -import { type TString, String } from '../string/index' -import { type TSymbol } from '../symbol/index' -import { type TTuple } from '../tuple/index' -import { type TUint8Array } from '../uint8array/index' -import { type TUndefined } from '../undefined/index' -import { type TUnion } from '../union/index' -import { type TUnknown, Unknown } from '../unknown/index' -import { type TVoid } from '../void/index' +import { type TAny, Any } from '../any/index.mjs' +import { type TArray } from '../array/index.mjs' +import { type TAsyncIterator } from '../async-iterator/index.mjs' +import { type TBigInt } from '../bigint/index.mjs' +import { type TBoolean } from '../boolean/index.mjs' +import { type TConstructor } from '../constructor/index.mjs' +import { type TDate } from '../date/index.mjs' +import { type TFunction, Function } from '../function/index.mjs' +import { type TInteger } from '../integer/index.mjs' +import { type TIntersect } from '../intersect/index.mjs' +import { type TIterator } from '../iterator/index.mjs' +import { type TLiteral } from '../literal/index.mjs' +import { type TNever } from '../never/index.mjs' +import { type TNot } from '../not/index.mjs' +import { type TNull } from '../null/index.mjs' +import { type TNumber, Number } from '../number/index.mjs' +import { type TObject } from '../object/index.mjs' +import { type TPromise } from '../promise/index.mjs' +import { type TRecord } from '../record/index.mjs' +import { type TSchema } from '../schema/index.mjs' +import { type TString, String } from '../string/index.mjs' +import { type TSymbol } from '../symbol/index.mjs' +import { type TTuple } from '../tuple/index.mjs' +import { type TUint8Array } from '../uint8array/index.mjs' +import { type TUndefined } from '../undefined/index.mjs' +import { type TUnion } from '../union/index.mjs' +import { type TUnknown, Unknown } from '../unknown/index.mjs' +import { type TVoid } from '../void/index.mjs' -import { TemplateLiteralToUnion } from '../template-literal/index' -import { PatternNumberExact, PatternStringExact } from '../patterns/index' -import { Kind, Hint } from '../symbols/index' -import { TypeGuard, ValueGuard } from '../guard/index' +import { TemplateLiteralToUnion } from '../template-literal/index.mjs' +import { PatternNumberExact, PatternStringExact } from '../patterns/index.mjs' +import { Kind, Hint } from '../symbols/index.mjs' +import { TypeGuard, ValueGuard } from '../guard/index.mjs' export class ExtendsResolverError extends Error {} diff --git a/src/type/extends/extends-undefined.ts b/src/type/extends/extends-undefined.mts similarity index 89% rename from src/type/extends/extends-undefined.ts rename to src/type/extends/extends-undefined.mts index f6c275c6a..72d523fbf 100644 --- a/src/type/extends/extends-undefined.ts +++ b/src/type/extends/extends-undefined.mts @@ -26,11 +26,11 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema } from '../schema/index' -import type { TIntersect } from '../intersect/index' -import type { TUnion } from '../union/index' -import type { TNot } from '../not/index' -import { Kind } from '../symbols/index' +import type { TSchema } from '../schema/index.mjs' +import type { TIntersect } from '../intersect/index.mjs' +import type { TUnion } from '../union/index.mjs' +import type { TNot } from '../not/index.mjs' +import { Kind } from '../symbols/index.mjs' /** Fast undefined check used for properties of type undefined */ function Intersect(schema: TIntersect) { diff --git a/src/type/extends/extends.ts b/src/type/extends/extends.mts similarity index 88% rename from src/type/extends/extends.ts rename to src/type/extends/extends.mts index 86e11c0ee..2a7c0d338 100644 --- a/src/type/extends/extends.ts +++ b/src/type/extends/extends.mts @@ -26,12 +26,12 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import type { Static } from '../static/index' -import { type TUnion, Union } from '../union/index' -import { ExtendsCheck, ExtendsResult } from './extends-check' -import { UnionToTuple } from '../helpers/index' -import { CloneType } from '../clone/type' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { Static } from '../static/index.mjs' +import { type TUnion, Union } from '../union/index.mjs' +import { ExtendsCheck, ExtendsResult } from './extends-check.mjs' +import { UnionToTuple } from '../helpers/index.mjs' +import { CloneType } from '../clone/type.mjs' // prettier-ignore export type ExtendsResolve = ( diff --git a/src/type/extends/index.mts b/src/type/extends/index.mts new file mode 100644 index 000000000..818569547 --- /dev/null +++ b/src/type/extends/index.mts @@ -0,0 +1,31 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './extends-check.mjs' +export * from './extends-undefined.mjs' +export * from './extends.mjs' diff --git a/src/type/extends/index.ts b/src/type/extends/index.ts deleted file mode 100644 index e1d7e7e76..000000000 --- a/src/type/extends/index.ts +++ /dev/null @@ -1,31 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './extends-check' -export * from './extends-undefined' -export * from './extends' diff --git a/src/type/extract/extract.ts b/src/type/extract/extract.mts similarity index 87% rename from src/type/extract/extract.ts rename to src/type/extract/extract.mts index 19d873dfd..ba1cf0760 100644 --- a/src/type/extract/extract.ts +++ b/src/type/extract/extract.mts @@ -26,17 +26,17 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import type { Assert, AssertRest, AssertType, UnionToTuple } from '../helpers/index' -import { type TTemplateLiteral, TemplateLiteralToUnion } from '../template-literal/index' -import { type TLiteral } from '../literal/index' -import { type TUnion, Union } from '../union/index' -import { type Static } from '../static/index' -import { Never } from '../never/index' -import { UnionResolve } from '../union/index' -import { ExtendsCheck, ExtendsResult } from '../extends/index' -import { CloneType } from '../clone/type' -import { TTemplateLiteral as IsTemplateLiteralType, TUnion as IsUnionType } from '../guard/type' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { Assert, AssertRest, AssertType, UnionToTuple } from '../helpers/index.mjs' +import { type TTemplateLiteral, TemplateLiteralToUnion } from '../template-literal/index.mjs' +import { type TLiteral } from '../literal/index.mjs' +import { type TUnion, Union } from '../union/index.mjs' +import { type Static } from '../static/index.mjs' +import { Never } from '../never/index.mjs' +import { UnionResolve } from '../union/index.mjs' +import { ExtendsCheck, ExtendsResult } from '../extends/index.mjs' +import { CloneType } from '../clone/type.mjs' +import { TTemplateLiteral as IsTemplateLiteralType, TUnion as IsUnionType } from '../guard/type.mjs' // ------------------------------------------------------------------ // ExtractResolve diff --git a/src/type/extract/index.mts b/src/type/extract/index.mts new file mode 100644 index 000000000..a9d495129 --- /dev/null +++ b/src/type/extract/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './extract.mjs' diff --git a/src/type/extract/index.ts b/src/type/extract/index.ts deleted file mode 100644 index 7335c0f12..000000000 --- a/src/type/extract/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './extract' diff --git a/src/type/function/function.ts b/src/type/function/function.mts similarity index 91% rename from src/type/function/function.ts rename to src/type/function/function.mts index d03855159..d2edd2ce7 100644 --- a/src/type/function/function.ts +++ b/src/type/function/function.mts @@ -26,11 +26,11 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import type { Static } from '../static/index' -import type { Ensure } from '../helpers/index' -import { CloneType, CloneRest } from '../clone/type' -import { Kind } from '../symbols/index' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { Static } from '../static/index.mjs' +import type { Ensure } from '../helpers/index.mjs' +import { CloneType, CloneRest } from '../clone/type.mjs' +import { Kind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // FunctionResolve diff --git a/src/type/function/index.mts b/src/type/function/index.mts new file mode 100644 index 000000000..d63d29559 --- /dev/null +++ b/src/type/function/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './function.mjs' diff --git a/src/type/function/index.ts b/src/type/function/index.ts deleted file mode 100644 index 3399c7270..000000000 --- a/src/type/function/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './function' diff --git a/src/type/guard/index.mts b/src/type/guard/index.mts new file mode 100644 index 000000000..21c31da9f --- /dev/null +++ b/src/type/guard/index.mts @@ -0,0 +1,30 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * as TypeGuard from './type.mjs' +export * as ValueGuard from './value.mjs' diff --git a/src/type/guard/index.ts b/src/type/guard/index.ts deleted file mode 100644 index 2e7cc05ad..000000000 --- a/src/type/guard/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * as TypeGuard from './type' -export * as ValueGuard from './value' diff --git a/src/type/guard/type.ts b/src/type/guard/type.mts similarity index 90% rename from src/type/guard/type.ts rename to src/type/guard/type.mts index 388d66230..08261dc5d 100644 --- a/src/type/guard/type.ts +++ b/src/type/guard/type.mts @@ -26,44 +26,44 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import * as ValueGuard from './value' -import { Kind, Hint, TransformKind, ReadonlyKind, OptionalKind } from '../symbols/index' +import * as ValueGuard from './value.mjs' +import { Kind, Hint, TransformKind, ReadonlyKind, OptionalKind } from '../symbols/index.mjs' -import type { TransformOptions } from '../transform/index' -import type { TTemplateLiteral, TTemplateLiteralKind } from '../template-literal/index' -import type { TArray } from '../array/index' -import type { TBoolean } from '../boolean/index' -import type { TRecord } from '../record/index' -import type { TString } from '../string/index' -import type { TUnion } from '../union/index' -import type { TAny } from '../any/index' -import type { TAsyncIterator } from '../async-iterator/index' -import type { TBigInt } from '../bigint/index' -import type { TConstructor } from '../constructor/index' -import type { TFunction } from '../function/index' -import type { TInteger } from '../integer/index' -import type { TIntersect } from '../intersect/index' -import type { TIterator } from '../iterator/index' -import type { TLiteral } from '../literal/index' -import type { TNever } from '../never/index' -import type { TNot } from '../not/index' -import type { TNull } from '../null/index' -import type { TNumber } from '../number/index' -import type { TObject, TAdditionalProperties } from '../object/index' -import type { TOptional } from '../optional/index' -import type { TPromise } from '../promise/index' -import type { TReadonly } from '../readonly/index' -import type { TRef } from '../ref/index' -import type { TSchema } from '../schema/index' -import type { TSymbol } from '../symbol/index' -import type { TTuple } from '../tuple/index' -import type { TUint8Array } from '../uint8array/index' -import type { TUndefined } from '../undefined/index' -import type { TUnknown } from '../unknown/index' -import type { TUnsafe } from '../unsafe/index' -import type { TVoid } from '../void/index' -import type { TDate } from '../date/index' -import type { TThis } from '../recursive/index' +import type { TransformOptions } from '../transform/index.mjs' +import type { TTemplateLiteral, TTemplateLiteralKind } from '../template-literal/index.mjs' +import type { TArray } from '../array/index.mjs' +import type { TBoolean } from '../boolean/index.mjs' +import type { TRecord } from '../record/index.mjs' +import type { TString } from '../string/index.mjs' +import type { TUnion } from '../union/index.mjs' +import type { TAny } from '../any/index.mjs' +import type { TAsyncIterator } from '../async-iterator/index.mjs' +import type { TBigInt } from '../bigint/index.mjs' +import type { TConstructor } from '../constructor/index.mjs' +import type { TFunction } from '../function/index.mjs' +import type { TInteger } from '../integer/index.mjs' +import type { TIntersect } from '../intersect/index.mjs' +import type { TIterator } from '../iterator/index.mjs' +import type { TLiteral } from '../literal/index.mjs' +import type { TNever } from '../never/index.mjs' +import type { TNot } from '../not/index.mjs' +import type { TNull } from '../null/index.mjs' +import type { TNumber } from '../number/index.mjs' +import type { TObject, TAdditionalProperties } from '../object/index.mjs' +import type { TOptional } from '../optional/index.mjs' +import type { TPromise } from '../promise/index.mjs' +import type { TReadonly } from '../readonly/index.mjs' +import type { TRef } from '../ref/index.mjs' +import type { TSchema } from '../schema/index.mjs' +import type { TSymbol } from '../symbol/index.mjs' +import type { TTuple } from '../tuple/index.mjs' +import type { TUint8Array } from '../uint8array/index.mjs' +import type { TUndefined } from '../undefined/index.mjs' +import type { TUnknown } from '../unknown/index.mjs' +import type { TUnsafe } from '../unsafe/index.mjs' +import type { TVoid } from '../void/index.mjs' +import type { TDate } from '../date/index.mjs' +import type { TThis } from '../recursive/index.mjs' export class TypeGuardUnknownTypeError extends Error {} diff --git a/src/type/guard/value.ts b/src/type/guard/value.mts similarity index 100% rename from src/type/guard/value.ts rename to src/type/guard/value.mts diff --git a/src/type/helpers/helpers.ts b/src/type/helpers/helpers.mts similarity index 96% rename from src/type/helpers/helpers.ts rename to src/type/helpers/helpers.mts index d47ec65d2..e25915eaf 100644 --- a/src/type/helpers/helpers.ts +++ b/src/type/helpers/helpers.mts @@ -26,9 +26,9 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema } from '../schema/index' -import type { TProperties } from '../object/index' -import type { TNever } from '../never/index' +import type { TSchema } from '../schema/index.mjs' +import type { TProperties } from '../object/index.mjs' +import type { TNever } from '../never/index.mjs' // ------------------------------------------------------------------ // Helper: Common // ------------------------------------------------------------------ diff --git a/src/type/helpers/index.mts b/src/type/helpers/index.mts new file mode 100644 index 000000000..bd012acec --- /dev/null +++ b/src/type/helpers/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './helpers.mjs' diff --git a/src/type/helpers/index.ts b/src/type/helpers/index.ts deleted file mode 100644 index 4d6559c8a..000000000 --- a/src/type/helpers/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './helpers' diff --git a/src/type/index.mts b/src/type/index.mts new file mode 100644 index 000000000..c854d3860 --- /dev/null +++ b/src/type/index.mts @@ -0,0 +1,98 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './any/index.mjs' +export * from './array/index.mjs' +export * from './async-iterator/index.mjs' +export * from './awaited/index.mjs' +export * from './bigint/index.mjs' +export * from './boolean/index.mjs' +export * from './clone/index.mjs' +export * from './composite/index.mjs' +export * from './const/index.mjs' +export * from './constructor/index.mjs' +export * from './constructor-parameters/index.mjs' +export * from './date/index.mjs' +export * from './deref/index.mjs' +export * from './discard/index.mjs' +export * from './enum/index.mjs' +export * from './exclude/index.mjs' +export * from './extends/index.mjs' +export * from './extract/index.mjs' +export * from './function/index.mjs' +export * from './guard/index.mjs' +export * from './helpers/index.mjs' +export * from './indexed/index.mjs' +export * from './instance-type/index.mjs' +export * from './integer/index.mjs' +export * from './intersect/index.mjs' +export * from './intrinsic/index.mjs' +export * from './iterator/index.mjs' +export * from './keyof/index.mjs' +export * from './literal/index.mjs' +export * from './mapped/index.mjs' +export * from './modifiers/index.mjs' +export * from './never/index.mjs' +export * from './not/index.mjs' +export * from './null/index.mjs' +export * from './number/index.mjs' +export * from './object/index.mjs' +export * from './omit/index.mjs' +export * from './operators/index.mjs' +export * from './optional/index.mjs' +export * from './parameters/index.mjs' +export * from './partial/index.mjs' +export * from './patterns/index.mjs' +export * from './pick/index.mjs' +export * from './promise/index.mjs' +export * from './readonly/index.mjs' +export * from './readonly-optional/index.mjs' +export * from './record/index.mjs' +export * from './recursive/index.mjs' +export * from './ref/index.mjs' +export * from './regexp/index.mjs' +export * from './registry/index.mjs' +export * from './required/index.mjs' +export * from './rest/index.mjs' +export * from './return-type/index.mjs' +export * from './schema/index.mjs' +export * from './static/index.mjs' +export * from './strict/index.mjs' +export * from './string/index.mjs' +export * from './symbol/index.mjs' +export * from './symbols/index.mjs' +export * from './template-literal/index.mjs' +export * from './transform/index.mjs' +export * from './tuple/index.mjs' +export * from './type/index.mjs' +export * from './uint8array/index.mjs' +export * from './undefined/index.mjs' +export * from './union/index.mjs' +export * from './unknown/index.mjs' +export * from './unsafe/index.mjs' +export * from './void/index.mjs' diff --git a/src/type/index.ts b/src/type/index.ts deleted file mode 100644 index 0d77f8003..000000000 --- a/src/type/index.ts +++ /dev/null @@ -1,98 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './any/index' -export * from './array/index' -export * from './async-iterator/index' -export * from './awaited/index' -export * from './bigint/index' -export * from './boolean/index' -export * from './clone/index' -export * from './composite/index' -export * from './const/index' -export * from './constructor/index' -export * from './constructor-parameters/index' -export * from './date/index' -export * from './deref/index' -export * from './discard/index' -export * from './enum/index' -export * from './exclude/index' -export * from './extends/index' -export * from './extract/index' -export * from './function/index' -export * from './guard/index' -export * from './helpers/index' -export * from './indexed/index' -export * from './instance-type/index' -export * from './integer/index' -export * from './intersect/index' -export * from './intrinsic/index' -export * from './iterator/index' -export * from './keyof/index' -export * from './literal/index' -export * from './mapped/index' -export * from './modifiers/index' -export * from './never/index' -export * from './not/index' -export * from './null/index' -export * from './number/index' -export * from './object/index' -export * from './omit/index' -export * from './operators/index' -export * from './optional/index' -export * from './parameters/index' -export * from './partial/index' -export * from './patterns/index' -export * from './pick/index' -export * from './promise/index' -export * from './readonly/index' -export * from './readonly-optional/index' -export * from './record/index' -export * from './recursive/index' -export * from './ref/index' -export * from './regexp/index' -export * from './registry/index' -export * from './required/index' -export * from './rest/index' -export * from './return-type/index' -export * from './schema/index' -export * from './static/index' -export * from './strict/index' -export * from './string/index' -export * from './symbol/index' -export * from './symbols/index' -export * from './template-literal/index' -export * from './transform/index' -export * from './tuple/index' -export * from './type/index' -export * from './uint8array/index' -export * from './undefined/index' -export * from './union/index' -export * from './unknown/index' -export * from './unsafe/index' -export * from './void/index' diff --git a/src/type/indexed/index.mts b/src/type/indexed/index.mts new file mode 100644 index 000000000..a20c2b8f8 --- /dev/null +++ b/src/type/indexed/index.mts @@ -0,0 +1,31 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './indexed-key.mjs' +export * from './indexed-type.mjs' +export * from './indexed.mjs' diff --git a/src/type/indexed/index.ts b/src/type/indexed/index.ts deleted file mode 100644 index ca6b25b2c..000000000 --- a/src/type/indexed/index.ts +++ /dev/null @@ -1,31 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './indexed-key' -export * from './indexed-type' -export * from './indexed' diff --git a/src/type/indexed/indexed-key.ts b/src/type/indexed/indexed-key.mts similarity index 93% rename from src/type/indexed/indexed-key.ts rename to src/type/indexed/indexed-key.mts index 17f470f63..952e7daa2 100644 --- a/src/type/indexed/indexed-key.ts +++ b/src/type/indexed/indexed-key.mts @@ -26,13 +26,13 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { type TTemplateLiteral, TemplateLiteralGenerate, TemplateLiteralParseExact, IsTemplateLiteralFinite, TemplateLiteralToUnion } from '../template-literal/index' -import { type TLiteral, type TLiteralValue } from '../literal/index' -import { type TInteger } from '../integer/index' -import { type TNumber } from '../number/index' -import { type TSchema } from '../schema/index' -import { type TUnion } from '../union/index' -import { TTemplateLiteral as IsTemplateLiteralType, TUnionLiteral as IsUnionLiteralType, TUnion as IsUnionType, TLiteral as IsLiteralType, TNumber as IsNumberType, TInteger as IsIntegerType } from '../guard/type' +import { type TTemplateLiteral, TemplateLiteralGenerate, TemplateLiteralParseExact, IsTemplateLiteralFinite, TemplateLiteralToUnion } from '../template-literal/index.mjs' +import { type TLiteral, type TLiteralValue } from '../literal/index.mjs' +import { type TInteger } from '../integer/index.mjs' +import { type TNumber } from '../number/index.mjs' +import { type TSchema } from '../schema/index.mjs' +import { type TUnion } from '../union/index.mjs' +import { TTemplateLiteral as IsTemplateLiteralType, TUnionLiteral as IsUnionLiteralType, TUnion as IsUnionType, TLiteral as IsLiteralType, TNumber as IsNumberType, TInteger as IsIntegerType } from '../guard/type.mjs' // ------------------------------------------------------------------ // FromTemplateLiteral diff --git a/src/type/indexed/indexed-type.ts b/src/type/indexed/indexed-type.mts similarity index 92% rename from src/type/indexed/indexed-type.ts rename to src/type/indexed/indexed-type.mts index be88eb3ae..09d9dd2b5 100644 --- a/src/type/indexed/indexed-type.ts +++ b/src/type/indexed/indexed-type.mts @@ -26,18 +26,18 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { type TSchema } from '../schema/index' -import { type TObject, type TProperties } from '../object' -import { type TNever, Never } from '../never/index' -import { type TRecursive } from '../recursive/index' -import { type TIntersect } from '../intersect/index' -import { type TUnion } from '../union/index' -import { type TTuple } from '../tuple/index' -import { type TArray } from '../array/index' -import { IntersectResolve } from '../intersect/index' -import { UnionResolve } from '../union/index' +import { type TSchema } from '../schema/index.mjs' +import { type TObject, type TProperties } from '../object/index.mjs' +import { type TNever, Never } from '../never/index.mjs' +import { type TRecursive } from '../recursive/index.mjs' +import { type TIntersect } from '../intersect/index.mjs' +import { type TUnion } from '../union/index.mjs' +import { type TTuple } from '../tuple/index.mjs' +import { type TArray } from '../array/index.mjs' +import { IntersectResolve } from '../intersect/index.mjs' +import { UnionResolve } from '../union/index.mjs' -import { TIntersect as IsIntersectType, TUnion as IsUnionType, TTuple as IsTupleType, TArray as IsArrayType, TObject as IsObjectType, TNever as IsNeverType } from '../guard/type' +import { TIntersect as IsIntersectType, TUnion as IsUnionType, TTuple as IsTupleType, TArray as IsArrayType, TObject as IsObjectType, TNever as IsNeverType } from '../guard/type.mjs' // ------------------------------------------------------------------ // FromRest // ------------------------------------------------------------------ diff --git a/src/type/indexed/indexed.ts b/src/type/indexed/indexed.mts similarity index 88% rename from src/type/indexed/indexed.ts rename to src/type/indexed/indexed.mts index 1ecf5bbcc..339873d29 100644 --- a/src/type/indexed/indexed.ts +++ b/src/type/indexed/indexed.mts @@ -26,11 +26,11 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import { IndexedTypeResolve } from './indexed-type' -import { IndexedKeyResolve } from './indexed-key' -import { CloneType } from '../clone/type' -import { TSchema as IsSchemaType } from '../guard/type' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import { IndexedTypeResolve } from './indexed-type.mjs' +import { IndexedKeyResolve } from './indexed-key.mjs' +import { CloneType } from '../clone/type.mjs' +import { TSchema as IsSchemaType } from '../guard/type.mjs' // ------------------------------------------------------------------ // TIndex // ------------------------------------------------------------------ diff --git a/src/type/instance-type/index.mts b/src/type/instance-type/index.mts new file mode 100644 index 000000000..c3ec7830a --- /dev/null +++ b/src/type/instance-type/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './instance-type.mjs' diff --git a/src/type/instance-type/index.ts b/src/type/instance-type/index.ts deleted file mode 100644 index aa85b717a..000000000 --- a/src/type/instance-type/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './instance-type' diff --git a/src/type/instance-type/instance-type.ts b/src/type/instance-type/instance-type.mts similarity index 91% rename from src/type/instance-type/instance-type.ts rename to src/type/instance-type/instance-type.mts index ffc7093f5..e9d30515d 100644 --- a/src/type/instance-type/instance-type.ts +++ b/src/type/instance-type/instance-type.mts @@ -26,9 +26,9 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import type { TConstructor } from '../constructor/index' -import { CloneType } from '../clone/type' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { TConstructor } from '../constructor/index.mjs' +import { CloneType } from '../clone/type.mjs' // ------------------------------------------------------------------ // TInstanceType diff --git a/src/type/integer/index.mts b/src/type/integer/index.mts new file mode 100644 index 000000000..c4ad82f1a --- /dev/null +++ b/src/type/integer/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './integer.mjs' diff --git a/src/type/integer/index.ts b/src/type/integer/index.ts deleted file mode 100644 index 73513ebc8..000000000 --- a/src/type/integer/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './integer' diff --git a/src/type/integer/integer.ts b/src/type/integer/integer.mts similarity index 94% rename from src/type/integer/integer.ts rename to src/type/integer/integer.mts index 513d94c7c..5497fbb54 100644 --- a/src/type/integer/integer.ts +++ b/src/type/integer/integer.mts @@ -26,8 +26,8 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import { Kind } from '../symbols/index' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import { Kind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // TInteger diff --git a/src/type/intersect/index.mts b/src/type/intersect/index.mts new file mode 100644 index 000000000..b9a9204e1 --- /dev/null +++ b/src/type/intersect/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './intersect.mjs' diff --git a/src/type/intersect/index.ts b/src/type/intersect/index.ts deleted file mode 100644 index 59135edfc..000000000 --- a/src/type/intersect/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './intersect' diff --git a/src/type/intersect/intersect.ts b/src/type/intersect/intersect.mts similarity index 89% rename from src/type/intersect/intersect.ts rename to src/type/intersect/intersect.mts index 4fc3a4693..333158a40 100644 --- a/src/type/intersect/intersect.ts +++ b/src/type/intersect/intersect.mts @@ -26,14 +26,14 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TupleToIntersect, AssertType } from '../helpers/index' -import type { TSchema, SchemaOptions } from '../schema/index' -import type { Static } from '../static/index' -import { type TNever, Never } from '../never/index' -import { OptionalFromIntersect } from '../modifiers/index' -import { Kind } from '../symbols/index' -import { CloneType, CloneRest } from '../clone/type' -import { TTransform as IsTransformType, TObject as IsObjectType, TSchema as IsSchemaType } from '../guard/type' +import type { TupleToIntersect, AssertType } from '../helpers/index.mjs' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { Static } from '../static/index.mjs' +import { type TNever, Never } from '../never/index.mjs' +import { OptionalFromIntersect } from '../modifiers/index.mjs' +import { Kind } from '../symbols/index.mjs' +import { CloneType, CloneRest } from '../clone/type.mjs' +import { TTransform as IsTransformType, TObject as IsObjectType, TSchema as IsSchemaType } from '../guard/type.mjs' // ------------------------------------------------------------------ // IntersectResolve diff --git a/src/type/intrinsic/index.mts b/src/type/intrinsic/index.mts new file mode 100644 index 000000000..99accd52c --- /dev/null +++ b/src/type/intrinsic/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './intrinsic.mjs' diff --git a/src/type/intrinsic/index.ts b/src/type/intrinsic/index.ts deleted file mode 100644 index 6c20265fb..000000000 --- a/src/type/intrinsic/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './intrinsic' diff --git a/src/type/intrinsic/intrinsic.ts b/src/type/intrinsic/intrinsic.mts similarity index 96% rename from src/type/intrinsic/intrinsic.ts rename to src/type/intrinsic/intrinsic.mts index 48daf0810..553c7c921 100644 --- a/src/type/intrinsic/intrinsic.ts +++ b/src/type/intrinsic/intrinsic.mts @@ -26,12 +26,12 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import { type TTemplateLiteral, type TTemplateLiteralKind, TemplateLiteral, TemplateLiteralParseExact, IsTemplateLiteralFinite, TemplateLiteralGenerate } from '../template-literal/index' -import { type TLiteral, type TLiteralValue, Literal } from '../literal/index' -import { type TUnion, Union } from '../union/index' -import { TTemplateLiteral as IsTemplateLiteralType, TUnion as IsUnionType, TLiteral as IsLiteralType } from '../guard/type' -import { CloneType } from '../clone/type' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import { type TTemplateLiteral, type TTemplateLiteralKind, TemplateLiteral, TemplateLiteralParseExact, IsTemplateLiteralFinite, TemplateLiteralGenerate } from '../template-literal/index.mjs' +import { type TLiteral, type TLiteralValue, Literal } from '../literal/index.mjs' +import { type TUnion, Union } from '../union/index.mjs' +import { TTemplateLiteral as IsTemplateLiteralType, TUnion as IsUnionType, TLiteral as IsLiteralType } from '../guard/type.mjs' +import { CloneType } from '../clone/type.mjs' // ------------------------------------------------------------------ // Apply diff --git a/src/type/iterator/index.mts b/src/type/iterator/index.mts new file mode 100644 index 000000000..30e86a2e5 --- /dev/null +++ b/src/type/iterator/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './iterator.mjs' diff --git a/src/type/iterator/index.ts b/src/type/iterator/index.ts deleted file mode 100644 index 8c41f54e3..000000000 --- a/src/type/iterator/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './iterator' diff --git a/src/type/iterator/iterator.ts b/src/type/iterator/iterator.mts similarity index 90% rename from src/type/iterator/iterator.ts rename to src/type/iterator/iterator.mts index 66b75bfbc..1968205c1 100644 --- a/src/type/iterator/iterator.ts +++ b/src/type/iterator/iterator.mts @@ -26,10 +26,10 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import type { Static } from '../static/index' -import { Kind } from '../symbols/index' -import { CloneType } from '../clone/type' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { Static } from '../static/index.mjs' +import { Kind } from '../symbols/index.mjs' +import { CloneType } from '../clone/type.mjs' // ------------------------------------------------------------------ // TIterator diff --git a/src/type/keyof/index.mts b/src/type/keyof/index.mts new file mode 100644 index 000000000..07338d120 --- /dev/null +++ b/src/type/keyof/index.mts @@ -0,0 +1,31 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './keyof-string.mjs' +export * from './keyof-type.mjs' +export * from './keyof.mjs' diff --git a/src/type/keyof/index.ts b/src/type/keyof/index.ts deleted file mode 100644 index 61708fc40..000000000 --- a/src/type/keyof/index.ts +++ /dev/null @@ -1,31 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './keyof-string' -export * from './keyof-type' -export * from './keyof' diff --git a/src/type/keyof/keyof-string.ts b/src/type/keyof/keyof-string.mts similarity index 93% rename from src/type/keyof/keyof-string.ts rename to src/type/keyof/keyof-string.mts index dd38ed96e..c9314f88a 100644 --- a/src/type/keyof/keyof-string.ts +++ b/src/type/keyof/keyof-string.mts @@ -26,16 +26,16 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema } from '../schema/index' -import { type ZeroString, type UnionToTuple, Increment } from '../helpers/index' -import type { TRecursive } from '../recursive/index' -import type { TIntersect } from '../intersect/index' -import type { TUnion } from '../union/index' -import type { TTuple } from '../tuple/index' -import type { TArray } from '../array/index' -import type { TObject, TProperties } from '../object/index' -import { OperatorUnionMany, OperatorIntersectMany } from '../operators/index' -import { TIntersect as IsIntersectType, TUnion as IsUnionType, TTuple as IsTupleType, TArray as IsArrayType, TObject as IsObjectType, TRecord as IsRecordType } from '../guard/type' +import type { TSchema } from '../schema/index.mjs' +import { type ZeroString, type UnionToTuple, Increment } from '../helpers/index.mjs' +import type { TRecursive } from '../recursive/index.mjs' +import type { TIntersect } from '../intersect/index.mjs' +import type { TUnion } from '../union/index.mjs' +import type { TTuple } from '../tuple/index.mjs' +import type { TArray } from '../array/index.mjs' +import type { TObject, TProperties } from '../object/index.mjs' +import { OperatorUnionMany, OperatorIntersectMany } from '../operators/index.mjs' +import { TIntersect as IsIntersectType, TUnion as IsUnionType, TTuple as IsTupleType, TArray as IsArrayType, TObject as IsObjectType, TRecord as IsRecordType } from '../guard/type.mjs' // ------------------------------------------------------------------ // FromRest diff --git a/src/type/keyof/keyof-type.ts b/src/type/keyof/keyof-type.mts similarity index 90% rename from src/type/keyof/keyof-type.ts rename to src/type/keyof/keyof-type.mts index 88ccb5b42..67388a547 100644 --- a/src/type/keyof/keyof-type.ts +++ b/src/type/keyof/keyof-type.mts @@ -26,12 +26,12 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema } from '../schema/index' -import type { Ensure } from '../helpers/index' -import { type TLiteral, TLiteralValue, Literal } from '../literal/index' -import { type TNumber, Number } from '../number/index' -import { KeyOfStringResolve } from './keyof-string' -import { UnionResolve } from '../union/index' +import type { TSchema } from '../schema/index.mjs' +import type { Ensure } from '../helpers/index.mjs' +import { type TLiteral, TLiteralValue, Literal } from '../literal/index.mjs' +import { type TNumber, Number } from '../number/index.mjs' +import { KeyOfStringResolve } from './keyof-string.mjs' +import { UnionResolve } from '../union/index.mjs' // ------------------------------------------------------------------ // FromLiterals diff --git a/src/type/keyof/keyof.ts b/src/type/keyof/keyof.mts similarity index 91% rename from src/type/keyof/keyof.ts rename to src/type/keyof/keyof.mts index 2c0a4b35d..b1388cb2c 100644 --- a/src/type/keyof/keyof.ts +++ b/src/type/keyof/keyof.mts @@ -26,9 +26,9 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import { KeyOfTypeResolve } from './keyof-type' -import { CloneType } from '../clone/type' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import { KeyOfTypeResolve } from './keyof-type.mjs' +import { CloneType } from '../clone/type.mjs' // ------------------------------------------------------------------ // TKeyOf diff --git a/src/type/literal/index.mts b/src/type/literal/index.mts new file mode 100644 index 000000000..884b82efc --- /dev/null +++ b/src/type/literal/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './literal.mjs' diff --git a/src/type/literal/index.ts b/src/type/literal/index.ts deleted file mode 100644 index d4cb53ef2..000000000 --- a/src/type/literal/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './literal' diff --git a/src/type/literal/literal.ts b/src/type/literal/literal.mts similarity index 95% rename from src/type/literal/literal.ts rename to src/type/literal/literal.mts index 8754ffd7c..0c3934818 100644 --- a/src/type/literal/literal.ts +++ b/src/type/literal/literal.mts @@ -26,8 +26,8 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import { Kind } from '../symbols/index' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import { Kind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // TLiteralValue diff --git a/src/type/mapped/index.mts b/src/type/mapped/index.mts new file mode 100644 index 000000000..4f96285bb --- /dev/null +++ b/src/type/mapped/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './mapped.mjs' diff --git a/src/type/mapped/index.ts b/src/type/mapped/index.ts deleted file mode 100644 index 67272965f..000000000 --- a/src/type/mapped/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './mapped' diff --git a/src/type/mapped/mapped.ts b/src/type/mapped/mapped.mts similarity index 92% rename from src/type/mapped/mapped.ts rename to src/type/mapped/mapped.mts index d05857a59..a2bb2524e 100644 --- a/src/type/mapped/mapped.ts +++ b/src/type/mapped/mapped.mts @@ -26,14 +26,14 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema } from '../schema/index' -import type { Evaluate } from '../helpers/index' -import type { Static } from '../static/index' -import { Object, type TObject, type TProperties } from '../object/index' -import { Literal } from '../literal/index' -import { IndexedKeyResolve } from '../indexed/indexed-key' -import { TSchema as IsSchemaType } from '../guard/type' -import { Kind } from '../symbols/index' +import type { TSchema } from '../schema/index.mjs' +import type { Evaluate } from '../helpers/index.mjs' +import type { Static } from '../static/index.mjs' +import { Object, type TObject, type TProperties } from '../object/index.mjs' +import { Literal } from '../literal/index.mjs' +import { IndexedKeyResolve } from '../indexed/indexed-key.mjs' +import { TSchema as IsSchemaType } from '../guard/type.mjs' +import { Kind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // TMappedKey diff --git a/src/type/modifiers/index.mts b/src/type/modifiers/index.mts new file mode 100644 index 000000000..2a82a7000 --- /dev/null +++ b/src/type/modifiers/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './modifiers.mjs' diff --git a/src/type/modifiers/index.ts b/src/type/modifiers/index.ts deleted file mode 100644 index e57239326..000000000 --- a/src/type/modifiers/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './modifiers' diff --git a/src/type/modifiers/modifiers.ts b/src/type/modifiers/modifiers.mts similarity index 92% rename from src/type/modifiers/modifiers.ts rename to src/type/modifiers/modifiers.mts index 75387d047..78462aefe 100644 --- a/src/type/modifiers/modifiers.ts +++ b/src/type/modifiers/modifiers.mts @@ -26,14 +26,14 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema } from '../schema/index' -import type { TReadonly } from '../readonly/index' -import { type TIntersect, Intersect } from '../intersect/index' -import { type TUnion, Union } from '../union/index' -import { type TOptional, Optional } from '../optional/index' -import { Discard } from '../discard/index' -import { OptionalKind } from '../symbols/index' -import { TOptional as IsOptionalType } from '../guard/type' +import type { TSchema } from '../schema/index.mjs' +import type { TReadonly } from '../readonly/index.mjs' +import { type TIntersect, Intersect } from '../intersect/index.mjs' +import { type TUnion, Union } from '../union/index.mjs' +import { type TOptional, Optional } from '../optional/index.mjs' +import { Discard } from '../discard/index.mjs' +import { OptionalKind } from '../symbols/index.mjs' +import { TOptional as IsOptionalType } from '../guard/type.mjs' // ------------------------------------------------------------------ // IsOptionalFromIntersect diff --git a/src/type/never/index.mts b/src/type/never/index.mts new file mode 100644 index 000000000..28d23dffb --- /dev/null +++ b/src/type/never/index.mts @@ -0,0 +1,28 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ +export * from './never.mjs' diff --git a/src/type/never/index.ts b/src/type/never/index.ts deleted file mode 100644 index 913504405..000000000 --- a/src/type/never/index.ts +++ /dev/null @@ -1,28 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ -export * from './never' diff --git a/src/type/never/never.ts b/src/type/never/never.mts similarity index 94% rename from src/type/never/never.ts rename to src/type/never/never.mts index 89c73c925..9fc60ad6a 100644 --- a/src/type/never/never.ts +++ b/src/type/never/never.mts @@ -26,8 +26,8 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import { Kind } from '../symbols/index' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import { Kind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // TNever diff --git a/src/type/bigint/index.ts b/src/type/not/index.mts similarity index 98% rename from src/type/bigint/index.ts rename to src/type/not/index.mts index ce8f4fbf9..709f17e26 100644 --- a/src/type/bigint/index.ts +++ b/src/type/not/index.mts @@ -26,4 +26,4 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -export * from './bigint' +export * from './not.mjs' diff --git a/src/type/not/index.ts b/src/type/not/index.ts deleted file mode 100644 index 49cf9dca8..000000000 --- a/src/type/not/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './not' diff --git a/src/type/not/not.ts b/src/type/not/not.mts similarity index 89% rename from src/type/not/not.ts rename to src/type/not/not.mts index 71c1f3c44..358a0de6a 100644 --- a/src/type/not/not.ts +++ b/src/type/not/not.mts @@ -26,10 +26,10 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import type { Static } from '../static/index' -import { Kind } from '../symbols/index' -import { CloneType } from '../clone/type' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { Static } from '../static/index.mjs' +import { Kind } from '../symbols/index.mjs' +import { CloneType } from '../clone/type.mjs' // ------------------------------------------------------------------ // TNot diff --git a/src/type/null/index.mts b/src/type/null/index.mts new file mode 100644 index 000000000..66bcb8e65 --- /dev/null +++ b/src/type/null/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './null.mjs' diff --git a/src/type/null/index.ts b/src/type/null/index.ts deleted file mode 100644 index 281bef4f4..000000000 --- a/src/type/null/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './null' diff --git a/src/type/null/null.ts b/src/type/null/null.mts similarity index 94% rename from src/type/null/null.ts rename to src/type/null/null.mts index 6c0f5cf38..a31fb65d8 100644 --- a/src/type/null/null.ts +++ b/src/type/null/null.mts @@ -26,8 +26,8 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import { Kind } from '../symbols/index' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import { Kind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // TNull diff --git a/src/type/number/index.mts b/src/type/number/index.mts new file mode 100644 index 000000000..018c02e35 --- /dev/null +++ b/src/type/number/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './number.mjs' diff --git a/src/type/number/index.ts b/src/type/number/index.ts deleted file mode 100644 index c43f623c7..000000000 --- a/src/type/number/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './number' diff --git a/src/type/number/number.ts b/src/type/number/number.mts similarity index 94% rename from src/type/number/number.ts rename to src/type/number/number.mts index d047ea8ef..03ce3118c 100644 --- a/src/type/number/number.ts +++ b/src/type/number/number.mts @@ -26,8 +26,8 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import { Kind } from '../symbols/index' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import { Kind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // TNumber diff --git a/src/type/object/index.mts b/src/type/object/index.mts new file mode 100644 index 000000000..7ad7ba6d5 --- /dev/null +++ b/src/type/object/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './object.mjs' diff --git a/src/type/object/index.ts b/src/type/object/index.ts deleted file mode 100644 index 5bebd5824..000000000 --- a/src/type/object/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './object' diff --git a/src/type/object/object.ts b/src/type/object/object.mts similarity index 92% rename from src/type/object/object.ts rename to src/type/object/object.mts index c47a039d2..626c5e183 100644 --- a/src/type/object/object.ts +++ b/src/type/object/object.mts @@ -26,14 +26,14 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import type { Static } from '../static/index' -import type { Evaluate } from '../helpers/index' -import type { TReadonly } from '../readonly/index' -import type { TOptional } from '../optional/index' -import { CloneType } from '../clone/type' -import { Kind } from '../symbols/index' -import { TOptional as IsOptionalType, TSchema as IsSchemaType } from '../guard/type' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { Static } from '../static/index.mjs' +import type { Evaluate } from '../helpers/index.mjs' +import type { TReadonly } from '../readonly/index.mjs' +import type { TOptional } from '../optional/index.mjs' +import { CloneType } from '../clone/type.mjs' +import { Kind } from '../symbols/index.mjs' +import { TOptional as IsOptionalType, TSchema as IsSchemaType } from '../guard/type.mjs' // ------------------------------------------------------------------ // TProperties diff --git a/src/type/omit/index.mts b/src/type/omit/index.mts new file mode 100644 index 000000000..ccac50e35 --- /dev/null +++ b/src/type/omit/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './omit.mjs' diff --git a/src/type/omit/index.ts b/src/type/omit/index.ts deleted file mode 100644 index d1fc93833..000000000 --- a/src/type/omit/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './omit' diff --git a/src/type/omit/omit.ts b/src/type/omit/omit.mts similarity index 90% rename from src/type/omit/omit.ts rename to src/type/omit/omit.mts index 2995c5176..7fd6d42aa 100644 --- a/src/type/omit/omit.ts +++ b/src/type/omit/omit.mts @@ -26,18 +26,18 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import type { TupleToUnion, Evaluate } from '../helpers/index' -import { type TRecursive } from '../recursive/index' -import { type TIntersect, Intersect } from '../intersect/index' -import { type TUnion, Union } from '../union/index' -import { type TObject, type TProperties, Object } from '../object/index' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { TupleToUnion, Evaluate } from '../helpers/index.mjs' +import { type TRecursive } from '../recursive/index.mjs' +import { type TIntersect, Intersect } from '../intersect/index.mjs' +import { type TUnion, Union } from '../union/index.mjs' +import { type TObject, type TProperties, Object } from '../object/index.mjs' -import { IndexedKeyResolve } from '../indexed/index' -import { Discard } from '../discard/index' -import { TransformKind } from '../symbols/index' -import { CloneType } from '../clone/type' -import { TIntersect as IsIntersectType, TUnion as IsUnionType, TObject as IsObjectType, TSchema as IsSchemaType } from '../guard/type' +import { IndexedKeyResolve } from '../indexed/index.mjs' +import { Discard } from '../discard/index.mjs' +import { TransformKind } from '../symbols/index.mjs' +import { CloneType } from '../clone/type.mjs' +import { TIntersect as IsIntersectType, TUnion as IsUnionType, TObject as IsObjectType, TSchema as IsSchemaType } from '../guard/type.mjs' // ------------------------------------------------------------------ // FromIntersect diff --git a/src/type/operators/index.mts b/src/type/operators/index.mts new file mode 100644 index 000000000..25b8bce42 --- /dev/null +++ b/src/type/operators/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './operators.mjs' diff --git a/src/type/operators/index.ts b/src/type/operators/index.ts deleted file mode 100644 index 59a6c6925..000000000 --- a/src/type/operators/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './operators' diff --git a/src/type/operators/operators.ts b/src/type/operators/operators.mts similarity index 100% rename from src/type/operators/operators.ts rename to src/type/operators/operators.mts diff --git a/src/type/optional/index.mts b/src/type/optional/index.mts new file mode 100644 index 000000000..16c590e63 --- /dev/null +++ b/src/type/optional/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './optional.mjs' diff --git a/src/type/optional/index.ts b/src/type/optional/index.ts deleted file mode 100644 index 637cf0620..000000000 --- a/src/type/optional/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './optional' diff --git a/src/type/optional/optional.ts b/src/type/optional/optional.mts similarity index 92% rename from src/type/optional/optional.ts rename to src/type/optional/optional.mts index f55c77a2b..bce3e2430 100644 --- a/src/type/optional/optional.ts +++ b/src/type/optional/optional.mts @@ -26,9 +26,9 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema } from '../schema/index' -import { OptionalKind } from '../symbols/index' -import { CloneType } from '../clone/type' +import type { TSchema } from '../schema/index.mjs' +import { OptionalKind } from '../symbols/index.mjs' +import { CloneType } from '../clone/type.mjs' // ------------------------------------------------------------------ // TOptional diff --git a/src/type/async-iterator/index.ts b/src/type/parameters/index.mts similarity index 97% rename from src/type/async-iterator/index.ts rename to src/type/parameters/index.mts index d6bc7cb22..7e67002d5 100644 --- a/src/type/async-iterator/index.ts +++ b/src/type/parameters/index.mts @@ -26,4 +26,4 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -export * from './async-iterator' +export * from './parameters.mjs' diff --git a/src/type/parameters/index.ts b/src/type/parameters/index.ts deleted file mode 100644 index 195fafbb0..000000000 --- a/src/type/parameters/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './parameters' diff --git a/src/type/parameters/parameters.ts b/src/type/parameters/parameters.mts similarity index 86% rename from src/type/parameters/parameters.ts rename to src/type/parameters/parameters.mts index ab6ac76b0..22ec21a0f 100644 --- a/src/type/parameters/parameters.ts +++ b/src/type/parameters/parameters.mts @@ -26,11 +26,11 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import type { TFunction } from '../function/index' -import type { Ensure } from '../helpers/index' -import { type TTuple, Tuple } from '../tuple/index' -import { CloneRest } from '../clone/type' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { TFunction } from '../function/index.mjs' +import type { Ensure } from '../helpers/index.mjs' +import { type TTuple, Tuple } from '../tuple/index.mjs' +import { CloneRest } from '../clone/type.mjs' // ------------------------------------------------------------------ // TParameters diff --git a/src/type/partial/index.mts b/src/type/partial/index.mts new file mode 100644 index 000000000..164ae5208 --- /dev/null +++ b/src/type/partial/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './partial.mjs' diff --git a/src/type/partial/index.ts b/src/type/partial/index.ts deleted file mode 100644 index ce37bcee5..000000000 --- a/src/type/partial/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './partial' diff --git a/src/type/partial/partial.ts b/src/type/partial/partial.mts similarity index 86% rename from src/type/partial/partial.ts rename to src/type/partial/partial.mts index e7d469d69..e9fbdad51 100644 --- a/src/type/partial/partial.ts +++ b/src/type/partial/partial.mts @@ -26,19 +26,19 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import type { Evaluate } from '../helpers/index' -import { type TReadonlyOptional } from '../readonly-optional' -import { type TOptional, Optional } from '../optional/index' -import { type TReadonly } from '../readonly/index' -import { type TRecursive } from '../recursive/index' -import { type TObject, type TProperties, Object } from '../object/index' -import { type TIntersect, Intersect } from '../intersect/index' -import { type TUnion, Union } from '../union/index' -import { Discard } from '../discard/index' -import { TransformKind } from '../symbols/index' -import { CloneType } from '../clone/type' -import { TIntersect as IsIntersectType, TUnion as IsUnionType, TObject as IsObjectType } from '../guard/type' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { Evaluate } from '../helpers/index.mjs' +import { type TReadonlyOptional } from '../readonly-optional/index.mjs' +import { type TOptional, Optional } from '../optional/index.mjs' +import { type TReadonly } from '../readonly/index.mjs' +import { type TRecursive } from '../recursive/index.mjs' +import { type TObject, type TProperties, Object } from '../object/index.mjs' +import { type TIntersect, Intersect } from '../intersect/index.mjs' +import { type TUnion, Union } from '../union/index.mjs' +import { Discard } from '../discard/index.mjs' +import { TransformKind } from '../symbols/index.mjs' +import { CloneType } from '../clone/type.mjs' +import { TIntersect as IsIntersectType, TUnion as IsUnionType, TObject as IsObjectType } from '../guard/type.mjs' // ------------------------------------------------------------------ // FromIntersect diff --git a/src/type/patterns/index.mts b/src/type/patterns/index.mts new file mode 100644 index 000000000..63c5d7d2d --- /dev/null +++ b/src/type/patterns/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './patterns.mjs' diff --git a/src/type/patterns/index.ts b/src/type/patterns/index.ts deleted file mode 100644 index 7dbf0a210..000000000 --- a/src/type/patterns/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './patterns' diff --git a/src/type/patterns/patterns.ts b/src/type/patterns/patterns.mts similarity index 100% rename from src/type/patterns/patterns.ts rename to src/type/patterns/patterns.mts diff --git a/src/type/pick/index.mts b/src/type/pick/index.mts new file mode 100644 index 000000000..16976349a --- /dev/null +++ b/src/type/pick/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './pick.mjs' diff --git a/src/type/pick/index.ts b/src/type/pick/index.ts deleted file mode 100644 index 9af323051..000000000 --- a/src/type/pick/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './pick' diff --git a/src/type/pick/pick.ts b/src/type/pick/pick.mts similarity index 90% rename from src/type/pick/pick.ts rename to src/type/pick/pick.mts index 8c34c033d..502abb6aa 100644 --- a/src/type/pick/pick.ts +++ b/src/type/pick/pick.mts @@ -26,17 +26,17 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import type { TupleToUnion, Evaluate } from '../helpers/index' -import { type TRecursive } from '../recursive/index' -import { type TIntersect, Intersect } from '../intersect/index' -import { type TUnion, Union } from '../union/index' -import { type TObject, type TProperties, Object } from '../object/index' -import { IndexedKeyResolve } from '../indexed/index' -import { Discard } from '../discard/index' -import { TransformKind } from '../symbols/index' -import { CloneType } from '../clone/type' -import { TIntersect as IsIntersectType, TUnion as IsUnionType, TObject as IsObjectType, TSchema as IsSchemaType } from '../guard/type' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { TupleToUnion, Evaluate } from '../helpers/index.mjs' +import { type TRecursive } from '../recursive/index.mjs' +import { type TIntersect, Intersect } from '../intersect/index.mjs' +import { type TUnion, Union } from '../union/index.mjs' +import { type TObject, type TProperties, Object } from '../object/index.mjs' +import { IndexedKeyResolve } from '../indexed/index.mjs' +import { Discard } from '../discard/index.mjs' +import { TransformKind } from '../symbols/index.mjs' +import { CloneType } from '../clone/type.mjs' +import { TIntersect as IsIntersectType, TUnion as IsUnionType, TObject as IsObjectType, TSchema as IsSchemaType } from '../guard/type.mjs' // ------------------------------------------------------------------ // FromIntersect diff --git a/src/type/promise/index.mts b/src/type/promise/index.mts new file mode 100644 index 000000000..d10213ae2 --- /dev/null +++ b/src/type/promise/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './promise.mjs' diff --git a/src/type/promise/index.ts b/src/type/promise/index.ts deleted file mode 100644 index 55150952e..000000000 --- a/src/type/promise/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './promise' diff --git a/src/type/promise/promise.ts b/src/type/promise/promise.mts similarity index 90% rename from src/type/promise/promise.ts rename to src/type/promise/promise.mts index 5ee1d225f..30c8804f4 100644 --- a/src/type/promise/promise.ts +++ b/src/type/promise/promise.mts @@ -26,10 +26,10 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import type { Static } from '../static/index' -import { Kind } from '../symbols/index' -import { CloneType } from '../clone/type' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { Static } from '../static/index.mjs' +import { Kind } from '../symbols/index.mjs' +import { CloneType } from '../clone/type.mjs' // ------------------------------------------------------------------ // TPromise diff --git a/src/type/readonly-optional/index.mts b/src/type/readonly-optional/index.mts new file mode 100644 index 000000000..9dc47bf63 --- /dev/null +++ b/src/type/readonly-optional/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './readonly-optional.mjs' diff --git a/src/type/readonly-optional/index.ts b/src/type/readonly-optional/index.ts deleted file mode 100644 index 3e44a84c0..000000000 --- a/src/type/readonly-optional/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './readonly-optional' diff --git a/src/type/readonly-optional/readonly-optional.ts b/src/type/readonly-optional/readonly-optional.mts similarity index 90% rename from src/type/readonly-optional/readonly-optional.ts rename to src/type/readonly-optional/readonly-optional.mts index 4f1ce9e8b..a299366da 100644 --- a/src/type/readonly-optional/readonly-optional.ts +++ b/src/type/readonly-optional/readonly-optional.mts @@ -26,9 +26,9 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema } from '../schema/index' -import { type TReadonly, Readonly } from '../readonly/index' -import { type TOptional, Optional } from '../optional/index' +import type { TSchema } from '../schema/index.mjs' +import { type TReadonly, Readonly } from '../readonly/index.mjs' +import { type TOptional, Optional } from '../optional/index.mjs' // ------------------------------------------------------------------ // TReadonlyOptional diff --git a/src/type/readonly/index.mts b/src/type/readonly/index.mts new file mode 100644 index 000000000..8502f9a0e --- /dev/null +++ b/src/type/readonly/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './readonly.mjs' diff --git a/src/type/readonly/index.ts b/src/type/readonly/index.ts deleted file mode 100644 index ef48e5346..000000000 --- a/src/type/readonly/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './readonly' diff --git a/src/type/readonly/readonly.ts b/src/type/readonly/readonly.mts similarity index 92% rename from src/type/readonly/readonly.ts rename to src/type/readonly/readonly.mts index b925a5a84..6f29c83a0 100644 --- a/src/type/readonly/readonly.ts +++ b/src/type/readonly/readonly.mts @@ -26,9 +26,9 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema } from '../schema/index' -import { ReadonlyKind } from '../symbols/index' -import { CloneType } from '../clone/type' +import type { TSchema } from '../schema/index.mjs' +import { ReadonlyKind } from '../symbols/index.mjs' +import { CloneType } from '../clone/type.mjs' // ------------------------------------------------------------------ // TReadonly diff --git a/src/type/record/index.mts b/src/type/record/index.mts new file mode 100644 index 000000000..b77a72a6a --- /dev/null +++ b/src/type/record/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './record.mjs' diff --git a/src/type/record/index.ts b/src/type/record/index.ts deleted file mode 100644 index 10eb1ceb9..000000000 --- a/src/type/record/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './record' diff --git a/src/type/record/record.ts b/src/type/record/record.mts similarity index 90% rename from src/type/record/record.ts rename to src/type/record/record.mts index ab543c227..4bf09267f 100644 --- a/src/type/record/record.ts +++ b/src/type/record/record.mts @@ -26,25 +26,25 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema } from '../schema/index' -import type { Static } from '../static/index' -import type { Evaluate, Ensure, Assert } from '../helpers/index' -import { type TObject, type TProperties, type TAdditionalProperties, type ObjectOptions, Object } from '../object/index' -import { type TLiteral, TLiteralValue } from '../literal/index' -import { type TNever, Never } from '../never/index' -import { type TUnion, Union } from '../union/index' -import { type TString } from '../string/index' -import { type TInteger } from '../integer/index' -import { type TNumber } from '../number/index' -import { type TEnum } from '../enum/index' +import type { TSchema } from '../schema/index.mjs' +import type { Static } from '../static/index.mjs' +import type { Evaluate, Ensure, Assert } from '../helpers/index.mjs' +import { type TObject, type TProperties, type TAdditionalProperties, type ObjectOptions, Object } from '../object/index.mjs' +import { type TLiteral, TLiteralValue } from '../literal/index.mjs' +import { type TNever, Never } from '../never/index.mjs' +import { type TUnion, Union } from '../union/index.mjs' +import { type TString } from '../string/index.mjs' +import { type TInteger } from '../integer/index.mjs' +import { type TNumber } from '../number/index.mjs' +import { type TEnum } from '../enum/index.mjs' -import { TTemplateLiteral, IsTemplateLiteralFinite, TemplateLiteralParseExact } from '../template-literal/index' -import { PatternStringExact, PatternNumberExact } from '../patterns/index' -import { IndexedKeyResolve } from '../indexed/index' -import { Kind, Hint } from '../symbols/index' -import { CloneType } from '../clone/type' -import { IsUndefined } from '../guard/value' -import { TUnion as IsUnionType, TTemplateLiteral as IsTemplateLiteralType, TLiteral as IsLiteralType, TString as IsStringType, TInteger as IsIntegerType, TNumber as IsNumberType } from '../guard/type' +import { TTemplateLiteral, IsTemplateLiteralFinite, TemplateLiteralParseExact } from '../template-literal/index.mjs' +import { PatternStringExact, PatternNumberExact } from '../patterns/index.mjs' +import { IndexedKeyResolve } from '../indexed/index.mjs' +import { Kind, Hint } from '../symbols/index.mjs' +import { CloneType } from '../clone/type.mjs' +import { IsUndefined } from '../guard/value.mjs' +import { TUnion as IsUnionType, TTemplateLiteral as IsTemplateLiteralType, TLiteral as IsLiteralType, TString as IsStringType, TInteger as IsIntegerType, TNumber as IsNumberType } from '../guard/type.mjs' // ------------------------------------------------------------------ // FromPattern | FromKeys diff --git a/src/type/recursive/index.mts b/src/type/recursive/index.mts new file mode 100644 index 000000000..742f73899 --- /dev/null +++ b/src/type/recursive/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './recursive.mjs' diff --git a/src/type/recursive/index.ts b/src/type/recursive/index.ts deleted file mode 100644 index 9bb19d9f4..000000000 --- a/src/type/recursive/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './recursive' diff --git a/src/type/recursive/recursive.ts b/src/type/recursive/recursive.mts similarity index 91% rename from src/type/recursive/recursive.ts rename to src/type/recursive/recursive.mts index eda0ef279..86b765ae3 100644 --- a/src/type/recursive/recursive.ts +++ b/src/type/recursive/recursive.mts @@ -26,11 +26,11 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import { CloneType } from '../clone/type' -import { IsUndefined } from '../guard/value' -import { Kind, Hint } from '../symbols/index' -import { Static } from '../static/index' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import { CloneType } from '../clone/type.mjs' +import { IsUndefined } from '../guard/value.mjs' +import { Kind, Hint } from '../symbols/index.mjs' +import { Static } from '../static/index.mjs' // ------------------------------------------------------------------ // TThis diff --git a/src/type/any/index.ts b/src/type/ref/index.mts similarity index 98% rename from src/type/any/index.ts rename to src/type/ref/index.mts index 29688e122..aeae29d62 100644 --- a/src/type/any/index.ts +++ b/src/type/ref/index.mts @@ -26,4 +26,4 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -export * from './any' +export * from './ref.mjs' diff --git a/src/type/ref/index.ts b/src/type/ref/index.ts deleted file mode 100644 index 1db9fa4e0..000000000 --- a/src/type/ref/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './ref' diff --git a/src/type/ref/ref.ts b/src/type/ref/ref.mts similarity index 91% rename from src/type/ref/ref.ts rename to src/type/ref/ref.mts index 8aacc2381..685d69d3b 100644 --- a/src/type/ref/ref.ts +++ b/src/type/ref/ref.mts @@ -26,10 +26,10 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import type { Static } from '../static/index' -import { Kind } from '../symbols/index' -import { IsString, IsUndefined } from '../guard/value' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { Static } from '../static/index.mjs' +import { Kind } from '../symbols/index.mjs' +import { IsString, IsUndefined } from '../guard/value.mjs' // ------------------------------------------------------------------ // TRef diff --git a/src/type/regexp/index.mts b/src/type/regexp/index.mts new file mode 100644 index 000000000..6f2b48081 --- /dev/null +++ b/src/type/regexp/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './regexp.mjs' diff --git a/src/type/regexp/index.ts b/src/type/regexp/index.ts deleted file mode 100644 index 00fab30b4..000000000 --- a/src/type/regexp/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './regexp' diff --git a/src/type/regexp/regexp.ts b/src/type/regexp/regexp.mts similarity index 91% rename from src/type/regexp/regexp.ts rename to src/type/regexp/regexp.mts index 7db782682..73a4ba4d1 100644 --- a/src/type/regexp/regexp.ts +++ b/src/type/regexp/regexp.mts @@ -26,10 +26,10 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { SchemaOptions } from '../schema/index' -import type { TString } from '../string/index' -import { IsString } from '../guard/value' -import { Kind } from '../symbols/index' +import type { SchemaOptions } from '../schema/index.mjs' +import type { TString } from '../string/index.mjs' +import { IsString } from '../guard/value.mjs' +import { Kind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // TRegExp diff --git a/src/type/registry/format.ts b/src/type/registry/format.mts similarity index 100% rename from src/type/registry/format.ts rename to src/type/registry/format.mts diff --git a/src/type/registry/index.mts b/src/type/registry/index.mts new file mode 100644 index 000000000..9e68aee7b --- /dev/null +++ b/src/type/registry/index.mts @@ -0,0 +1,30 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * as FormatRegistry from './format.mjs' +export * as TypeRegistry from './type.mjs' diff --git a/src/type/registry/index.ts b/src/type/registry/index.ts deleted file mode 100644 index a0fb0e043..000000000 --- a/src/type/registry/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * as FormatRegistry from './format' -export * as TypeRegistry from './type' diff --git a/src/type/registry/type.ts b/src/type/registry/type.mts similarity index 100% rename from src/type/registry/type.ts rename to src/type/registry/type.mts diff --git a/src/type/required/index.mts b/src/type/required/index.mts new file mode 100644 index 000000000..32a33176c --- /dev/null +++ b/src/type/required/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './required.mjs' diff --git a/src/type/required/index.ts b/src/type/required/index.ts deleted file mode 100644 index 74bb43b44..000000000 --- a/src/type/required/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './required' diff --git a/src/type/required/required.ts b/src/type/required/required.mts similarity index 87% rename from src/type/required/required.ts rename to src/type/required/required.mts index 761f0096e..1062b06cc 100644 --- a/src/type/required/required.ts +++ b/src/type/required/required.mts @@ -26,20 +26,20 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import type { Evaluate } from '../helpers/index' -import { type TReadonlyOptional } from '../readonly-optional/index' -import { type TOptional } from '../optional/index' -import { type TReadonly } from '../readonly/index' -import { type TRecursive } from '../recursive/index' -import { type TIntersect, Intersect } from '../intersect/index' -import { type TUnion, Union } from '../union/index' -import { type TObject, type TProperties, Object } from '../object/index' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { Evaluate } from '../helpers/index.mjs' +import { type TReadonlyOptional } from '../readonly-optional/index.mjs' +import { type TOptional } from '../optional/index.mjs' +import { type TReadonly } from '../readonly/index.mjs' +import { type TRecursive } from '../recursive/index.mjs' +import { type TIntersect, Intersect } from '../intersect/index.mjs' +import { type TUnion, Union } from '../union/index.mjs' +import { type TObject, type TProperties, Object } from '../object/index.mjs' -import { OptionalKind, TransformKind } from '../symbols/index' -import { CloneType } from '../clone/type' -import { Discard } from '../discard/index' -import { TIntersect as IsIntersectType, TUnion as IsUnionType, TObject as IsObjectType } from '../guard/type' +import { OptionalKind, TransformKind } from '../symbols/index.mjs' +import { CloneType } from '../clone/type.mjs' +import { Discard } from '../discard/index.mjs' +import { TIntersect as IsIntersectType, TUnion as IsUnionType, TObject as IsObjectType } from '../guard/type.mjs' // ------------------------------------------------------------------ // FromIntersect diff --git a/src/type/rest/index.mts b/src/type/rest/index.mts new file mode 100644 index 000000000..a8711f6dc --- /dev/null +++ b/src/type/rest/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './rest.mjs' diff --git a/src/type/rest/index.ts b/src/type/rest/index.ts deleted file mode 100644 index b1442f480..000000000 --- a/src/type/rest/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './rest' diff --git a/src/type/rest/rest.ts b/src/type/rest/rest.mts similarity index 88% rename from src/type/rest/rest.ts rename to src/type/rest/rest.mts index 6582bf84b..c56d0c361 100644 --- a/src/type/rest/rest.ts +++ b/src/type/rest/rest.mts @@ -26,12 +26,12 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema } from '../schema/index' -import type { TIntersect } from '../intersect/index' -import type { TUnion } from '../union/index' -import type { TTuple } from '../tuple/index' -import { CloneRest } from '../clone/type' -import { TIntersect as IsIntersectType, TUnion as IsUnionType, TTuple as IsTupleType } from '../guard/type' +import type { TSchema } from '../schema/index.mjs' +import type { TIntersect } from '../intersect/index.mjs' +import type { TUnion } from '../union/index.mjs' +import type { TTuple } from '../tuple/index.mjs' +import { CloneRest } from '../clone/type.mjs' +import { TIntersect as IsIntersectType, TUnion as IsUnionType, TTuple as IsTupleType } from '../guard/type.mjs' // ------------------------------------------------------------------ // RestResolve diff --git a/src/type/return-type/index.mts b/src/type/return-type/index.mts new file mode 100644 index 000000000..4786b81b5 --- /dev/null +++ b/src/type/return-type/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './return-type.mjs' diff --git a/src/type/return-type/index.ts b/src/type/return-type/index.ts deleted file mode 100644 index 610d3adc0..000000000 --- a/src/type/return-type/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './return-type' diff --git a/src/type/return-type/return-type.ts b/src/type/return-type/return-type.mts similarity index 91% rename from src/type/return-type/return-type.ts rename to src/type/return-type/return-type.mts index 0df3d4bbf..b0c549620 100644 --- a/src/type/return-type/return-type.ts +++ b/src/type/return-type/return-type.mts @@ -26,9 +26,9 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { SchemaOptions } from '../schema/index' -import type { TFunction } from '../function/index' -import { CloneType } from '../clone/type' +import type { SchemaOptions } from '../schema/index.mjs' +import type { TFunction } from '../function/index.mjs' +import { CloneType } from '../clone/type.mjs' // ------------------------------------------------------------------ // TReturnType diff --git a/src/type/schema/anyschema.ts b/src/type/schema/anyschema.mts similarity index 57% rename from src/type/schema/anyschema.ts rename to src/type/schema/anyschema.mts index 8f646e823..8e27f16de 100644 --- a/src/type/schema/anyschema.ts +++ b/src/type/schema/anyschema.mts @@ -29,37 +29,37 @@ THE SOFTWARE. // ------------------------------------------------------------------ // Type: Module // ------------------------------------------------------------------ -import type { TAny } from '../any/index' -import type { TArray } from '../array/index' -import type { TAsyncIterator } from '../async-iterator/index' -import type { TBigInt } from '../bigint/index' -import type { TBoolean } from '../boolean/index' -import type { TConstructor } from '../constructor/index' -import type { TDate } from '../date/index' -import type { TEnum } from '../enum/index' -import type { TFunction } from '../function/index' -import type { TInteger } from '../integer/index' -import type { TIntersect } from '../intersect/index' -import type { TIterator } from '../iterator/index' -import type { TLiteral } from '../literal/index' -import type { TNot } from '../not/index' -import type { TNull } from '../null/index' -import type { TNumber } from '../number/index' -import type { TObject } from '../object/index' -import type { TPromise } from '../promise/index' -import type { TRecord } from '../record/index' -import type { TThis } from '../recursive/index' -import type { TRef } from '../ref/index' -import type { TString } from '../string/index' -import type { TSymbol } from '../symbol/index' -import type { TTemplateLiteral } from '../template-literal/index' -import type { TTuple } from '../tuple/index' -import type { TUint8Array } from '../uint8array/index' -import type { TUndefined } from '../undefined/index' -import type { TUnion } from '../union/index' -import type { TUnknown } from '../unknown/index' -import type { TVoid } from '../void/index' -import type { TSchema } from './schema' +import type { TAny } from '../any/index.mjs' +import type { TArray } from '../array/index.mjs' +import type { TAsyncIterator } from '../async-iterator/index.mjs' +import type { TBigInt } from '../bigint/index.mjs' +import type { TBoolean } from '../boolean/index.mjs' +import type { TConstructor } from '../constructor/index.mjs' +import type { TDate } from '../date/index.mjs' +import type { TEnum } from '../enum/index.mjs' +import type { TFunction } from '../function/index.mjs' +import type { TInteger } from '../integer/index.mjs' +import type { TIntersect } from '../intersect/index.mjs' +import type { TIterator } from '../iterator/index.mjs' +import type { TLiteral } from '../literal/index.mjs' +import type { TNot } from '../not/index.mjs' +import type { TNull } from '../null/index.mjs' +import type { TNumber } from '../number/index.mjs' +import type { TObject } from '../object/index.mjs' +import type { TPromise } from '../promise/index.mjs' +import type { TRecord } from '../record/index.mjs' +import type { TThis } from '../recursive/index.mjs' +import type { TRef } from '../ref/index.mjs' +import type { TString } from '../string/index.mjs' +import type { TSymbol } from '../symbol/index.mjs' +import type { TTemplateLiteral } from '../template-literal/index.mjs' +import type { TTuple } from '../tuple/index.mjs' +import type { TUint8Array } from '../uint8array/index.mjs' +import type { TUndefined } from '../undefined/index.mjs' +import type { TUnion } from '../union/index.mjs' +import type { TUnknown } from '../unknown/index.mjs' +import type { TVoid } from '../void/index.mjs' +import type { TSchema } from './schema.mjs' // ------------------------------------------------------------------ // TAnySchema diff --git a/src/type/schema/index.mts b/src/type/schema/index.mts new file mode 100644 index 000000000..059aa51b6 --- /dev/null +++ b/src/type/schema/index.mts @@ -0,0 +1,30 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './anyschema.mjs' +export * from './schema.mjs' diff --git a/src/type/schema/index.ts b/src/type/schema/index.ts deleted file mode 100644 index bfd714bb5..000000000 --- a/src/type/schema/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './anyschema' -export * from './schema' diff --git a/src/type/schema/schema.ts b/src/type/schema/schema.mts similarity index 99% rename from src/type/schema/schema.ts rename to src/type/schema/schema.mts index 45e276f81..88ea80f27 100644 --- a/src/type/schema/schema.ts +++ b/src/type/schema/schema.mts @@ -26,7 +26,7 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { Kind, Hint, ReadonlyKind, OptionalKind } from '../symbols/index' +import { Kind, Hint, ReadonlyKind, OptionalKind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // TSchema diff --git a/src/type/static/index.mts b/src/type/static/index.mts new file mode 100644 index 000000000..326ccf6ae --- /dev/null +++ b/src/type/static/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './static.mjs' diff --git a/src/type/static/index.ts b/src/type/static/index.ts deleted file mode 100644 index 8f4f0c9dc..000000000 --- a/src/type/static/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './static' diff --git a/src/type/static/static.ts b/src/type/static/static.mts similarity index 77% rename from src/type/static/static.ts rename to src/type/static/static.mts index 55c3b9703..c63f0b3fd 100644 --- a/src/type/static/static.ts +++ b/src/type/static/static.mts @@ -26,27 +26,27 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { Evaluate } from '../helpers/index' -import type { TOptional } from '../optional/index' -import type { TReadonly } from '../readonly/index' -import type { TArray } from '../array/index' -import type { TAsyncIterator } from '../async-iterator/index' -import type { TConstructor } from '../constructor/index' -import type { TEnum } from '../enum/index' -import type { TFunction } from '../function/index' -import type { TIntersect } from '../intersect/index' -import type { TIterator } from '../iterator/index' -import type { TNot } from '../not/index' -import type { TObject, TProperties } from '../object/index' -import type { TPromise } from '../promise/index' -import type { TRecursive } from '../recursive/index' -import type { TRecord } from '../record/index' -import type { TRef } from '../ref/index' -import type { TTuple } from '../tuple/index' -import type { TUnion } from '../union/index' -import type { TUnsafe } from '../unsafe/index' -import type { TSchema } from '../schema/index' -import type { TTransform } from '../transform/index' +import type { Evaluate } from '../helpers/index.mjs' +import type { TOptional } from '../optional/index.mjs' +import type { TReadonly } from '../readonly/index.mjs' +import type { TArray } from '../array/index.mjs' +import type { TAsyncIterator } from '../async-iterator/index.mjs' +import type { TConstructor } from '../constructor/index.mjs' +import type { TEnum } from '../enum/index.mjs' +import type { TFunction } from '../function/index.mjs' +import type { TIntersect } from '../intersect/index.mjs' +import type { TIterator } from '../iterator/index.mjs' +import type { TNot } from '../not/index.mjs' +import type { TObject, TProperties } from '../object/index.mjs' +import type { TPromise } from '../promise/index.mjs' +import type { TRecursive } from '../recursive/index.mjs' +import type { TRecord } from '../record/index.mjs' +import type { TRef } from '../ref/index.mjs' +import type { TTuple } from '../tuple/index.mjs' +import type { TUnion } from '../union/index.mjs' +import type { TUnsafe } from '../unsafe/index.mjs' +import type { TSchema } from '../schema/index.mjs' +import type { TTransform } from '../transform/index.mjs' // ------------------------------------------------------------------ // DecodeType diff --git a/src/type/strict/index.mts b/src/type/strict/index.mts new file mode 100644 index 000000000..822dc3fae --- /dev/null +++ b/src/type/strict/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './strict.mjs' diff --git a/src/type/strict/index.ts b/src/type/strict/index.ts deleted file mode 100644 index caf80eab1..000000000 --- a/src/type/strict/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './strict' diff --git a/src/type/strict/strict.ts b/src/type/strict/strict.mts similarity index 96% rename from src/type/strict/strict.ts rename to src/type/strict/strict.mts index 9e232424e..fc56acb14 100644 --- a/src/type/strict/strict.ts +++ b/src/type/strict/strict.mts @@ -26,7 +26,7 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema } from '../schema/index' +import type { TSchema } from '../schema/index.mjs' /** `[Json]` Omits compositing symbols from this schema */ export function Strict(schema: T): T { diff --git a/src/type/string/index.mts b/src/type/string/index.mts new file mode 100644 index 000000000..91e96ebe2 --- /dev/null +++ b/src/type/string/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './string.mjs' diff --git a/src/type/string/index.ts b/src/type/string/index.ts deleted file mode 100644 index 1c188b4fd..000000000 --- a/src/type/string/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './string' diff --git a/src/type/string/string.ts b/src/type/string/string.mts similarity index 96% rename from src/type/string/string.ts rename to src/type/string/string.mts index 5bcda7176..6096d4256 100644 --- a/src/type/string/string.ts +++ b/src/type/string/string.mts @@ -26,8 +26,8 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { TSchema, SchemaOptions } from '../schema/index' -import { Kind } from '../symbols/index' +import { TSchema, SchemaOptions } from '../schema/index.mjs' +import { Kind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // TString diff --git a/src/type/symbol/index.mts b/src/type/symbol/index.mts new file mode 100644 index 000000000..ce257f78d --- /dev/null +++ b/src/type/symbol/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './symbol.mjs' diff --git a/src/type/symbol/index.ts b/src/type/symbol/index.ts deleted file mode 100644 index abd306265..000000000 --- a/src/type/symbol/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './symbol' diff --git a/src/type/symbol/symbol.ts b/src/type/symbol/symbol.mts similarity index 94% rename from src/type/symbol/symbol.ts rename to src/type/symbol/symbol.mts index f277df406..32f454109 100644 --- a/src/type/symbol/symbol.ts +++ b/src/type/symbol/symbol.mts @@ -26,8 +26,8 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { TSchema, SchemaOptions } from '../schema/index' -import { Kind } from '../symbols/index' +import { TSchema, SchemaOptions } from '../schema/index.mjs' +import { Kind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // TSymbol diff --git a/src/type/symbols/index.mts b/src/type/symbols/index.mts new file mode 100644 index 000000000..d7bf46a19 --- /dev/null +++ b/src/type/symbols/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './symbols.mjs' diff --git a/src/type/symbols/index.ts b/src/type/symbols/index.ts deleted file mode 100644 index bac16a322..000000000 --- a/src/type/symbols/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './symbols' diff --git a/src/type/symbols/symbols.ts b/src/type/symbols/symbols.mts similarity index 100% rename from src/type/symbols/symbols.ts rename to src/type/symbols/symbols.mts diff --git a/src/type/template-literal/finite.ts b/src/type/template-literal/finite.mts similarity index 89% rename from src/type/template-literal/finite.ts rename to src/type/template-literal/finite.mts index 5e01bb08a..e44bca6e0 100644 --- a/src/type/template-literal/finite.ts +++ b/src/type/template-literal/finite.mts @@ -26,15 +26,15 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TTemplateLiteral, TTemplateLiteralKind } from '../template-literal/index' -import type { TUnion } from '../union/index' -import type { TString } from '../string/index' -import type { TBoolean } from '../boolean/index' -import type { TNumber } from '../number/index' -import type { TInteger } from '../integer/index' -import type { TBigInt } from '../bigint/index' -import type { TLiteral } from '../literal/index' -import type { Expression } from './parser' +import type { TTemplateLiteral, TTemplateLiteralKind } from './index.mjs' +import type { TUnion } from '../union/index.mjs' +import type { TString } from '../string/index.mjs' +import type { TBoolean } from '../boolean/index.mjs' +import type { TNumber } from '../number/index.mjs' +import type { TInteger } from '../integer/index.mjs' +import type { TBigInt } from '../bigint/index.mjs' +import type { TLiteral } from '../literal/index.mjs' +import type { Expression } from './parser.mjs' // ------------------------------------------------------------------ // TemplateLiteralFiniteError diff --git a/src/type/template-literal/generate.ts b/src/type/template-literal/generate.mts similarity index 97% rename from src/type/template-literal/generate.ts rename to src/type/template-literal/generate.mts index 8993de63b..c4883979e 100644 --- a/src/type/template-literal/generate.ts +++ b/src/type/template-literal/generate.mts @@ -26,10 +26,10 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TTemplateLiteral, TTemplateLiteralKind } from './index' -import type { TLiteral, TLiteralValue } from '../literal/index' -import type { Expression, ExpressionAnd, ExpressionOr, ExpressionConst } from './parser' -import type { TUnion } from '../union/index' +import type { TTemplateLiteral, TTemplateLiteralKind } from './index.mjs' +import type { TLiteral, TLiteralValue } from '../literal/index.mjs' +import type { Expression, ExpressionAnd, ExpressionOr, ExpressionConst } from './parser.mjs' +import type { TUnion } from '../union/index.mjs' // ------------------------------------------------------------------ // StringReducers diff --git a/src/type/template-literal/index.mts b/src/type/template-literal/index.mts new file mode 100644 index 000000000..950cd79f3 --- /dev/null +++ b/src/type/template-literal/index.mts @@ -0,0 +1,35 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './finite.mjs' +export * from './generate.mjs' +export * from './syntax.mjs' +export * from './parser.mjs' +export * from './pattern.mjs' +export * from './union.mjs' +export * from './template-literal.mjs' diff --git a/src/type/template-literal/index.ts b/src/type/template-literal/index.ts deleted file mode 100644 index 95f5d55aa..000000000 --- a/src/type/template-literal/index.ts +++ /dev/null @@ -1,35 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './finite' -export * from './generate' -export * from './syntax' -export * from './parser' -export * from './pattern' -export * from './union' -export * from './template-literal' diff --git a/src/type/template-literal/parser.ts b/src/type/template-literal/parser.mts similarity index 100% rename from src/type/template-literal/parser.ts rename to src/type/template-literal/parser.mts diff --git a/src/type/template-literal/pattern.ts b/src/type/template-literal/pattern.mts similarity index 93% rename from src/type/template-literal/pattern.ts rename to src/type/template-literal/pattern.mts index b75599011..70ee91063 100644 --- a/src/type/template-literal/pattern.ts +++ b/src/type/template-literal/pattern.mts @@ -26,10 +26,10 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema } from '../schema/index' -import type { TTemplateLiteralKind } from '../template-literal/index' -import { PatternNumber, PatternString, PatternBoolean } from '../patterns/index' -import { Kind } from '../symbols/index' +import type { TSchema } from '../schema/index.mjs' +import type { TTemplateLiteralKind } from './index.mjs' +import { PatternNumber, PatternString, PatternBoolean } from '../patterns/index.mjs' +import { Kind } from '../symbols/index.mjs' import { TTemplateLiteral as IsTemplateLiteralType, TUnion as IsUnionType, @@ -39,7 +39,7 @@ import { TString as IsStringType, TLiteral as IsLiteralType, TBoolean as IsBooleanType, -} from '../guard/type' +} from '../guard/type.mjs' // ------------------------------------------------------------------ // TemplateLiteralPatternError diff --git a/src/type/template-literal/syntax.ts b/src/type/template-literal/syntax.mts similarity index 88% rename from src/type/template-literal/syntax.ts rename to src/type/template-literal/syntax.mts index 63261505a..3105b3fd9 100644 --- a/src/type/template-literal/syntax.ts +++ b/src/type/template-literal/syntax.mts @@ -26,15 +26,15 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { Ensure, Assert, Trim } from '../helpers/index' -import type { TTemplateLiteralKind, TTemplateLiteral } from '../template-literal/index' -import { type TLiteral, Literal } from '../literal/index' -import { type TBoolean, Boolean } from '../boolean/index' -import { type TBigInt, BigInt } from '../bigint/index' -import { type TNumber, Number } from '../number/index' -import { type TString, String } from '../string/index' -import { Union, UnionResolve } from '../union/index' -import { Never } from '../never/index' +import type { Ensure, Assert, Trim } from '../helpers/index.mjs' +import type { TTemplateLiteralKind, TTemplateLiteral } from './index.mjs' +import { type TLiteral, Literal } from '../literal/index.mjs' +import { type TBoolean, Boolean } from '../boolean/index.mjs' +import { type TBigInt, BigInt } from '../bigint/index.mjs' +import { type TNumber, Number } from '../number/index.mjs' +import { type TString, String } from '../string/index.mjs' +import { Union, UnionResolve } from '../union/index.mjs' +import { Never } from '../never/index.mjs' // ------------------------------------------------------------------ // SyntaxParsers diff --git a/src/type/template-literal/template-literal.ts b/src/type/template-literal/template-literal.mts similarity index 81% rename from src/type/template-literal/template-literal.ts rename to src/type/template-literal/template-literal.mts index 5599cc516..2ee537566 100644 --- a/src/type/template-literal/template-literal.ts +++ b/src/type/template-literal/template-literal.mts @@ -26,23 +26,23 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import type { Assert } from '../helpers/index' -import type { TUnion } from '../union/index' -import type { TLiteral } from '../literal/index' -import type { TInteger } from '../integer/index' -import type { TNumber } from '../number/index' -import type { TBigInt } from '../bigint/index' -import type { TString } from '../string/index' -import type { TBoolean } from '../boolean/index' -import type { TNever } from '../never/index' -import type { Static } from '../static/index' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { Assert } from '../helpers/index.mjs' +import type { TUnion } from '../union/index.mjs' +import type { TLiteral } from '../literal/index.mjs' +import type { TInteger } from '../integer/index.mjs' +import type { TNumber } from '../number/index.mjs' +import type { TBigInt } from '../bigint/index.mjs' +import type { TString } from '../string/index.mjs' +import type { TBoolean } from '../boolean/index.mjs' +import type { TNever } from '../never/index.mjs' +import type { Static } from '../static/index.mjs' -import { TemplateLiteralPattern } from './pattern' -import { TemplateLiteralSyntax } from './syntax' -import { EmptyString } from '../helpers/index' -import { IsString } from '../guard/value' -import { Kind } from '../symbols/index' +import { TemplateLiteralPattern } from './pattern.mjs' +import { TemplateLiteralSyntax } from './syntax.mjs' +import { EmptyString } from '../helpers/index.mjs' +import { IsString } from '../guard/value.mjs' +import { Kind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // TemplateLiteralResolve diff --git a/src/type/template-literal/union.ts b/src/type/template-literal/union.mts similarity index 80% rename from src/type/template-literal/union.ts rename to src/type/template-literal/union.mts index 58f42bcb1..b58922b28 100644 --- a/src/type/template-literal/union.ts +++ b/src/type/template-literal/union.mts @@ -26,14 +26,14 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TTemplateLiteral } from './template-literal' -import { type TUnion, Union } from '../union/index' -import { type TLiteral, Literal } from '../literal/index' -import { type TString, String } from '../string/index' -import { type TNever } from '../never/index' -import { TemplateLiteralGenerate } from './generate' -import { TemplateLiteralParseExact } from './parser' -import { IsTemplateLiteralFinite } from './finite' +import type { TTemplateLiteral } from './template-literal.mjs' +import { type TUnion, Union } from '../union/index.mjs' +import { type TLiteral, Literal } from '../literal/index.mjs' +import { type TString, String } from '../string/index.mjs' +import { type TNever } from '../never/index.mjs' +import { TemplateLiteralGenerate } from './generate.mjs' +import { TemplateLiteralParseExact } from './parser.mjs' +import { IsTemplateLiteralFinite } from './finite.mjs' // ------------------------------------------------------------------ // TemplateLiteralToUnion diff --git a/src/type/transform/index.mts b/src/type/transform/index.mts new file mode 100644 index 000000000..eef047bac --- /dev/null +++ b/src/type/transform/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './transform.mjs' diff --git a/src/type/transform/index.ts b/src/type/transform/index.ts deleted file mode 100644 index 4e6ab0218..000000000 --- a/src/type/transform/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './transform' diff --git a/src/type/transform/transform.ts b/src/type/transform/transform.mts similarity index 93% rename from src/type/transform/transform.ts rename to src/type/transform/transform.mts index d7b981192..74860ca3b 100644 --- a/src/type/transform/transform.ts +++ b/src/type/transform/transform.mts @@ -26,12 +26,12 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema } from '../schema/index' -import type { Static, StaticDecode } from '../static' +import type { TSchema } from '../schema/index.mjs' +import type { Static, StaticDecode } from '../static/index.mjs' -import { TTransform as IsTransform } from '../guard/type' -import { CloneType } from '../clone/type' -import { TransformKind } from '../symbols/index' +import { TTransform as IsTransform } from '../guard/type.mjs' +import { CloneType } from '../clone/type.mjs' +import { TransformKind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // TransformBuilders diff --git a/src/type/tuple/index.mts b/src/type/tuple/index.mts new file mode 100644 index 000000000..72be3691a --- /dev/null +++ b/src/type/tuple/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './tuple.mjs' diff --git a/src/type/tuple/index.ts b/src/type/tuple/index.ts deleted file mode 100644 index c1eb788d2..000000000 --- a/src/type/tuple/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './tuple' diff --git a/src/type/tuple/tuple.ts b/src/type/tuple/tuple.mts similarity index 92% rename from src/type/tuple/tuple.ts rename to src/type/tuple/tuple.mts index 1f462cc49..c0dc54453 100644 --- a/src/type/tuple/tuple.ts +++ b/src/type/tuple/tuple.mts @@ -26,10 +26,10 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import type { Static } from '../static/index' -import { CloneRest } from '../clone/type' -import { Kind } from '../symbols/index' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { Static } from '../static/index.mjs' +import { CloneRest } from '../clone/type.mjs' +import { Kind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // TupleResolve diff --git a/src/type/type/index.ts b/src/type/type/index.mts similarity index 92% rename from src/type/type/index.ts rename to src/type/type/index.mts index 081b459d1..ff009db1a 100644 --- a/src/type/type/index.ts +++ b/src/type/type/index.mts @@ -29,13 +29,13 @@ THE SOFTWARE. // ------------------------------------------------------------------ // JsonTypeBuilder // ------------------------------------------------------------------ -export { JsonTypeBuilder } from './json' +export { JsonTypeBuilder } from './json.mjs' // ------------------------------------------------------------------ // JavaScriptTypeBuilder // ------------------------------------------------------------------ -import * as TypeBuilder from './type' -import { JavaScriptTypeBuilder } from './javascript' +import * as TypeBuilder from './type.mjs' +import { JavaScriptTypeBuilder } from './javascript.mjs' /** JavaScript Type Builder with Static Resolution for TypeScript */ const Type = TypeBuilder as InstanceType diff --git a/src/type/type/javascript.ts b/src/type/type/javascript.mts similarity index 88% rename from src/type/type/javascript.ts rename to src/type/type/javascript.mts index b45aeb229..267a76b33 100644 --- a/src/type/type/javascript.ts +++ b/src/type/type/javascript.mts @@ -26,25 +26,25 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { JsonTypeBuilder } from './json' -import { AsyncIterator, type TAsyncIterator } from '../async-iterator/index' -import { Awaited, type TAwaited } from '../awaited/index' -import { BigInt, type TBigInt, type BigIntOptions } from '../bigint/index' -import { Constructor, type TConstructor } from '../constructor/index' -import { ConstructorParameters, type TConstructorParameters } from '../constructor-parameters/index' -import { Date, type TDate, type DateOptions } from '../date/index' -import { Function, type TFunction } from '../function/index' -import { InstanceType, type TInstanceType } from '../instance-type/index' -import { Iterator, type TIterator } from '../iterator/index' -import { Parameters, type TParameters } from '../parameters/index' -import { Promise, type TPromise } from '../promise/index' -import { RegExp, type TRegExp } from '../regexp/index' -import { ReturnType, type TReturnType } from '../return-type/index' -import { type TSchema, type SchemaOptions } from '../schema/index' -import { Symbol, type TSymbol } from '../symbol/index' -import { Uint8Array, type TUint8Array, type Uint8ArrayOptions } from '../uint8array/index' -import { Undefined, type TUndefined } from '../undefined/index' -import { Void, type TVoid } from '../void/index' +import { JsonTypeBuilder } from './json.mjs' +import { AsyncIterator, type TAsyncIterator } from '../async-iterator/index.mjs' +import { Awaited, type TAwaited } from '../awaited/index.mjs' +import { BigInt, type TBigInt, type BigIntOptions } from '../bigint/index.mjs' +import { Constructor, type TConstructor } from '../constructor/index.mjs' +import { ConstructorParameters, type TConstructorParameters } from '../constructor-parameters/index.mjs' +import { Date, type TDate, type DateOptions } from '../date/index.mjs' +import { Function, type TFunction } from '../function/index.mjs' +import { InstanceType, type TInstanceType } from '../instance-type/index.mjs' +import { Iterator, type TIterator } from '../iterator/index.mjs' +import { Parameters, type TParameters } from '../parameters/index.mjs' +import { Promise, type TPromise } from '../promise/index.mjs' +import { RegExp, type TRegExp } from '../regexp/index.mjs' +import { ReturnType, type TReturnType } from '../return-type/index.mjs' +import { type TSchema, type SchemaOptions } from '../schema/index.mjs' +import { Symbol, type TSymbol } from '../symbol/index.mjs' +import { Uint8Array, type TUint8Array, type Uint8ArrayOptions } from '../uint8array/index.mjs' +import { Undefined, type TUndefined } from '../undefined/index.mjs' +import { Void, type TVoid } from '../void/index.mjs' /** JavaScript Type Builder with Static Resolution for TypeScript */ export class JavaScriptTypeBuilder extends JsonTypeBuilder { diff --git a/src/type/type/json.ts b/src/type/type/json.mts similarity index 88% rename from src/type/type/json.ts rename to src/type/type/json.mts index 57fc9d21b..fe8483e7c 100644 --- a/src/type/type/json.ts +++ b/src/type/type/json.mts @@ -26,47 +26,47 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { Any, type TAny } from '../any/index' -import { Array, type TArray, type ArrayOptions } from '../array/index' -import { Boolean, type TBoolean } from '../boolean/index' -import { Composite, type TComposite } from '../composite/index' -import { Const, type TConst } from '../const/index' -import { Deref, type TDeref } from '../deref/index' -import { Enum, type TEnum, type TEnumKey, type TEnumValue } from '../enum/index' -import { Exclude, type TExclude } from '../exclude/index' -import { Extends, type TExtends } from '../extends/index' -import { Extract, type TExtract } from '../extract/index' -import { Index, TIndex, type IndexedKeyResolve } from '../indexed/index' -import { Integer, type IntegerOptions, type TInteger } from '../integer/index' -import { Intersect, type IntersectOptions, type IntersectResolve } from '../intersect/index' -import { Capitalize, Uncapitalize, Lowercase, Uppercase, type TCapitalize, type TUncapitalize, type TLowercase, type TUppercase } from '../intrinsic/index' -import { KeyOf, type TKeyOf } from '../keyof/index' -import { Literal, type TLiteral, type TLiteralValue } from '../literal/index' -import { Never, type TNever } from '../never/index' -import { Not, type TNot } from '../not/index' -import { Null, type TNull } from '../null/index' -import { Number, type TNumber, type NumberOptions } from '../number/index' -import { Object, type TObject, type TProperties, type ObjectOptions } from '../object/index' -import { Omit, type TOmit } from '../omit/index' -import { Optional, type TOptional } from '../optional/index' -import { Partial, type TPartial } from '../partial/index' -import { Pick, type TPick } from '../pick/index' -import { Readonly, type TReadonly } from '../readonly/index' -import { ReadonlyOptional, type TReadonlyOptional } from '../readonly-optional/index' -import { Record, type RecordResolve } from '../record/index' -import { Recursive, type TRecursive, type TThis } from '../recursive/index' -import { Ref, type TRef } from '../ref/index' -import { Required, type TRequired } from '../required/index' -import { Rest, type TRest } from '../rest/index' -import { type TSchema, type SchemaOptions } from '../schema/index' -import { Strict } from '../strict/index' -import { String, type TString, type StringOptions } from '../string/index' -import { TemplateLiteral, type TTemplateLiteral, type TTemplateLiteralKind, type TemplateLiteralSyntax } from '../template-literal/index' -import { Transform, TransformDecodeBuilder } from '../transform/index' -import { Tuple, type TTuple } from '../tuple/index' -import { Union, type UnionResolve } from '../union/index' -import { Unknown, type TUnknown } from '../unknown/index' -import { Unsafe, type TUnsafe, type UnsafeOptions } from '../unsafe/index' +import { Any, type TAny } from '../any/index.mjs' +import { Array, type TArray, type ArrayOptions } from '../array/index.mjs' +import { Boolean, type TBoolean } from '../boolean/index.mjs' +import { Composite, type TComposite } from '../composite/index.mjs' +import { Const, type TConst } from '../const/index.mjs' +import { Deref, type TDeref } from '../deref/index.mjs' +import { Enum, type TEnum, type TEnumKey, type TEnumValue } from '../enum/index.mjs' +import { Exclude, type TExclude } from '../exclude/index.mjs' +import { Extends, type TExtends } from '../extends/index.mjs' +import { Extract, type TExtract } from '../extract/index.mjs' +import { Index, TIndex, type IndexedKeyResolve } from '../indexed/index.mjs' +import { Integer, type IntegerOptions, type TInteger } from '../integer/index.mjs' +import { Intersect, type IntersectOptions, type IntersectResolve } from '../intersect/index.mjs' +import { Capitalize, Uncapitalize, Lowercase, Uppercase, type TCapitalize, type TUncapitalize, type TLowercase, type TUppercase } from '../intrinsic/index.mjs' +import { KeyOf, type TKeyOf } from '../keyof/index.mjs' +import { Literal, type TLiteral, type TLiteralValue } from '../literal/index.mjs' +import { Never, type TNever } from '../never/index.mjs' +import { Not, type TNot } from '../not/index.mjs' +import { Null, type TNull } from '../null/index.mjs' +import { Number, type TNumber, type NumberOptions } from '../number/index.mjs' +import { Object, type TObject, type TProperties, type ObjectOptions } from '../object/index.mjs' +import { Omit, type TOmit } from '../omit/index.mjs' +import { Optional, type TOptional } from '../optional/index.mjs' +import { Partial, type TPartial } from '../partial/index.mjs' +import { Pick, type TPick } from '../pick/index.mjs' +import { Readonly, type TReadonly } from '../readonly/index.mjs' +import { ReadonlyOptional, type TReadonlyOptional } from '../readonly-optional/index.mjs' +import { Record, type RecordResolve } from '../record/index.mjs' +import { Recursive, type TRecursive, type TThis } from '../recursive/index.mjs' +import { Ref, type TRef } from '../ref/index.mjs' +import { Required, type TRequired } from '../required/index.mjs' +import { Rest, type TRest } from '../rest/index.mjs' +import { type TSchema, type SchemaOptions } from '../schema/index.mjs' +import { Strict } from '../strict/index.mjs' +import { String, type TString, type StringOptions } from '../string/index.mjs' +import { TemplateLiteral, type TTemplateLiteral, type TTemplateLiteralKind, type TemplateLiteralSyntax } from '../template-literal/index.mjs' +import { Transform, TransformDecodeBuilder } from '../transform/index.mjs' +import { Tuple, type TTuple } from '../tuple/index.mjs' +import { Union, type UnionResolve } from '../union/index.mjs' +import { Unknown, type TUnknown } from '../unknown/index.mjs' +import { Unsafe, type TUnsafe, type UnsafeOptions } from '../unsafe/index.mjs' /** Json Type Builder with Static Resolution for TypeScript */ export class JsonTypeBuilder { diff --git a/src/type/type/type.mts b/src/type/type/type.mts new file mode 100644 index 000000000..48cae37a3 --- /dev/null +++ b/src/type/type/type.mts @@ -0,0 +1,89 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +// ------------------------------------------------------------------ +// Type: Module +// ------------------------------------------------------------------ +export { Any } from '../any/index.mjs' +export { Array } from '../array/index.mjs' +export { AsyncIterator } from '../async-iterator/index.mjs' +export { Awaited } from '../awaited/index.mjs' +export { BigInt } from '../bigint/index.mjs' +export { Boolean } from '../boolean/index.mjs' +export { Composite } from '../composite/index.mjs' +export { Const } from '../const/index.mjs' +export { Constructor } from '../constructor/index.mjs' +export { ConstructorParameters } from '../constructor-parameters/index.mjs' +export { Date } from '../date/index.mjs' +export { Deref } from '../deref/index.mjs' +export { Enum } from '../enum/index.mjs' +export { Exclude } from '../exclude/index.mjs' +export { Extends } from '../extends/index.mjs' +export { Extract } from '../extract/index.mjs' +export { Function } from '../function/index.mjs' +export { Index } from '../indexed/index.mjs' +export { InstanceType } from '../instance-type/index.mjs' +export { Integer } from '../integer/index.mjs' +export { Intersect } from '../intersect/index.mjs' +export { Capitalize, Uncapitalize, Lowercase, Uppercase } from '../intrinsic/index.mjs' +export { Iterator } from '../iterator/index.mjs' +export { KeyOf } from '../keyof/index.mjs' +export { Literal } from '../literal/index.mjs' +export { Mapped } from '../mapped/index.mjs' +export { Never } from '../never/index.mjs' +export { Not } from '../not/index.mjs' +export { Null } from '../null/index.mjs' +export { Number } from '../number/index.mjs' +export { Object } from '../object/index.mjs' +export { Omit } from '../omit/index.mjs' +export { Optional } from '../optional/index.mjs' +export { Parameters } from '../parameters/index.mjs' +export { Partial } from '../partial/index.mjs' +export { Pick } from '../pick/index.mjs' +export { Promise } from '../promise/index.mjs' +export { Readonly } from '../readonly/index.mjs' +export { ReadonlyOptional } from '../readonly-optional/index.mjs' +export { Record } from '../record/index.mjs' +export { Recursive } from '../recursive/index.mjs' +export { Ref } from '../ref/index.mjs' +export { RegExp } from '../regexp/index.mjs' +export { Required } from '../required/index.mjs' +export { Rest } from '../rest/index.mjs' +export { ReturnType } from '../return-type/index.mjs' +export { Strict } from '../strict/index.mjs' +export { String } from '../string/index.mjs' +export { Symbol } from '../symbol/index.mjs' +export { TemplateLiteral } from '../template-literal/index.mjs' +export { Transform } from '../transform/index.mjs' +export { Tuple } from '../tuple/index.mjs' +export { Uint8Array } from '../uint8array/index.mjs' +export { Undefined } from '../undefined/index.mjs' +export { Union } from '../union/index.mjs' +export { Unknown } from '../unknown/index.mjs' +export { Unsafe } from '../unsafe/index.mjs' +export { Void } from '../void/index.mjs' diff --git a/src/type/type/type.ts b/src/type/type/type.ts deleted file mode 100644 index 53f275419..000000000 --- a/src/type/type/type.ts +++ /dev/null @@ -1,89 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -// ------------------------------------------------------------------ -// Type: Module -// ------------------------------------------------------------------ -export { Any } from '../any/index' -export { Array } from '../array/index' -export { AsyncIterator } from '../async-iterator/index' -export { Awaited } from '../awaited/index' -export { BigInt } from '../bigint/index' -export { Boolean } from '../boolean/index' -export { Composite } from '../composite/index' -export { Const } from '../const/index' -export { Constructor } from '../constructor/index' -export { ConstructorParameters } from '../constructor-parameters/index' -export { Date } from '../date/index' -export { Deref } from '../deref/index' -export { Enum } from '../enum/index' -export { Exclude } from '../exclude/index' -export { Extends } from '../extends/index' -export { Extract } from '../extract/index' -export { Function } from '../function/index' -export { Index } from '../indexed/index' -export { InstanceType } from '../instance-type/index' -export { Integer } from '../integer/index' -export { Intersect } from '../intersect/index' -export { Capitalize, Uncapitalize, Lowercase, Uppercase } from '../intrinsic/index' -export { Iterator } from '../iterator/index' -export { KeyOf } from '../keyof/index' -export { Literal } from '../literal/index' -export { Mapped } from '../mapped/index' -export { Never } from '../never/index' -export { Not } from '../not/index' -export { Null } from '../null/index' -export { Number } from '../number/index' -export { Object } from '../object/index' -export { Omit } from '../omit/index' -export { Optional } from '../optional/index' -export { Parameters } from '../parameters/index' -export { Partial } from '../partial/index' -export { Pick } from '../pick/index' -export { Promise } from '../promise/index' -export { Readonly } from '../readonly/index' -export { ReadonlyOptional } from '../readonly-optional/index' -export { Record } from '../record/index' -export { Recursive } from '../recursive/index' -export { Ref } from '../ref/index' -export { RegExp } from '../regexp/index' -export { Required } from '../required/index' -export { Rest } from '../rest/index' -export { ReturnType } from '../return-type/index' -export { Strict } from '../strict/index' -export { String } from '../string/index' -export { Symbol } from '../symbol/index' -export { TemplateLiteral } from '../template-literal/index' -export { Transform } from '../transform/index' -export { Tuple } from '../tuple/index' -export { Uint8Array } from '../uint8array/index' -export { Undefined } from '../undefined/index' -export { Union } from '../union/index' -export { Unknown } from '../unknown/index' -export { Unsafe } from '../unsafe/index' -export { Void } from '../void/index' diff --git a/src/type/uint8array/index.mts b/src/type/uint8array/index.mts new file mode 100644 index 000000000..7170f5af3 --- /dev/null +++ b/src/type/uint8array/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './uint8array.mjs' diff --git a/src/type/uint8array/index.ts b/src/type/uint8array/index.ts deleted file mode 100644 index 4c2296a42..000000000 --- a/src/type/uint8array/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './uint8array' diff --git a/src/type/uint8array/uint8array.ts b/src/type/uint8array/uint8array.mts similarity index 94% rename from src/type/uint8array/uint8array.ts rename to src/type/uint8array/uint8array.mts index 095f7f7bb..5bcc15ebd 100644 --- a/src/type/uint8array/uint8array.ts +++ b/src/type/uint8array/uint8array.mts @@ -26,8 +26,8 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import { Kind } from '../symbols/index' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import { Kind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // TUint8Array diff --git a/src/type/undefined/index.mts b/src/type/undefined/index.mts new file mode 100644 index 000000000..e08989e8d --- /dev/null +++ b/src/type/undefined/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './undefined.mjs' diff --git a/src/type/undefined/index.ts b/src/type/undefined/index.ts deleted file mode 100644 index cbc1c28e3..000000000 --- a/src/type/undefined/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './undefined' diff --git a/src/type/undefined/undefined.ts b/src/type/undefined/undefined.mts similarity index 94% rename from src/type/undefined/undefined.ts rename to src/type/undefined/undefined.mts index 1e1e288e5..7aff9afd5 100644 --- a/src/type/undefined/undefined.ts +++ b/src/type/undefined/undefined.mts @@ -26,8 +26,8 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import { Kind } from '../symbols/index' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import { Kind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // TUndefined diff --git a/src/type/union/index.mts b/src/type/union/index.mts new file mode 100644 index 000000000..65c48f4c1 --- /dev/null +++ b/src/type/union/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './union.mjs' diff --git a/src/type/union/index.ts b/src/type/union/index.ts deleted file mode 100644 index 337cd4a00..000000000 --- a/src/type/union/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './union' diff --git a/src/type/union/union.ts b/src/type/union/union.mts similarity index 88% rename from src/type/union/union.ts rename to src/type/union/union.mts index 129cd4d7b..4ef550478 100644 --- a/src/type/union/union.ts +++ b/src/type/union/union.mts @@ -26,12 +26,12 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import type { Static } from '../static/index' -import { type TNever, Never } from '../never/index' -import { OptionalFromUnion } from '../modifiers/index' -import { CloneType, CloneRest } from '../clone/type' -import { Kind } from '../symbols/index' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import type { Static } from '../static/index.mjs' +import { type TNever, Never } from '../never/index.mjs' +import { OptionalFromUnion } from '../modifiers/index.mjs' +import { CloneType, CloneRest } from '../clone/type.mjs' +import { Kind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // UnionResolve diff --git a/src/type/unknown/index.mts b/src/type/unknown/index.mts new file mode 100644 index 000000000..9253237c9 --- /dev/null +++ b/src/type/unknown/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './unknown.mjs' diff --git a/src/type/unknown/index.ts b/src/type/unknown/index.ts deleted file mode 100644 index 7d9c7e293..000000000 --- a/src/type/unknown/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './unknown' diff --git a/src/type/unknown/unknown.ts b/src/type/unknown/unknown.mts similarity index 94% rename from src/type/unknown/unknown.ts rename to src/type/unknown/unknown.mts index cc1a7bc22..c8d274d80 100644 --- a/src/type/unknown/unknown.ts +++ b/src/type/unknown/unknown.mts @@ -26,8 +26,8 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import { Kind } from '../symbols/index' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import { Kind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // TUnknown diff --git a/src/type/unsafe/index.mts b/src/type/unsafe/index.mts new file mode 100644 index 000000000..0ec466696 --- /dev/null +++ b/src/type/unsafe/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './unsafe.mjs' diff --git a/src/type/unsafe/index.ts b/src/type/unsafe/index.ts deleted file mode 100644 index 78141b392..000000000 --- a/src/type/unsafe/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './unsafe' diff --git a/src/type/unsafe/unsafe.ts b/src/type/unsafe/unsafe.mts similarity index 94% rename from src/type/unsafe/unsafe.ts rename to src/type/unsafe/unsafe.mts index a60b33a41..53a30e471 100644 --- a/src/type/unsafe/unsafe.ts +++ b/src/type/unsafe/unsafe.mts @@ -26,8 +26,8 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import { Kind } from '../symbols/index' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import { Kind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // TUnknown diff --git a/src/type/void/index.mts b/src/type/void/index.mts new file mode 100644 index 000000000..f1b2340a7 --- /dev/null +++ b/src/type/void/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/type + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './void.mjs' diff --git a/src/type/void/index.ts b/src/type/void/index.ts deleted file mode 100644 index 3b9bf5199..000000000 --- a/src/type/void/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/type - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './void' diff --git a/src/type/void/void.ts b/src/type/void/void.mts similarity index 94% rename from src/type/void/void.ts rename to src/type/void/void.mts index 8d742b89b..ff2ebadf6 100644 --- a/src/type/void/void.ts +++ b/src/type/void/void.mts @@ -26,8 +26,8 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema, SchemaOptions } from '../schema/index' -import { Kind } from '../symbols/index' +import type { TSchema, SchemaOptions } from '../schema/index.mjs' +import { Kind } from '../symbols/index.mjs' // ------------------------------------------------------------------ // TVoid diff --git a/src/value/cast/cast.ts b/src/value/cast/cast.mts similarity index 92% rename from src/value/cast/cast.ts rename to src/value/cast/cast.mts index d75ca1b62..dddcccb30 100644 --- a/src/value/cast/cast.ts +++ b/src/value/cast/cast.mts @@ -26,25 +26,25 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { IsPlainObject, IsArray, IsString, IsNumber, IsNull } from '../guard/index' -import { Kind } from '../../type/symbols/index' -import { Create } from '../create/index' -import { Check } from '../check/index' -import { Clone } from '../clone/index' -import { Deref } from '../deref/index' +import { IsPlainObject, IsArray, IsString, IsNumber, IsNull } from '../guard/index.mjs' +import { Kind } from '../../type/symbols/index.mjs' +import { Create } from '../create/index.mjs' +import { Check } from '../check/index.mjs' +import { Clone } from '../clone/index.mjs' +import { Deref } from '../deref/index.mjs' -import type { TSchema } from '../../type/schema/index' -import type { Static } from '../../type/static/index' -import type { TArray } from '../../type/array/index' -import type { TConstructor } from '../../type/constructor/index' -import type { TIntersect } from '../../type/intersect/index' -import type { TObject } from '../../type/object/index' -import type { TRecord } from '../../type/record/index' -import type { TRef } from '../../type/ref/index' -import type { TThis } from '../../type/recursive/index' -import type { TTuple } from '../../type/tuple/index' -import type { TUnion } from '../../type/union/index' -import type { TNever } from '../../type/never/index' +import type { TSchema } from '../../type/schema/index.mjs' +import type { Static } from '../../type/static/index.mjs' +import type { TArray } from '../../type/array/index.mjs' +import type { TConstructor } from '../../type/constructor/index.mjs' +import type { TIntersect } from '../../type/intersect/index.mjs' +import type { TObject } from '../../type/object/index.mjs' +import type { TRecord } from '../../type/record/index.mjs' +import type { TRef } from '../../type/ref/index.mjs' +import type { TThis } from '../../type/recursive/index.mjs' +import type { TTuple } from '../../type/tuple/index.mjs' +import type { TUnion } from '../../type/union/index.mjs' +import type { TNever } from '../../type/never/index.mjs' // ------------------------------------------------------------------ // Errors diff --git a/src/value/cast/index.ts b/src/value/cast/index.mts similarity index 97% rename from src/value/cast/index.ts rename to src/value/cast/index.mts index 5d403f74a..62b94ad21 100644 --- a/src/value/cast/index.ts +++ b/src/value/cast/index.mts @@ -26,4 +26,4 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -export * from './cast' +export * from './cast.mjs' diff --git a/src/value/check/check.ts b/src/value/check/check.mts similarity index 88% rename from src/value/check/check.ts rename to src/value/check/check.mts index 96ae115b7..44811aa1f 100644 --- a/src/value/check/check.ts +++ b/src/value/check/check.mts @@ -26,48 +26,48 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { IsArray, IsUint8Array, IsDate, IsPromise, IsFunction, IsAsyncIterator, IsIterator, IsBoolean, IsNumber, IsBigInt, IsString, IsSymbol, IsInteger, IsNull, IsUndefined } from '../guard/index' -import { TypeSystemPolicy } from '../../system/index' -import { Deref } from '../deref/index' -import { Hash } from '../hash/index' -import { Kind } from '../../type/symbols/index' -import { KeyOfStringResolvePattern } from '../../type/keyof/index' -import { ExtendsUndefinedCheck } from '../../type/extends/index' -import { TSchema as IsSchemaType } from '../../type/guard/type' -import { TypeRegistry, FormatRegistry } from '../../type/registry/index' +import { IsArray, IsUint8Array, IsDate, IsPromise, IsFunction, IsAsyncIterator, IsIterator, IsBoolean, IsNumber, IsBigInt, IsString, IsSymbol, IsInteger, IsNull, IsUndefined } from '../guard/index.mjs' +import { TypeSystemPolicy } from '../../system/index.mjs' +import { Deref } from '../deref/index.mjs' +import { Hash } from '../hash/index.mjs' +import { Kind } from '../../type/symbols/index.mjs' +import { KeyOfStringResolvePattern } from '../../type/keyof/index.mjs' +import { ExtendsUndefinedCheck } from '../../type/extends/index.mjs' +import { TSchema as IsSchemaType } from '../../type/guard/type.mjs' +import { TypeRegistry, FormatRegistry } from '../../type/registry/index.mjs' -import type { TSchema } from '../../type/schema/index' -import type { TAsyncIterator } from '../../type/async-iterator/index' -import type { TAny } from '../../type/any/index' -import type { TArray } from '../../type/array/index' -import type { TBigInt } from '../../type/bigint/index' -import type { TBoolean } from '../../type/boolean/index' -import type { TDate } from '../../type/date/index' -import type { TConstructor } from '../../type/constructor/index' -import type { TFunction } from '../../type/function/index' -import type { TInteger } from '../../type/integer/index' -import type { TIntersect } from '../../type/intersect/index' -import type { TIterator } from '../../type/iterator/index' -import type { TLiteral } from '../../type/literal/index' -import { Never, type TNever } from '../../type/never/index' -import type { TNot } from '../../type/not/index' -import type { TNull } from '../../type/null/index' -import type { TNumber } from '../../type/number/index' -import type { TObject } from '../../type/object/index' -import type { TPromise } from '../../type/promise/index' -import type { TRecord } from '../../type/record/index' -import type { TRef } from '../../type/ref/index' -import type { TTemplateLiteral, TTemplateLiteralKind } from '../../type/template-literal/index' -import type { TThis } from '../../type/recursive/index' -import type { TTuple } from '../../type/tuple/index' -import type { TUnion } from '../../type/union/index' -import type { TUnknown } from '../../type/unknown/index' -import type { Static } from '../../type/static/index' -import type { TString } from '../../type/string/index' -import type { TSymbol } from '../../type/symbol/index' -import type { TUndefined } from '../../type/undefined/index' -import type { TUint8Array } from '../../type/uint8array/index' -import type { TVoid } from '../../type/void/index' +import type { TSchema } from '../../type/schema/index.mjs' +import type { TAsyncIterator } from '../../type/async-iterator/index.mjs' +import type { TAny } from '../../type/any/index.mjs' +import type { TArray } from '../../type/array/index.mjs' +import type { TBigInt } from '../../type/bigint/index.mjs' +import type { TBoolean } from '../../type/boolean/index.mjs' +import type { TDate } from '../../type/date/index.mjs' +import type { TConstructor } from '../../type/constructor/index.mjs' +import type { TFunction } from '../../type/function/index.mjs' +import type { TInteger } from '../../type/integer/index.mjs' +import type { TIntersect } from '../../type/intersect/index.mjs' +import type { TIterator } from '../../type/iterator/index.mjs' +import type { TLiteral } from '../../type/literal/index.mjs' +import { Never, type TNever } from '../../type/never/index.mjs' +import type { TNot } from '../../type/not/index.mjs' +import type { TNull } from '../../type/null/index.mjs' +import type { TNumber } from '../../type/number/index.mjs' +import type { TObject } from '../../type/object/index.mjs' +import type { TPromise } from '../../type/promise/index.mjs' +import type { TRecord } from '../../type/record/index.mjs' +import type { TRef } from '../../type/ref/index.mjs' +import type { TTemplateLiteral, TTemplateLiteralKind } from '../../type/template-literal/index.mjs' +import type { TThis } from '../../type/recursive/index.mjs' +import type { TTuple } from '../../type/tuple/index.mjs' +import type { TUnion } from '../../type/union/index.mjs' +import type { TUnknown } from '../../type/unknown/index.mjs' +import type { Static } from '../../type/static/index.mjs' +import type { TString } from '../../type/string/index.mjs' +import type { TSymbol } from '../../type/symbol/index.mjs' +import type { TUndefined } from '../../type/undefined/index.mjs' +import type { TUint8Array } from '../../type/uint8array/index.mjs' +import type { TVoid } from '../../type/void/index.mjs' // -------------------------------------------------------------------------- // Errors diff --git a/src/value/clean/index.ts b/src/value/check/index.mts similarity index 97% rename from src/value/clean/index.ts rename to src/value/check/index.mts index 4e55b279e..442bf1387 100644 --- a/src/value/clean/index.ts +++ b/src/value/check/index.mts @@ -26,4 +26,4 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -export * from './clean' +export * from './check.mjs' diff --git a/src/value/clean/clean.ts b/src/value/clean/clean.mts similarity index 90% rename from src/value/clean/clean.ts rename to src/value/clean/clean.mts index 2895fde19..ac5f09075 100644 --- a/src/value/clean/clean.ts +++ b/src/value/clean/clean.mts @@ -26,23 +26,23 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { IsString, IsObject, IsArray, IsUndefined } from '../guard/index' -import { TSchema as IsSchemaType } from '../../type/guard/type' -import { KeyOfStringResolve } from '../../type/keyof/keyof-string' -import { Check } from '../check/index' -import { Clone } from '../clone/index' -import { Deref } from '../deref/index' -import { Kind } from '../../type/symbols/index' +import { IsString, IsObject, IsArray, IsUndefined } from '../guard/index.mjs' +import { TSchema as IsSchemaType } from '../../type/guard/type.mjs' +import { KeyOfStringResolve } from '../../type/keyof/keyof-string.mjs' +import { Check } from '../check/index.mjs' +import { Clone } from '../clone/index.mjs' +import { Deref } from '../deref/index.mjs' +import { Kind } from '../../type/symbols/index.mjs' -import type { TSchema } from '../../type/schema/index' -import type { TArray } from '../../type/array/index' -import type { TIntersect } from '../../type/intersect/index' -import type { TObject } from '../../type/object/index' -import type { TRecord } from '../../type/record/index' -import type { TRef } from '../../type/ref/index' -import type { TThis } from '../../type/recursive/index' -import type { TTuple } from '../../type/tuple/index' -import type { TUnion } from '../../type/union/index' +import type { TSchema } from '../../type/schema/index.mjs' +import type { TArray } from '../../type/array/index.mjs' +import type { TIntersect } from '../../type/intersect/index.mjs' +import type { TObject } from '../../type/object/index.mjs' +import type { TRecord } from '../../type/record/index.mjs' +import type { TRef } from '../../type/ref/index.mjs' +import type { TThis } from '../../type/recursive/index.mjs' +import type { TTuple } from '../../type/tuple/index.mjs' +import type { TUnion } from '../../type/union/index.mjs' // ------------------------------------------------------------------ // IsSchema diff --git a/src/value/clone/index.ts b/src/value/clean/index.mts similarity index 97% rename from src/value/clone/index.ts rename to src/value/clean/index.mts index 4294f9957..f7df7ba3d 100644 --- a/src/value/clone/index.ts +++ b/src/value/clean/index.mts @@ -26,4 +26,4 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -export * from './clone' +export * from './clean.mjs' diff --git a/src/value/clone/clone.ts b/src/value/clone/clone.mts similarity index 97% rename from src/value/clone/clone.ts rename to src/value/clone/clone.mts index aad338c61..b28b9aa49 100644 --- a/src/value/clone/clone.ts +++ b/src/value/clone/clone.mts @@ -26,8 +26,8 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { IsArray, IsDate, IsPlainObject, IsTypedArray, IsValueType } from '../guard/index' -import type { ObjectType, ArrayType, TypedArrayType, ValueType } from '../guard/index' +import { IsArray, IsDate, IsPlainObject, IsTypedArray, IsValueType } from '../guard/index.mjs' +import type { ObjectType, ArrayType, TypedArrayType, ValueType } from '../guard/index.mjs' // -------------------------------------------------------------------------- // Clonable diff --git a/src/value/clone/index.mts b/src/value/clone/index.mts new file mode 100644 index 000000000..e7f154ef6 --- /dev/null +++ b/src/value/clone/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './clone.mjs' diff --git a/src/value/convert/convert.ts b/src/value/convert/convert.mts similarity index 89% rename from src/value/convert/convert.ts rename to src/value/convert/convert.mts index 2f6d2bcf9..bbfc6d48c 100644 --- a/src/value/convert/convert.ts +++ b/src/value/convert/convert.mts @@ -26,34 +26,34 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { IsArray, IsObject, IsDate, IsUndefined, IsString, IsNumber, IsBoolean, IsBigInt, IsSymbol } from '../guard/index' -import { Clone } from '../clone/index' -import { Check } from '../check/index' -import { Deref } from '../deref/index' +import { IsArray, IsObject, IsDate, IsUndefined, IsString, IsNumber, IsBoolean, IsBigInt, IsSymbol } from '../guard/index.mjs' +import { Clone } from '../clone/index.mjs' +import { Check } from '../check/index.mjs' +import { Deref } from '../deref/index.mjs' -import { TObject as IsObjectType } from '../../type/guard/type' -import { Kind } from '../../type/symbols/index' -import { Composite } from '../../type/composite/index' +import { TObject as IsObjectType } from '../../type/guard/type.mjs' +import { Kind } from '../../type/symbols/index.mjs' +import { Composite } from '../../type/composite/index.mjs' -import type { TSchema } from '../../type/schema/index' -import type { TArray } from '../../type/array/index' -import type { TBigInt } from '../../type/bigint/index' -import type { TBoolean } from '../../type/boolean/index' -import type { TDate } from '../../type/date/index' -import type { TInteger } from '../../type/integer/index' -import type { TIntersect } from '../../type/intersect/index' -import type { TLiteral } from '../../type/literal/index' -import type { TNull } from '../../type/null/index' -import type { TNumber } from '../../type/number/index' -import type { TObject } from '../../type/object/index' -import type { TRecord } from '../../type/record/index' -import type { TRef } from '../../type/ref/index' -import type { TThis } from '../../type/recursive/index' -import type { TTuple } from '../../type/tuple/index' -import type { TUnion } from '../../type/union/index' -import type { TString } from '../../type/string/index' -import type { TSymbol } from '../../type/symbol/index' -import type { TUndefined } from '../../type/undefined/index' +import type { TSchema } from '../../type/schema/index.mjs' +import type { TArray } from '../../type/array/index.mjs' +import type { TBigInt } from '../../type/bigint/index.mjs' +import type { TBoolean } from '../../type/boolean/index.mjs' +import type { TDate } from '../../type/date/index.mjs' +import type { TInteger } from '../../type/integer/index.mjs' +import type { TIntersect } from '../../type/intersect/index.mjs' +import type { TLiteral } from '../../type/literal/index.mjs' +import type { TNull } from '../../type/null/index.mjs' +import type { TNumber } from '../../type/number/index.mjs' +import type { TObject } from '../../type/object/index.mjs' +import type { TRecord } from '../../type/record/index.mjs' +import type { TRef } from '../../type/ref/index.mjs' +import type { TThis } from '../../type/recursive/index.mjs' +import type { TTuple } from '../../type/tuple/index.mjs' +import type { TUnion } from '../../type/union/index.mjs' +import type { TString } from '../../type/string/index.mjs' +import type { TSymbol } from '../../type/symbol/index.mjs' +import type { TUndefined } from '../../type/undefined/index.mjs' // ------------------------------------------------------------------ // Errors diff --git a/src/value/convert/index.mts b/src/value/convert/index.mts new file mode 100644 index 000000000..65f18624c --- /dev/null +++ b/src/value/convert/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './convert.mjs' diff --git a/src/value/convert/index.ts b/src/value/convert/index.ts deleted file mode 100644 index 0e642e6ac..000000000 --- a/src/value/convert/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './convert' diff --git a/src/value/create/create.ts b/src/value/create/create.mts similarity index 87% rename from src/value/create/create.ts rename to src/value/create/create.mts index fd573e75c..edfd5f686 100644 --- a/src/value/create/create.ts +++ b/src/value/create/create.mts @@ -26,46 +26,46 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { HasPropertyKey, IsString } from '../guard/index' -import { Check } from '../check/index' -import { Deref } from '../deref/index' -import { TemplateLiteralParseExact, IsTemplateLiteralFinite, TemplateLiteralGenerate } from '../../type/template-literal/index' -import { PatternStringExact, PatternNumberExact } from '../../type/patterns/index' -import { TypeRegistry } from '../../type/registry/index' -import { Kind } from '../../type/symbols/index' +import { HasPropertyKey, IsString } from '../guard/index.mjs' +import { Check } from '../check/index.mjs' +import { Deref } from '../deref/index.mjs' +import { TemplateLiteralParseExact, IsTemplateLiteralFinite, TemplateLiteralGenerate } from '../../type/template-literal/index.mjs' +import { PatternStringExact, PatternNumberExact } from '../../type/patterns/index.mjs' +import { TypeRegistry } from '../../type/registry/index.mjs' +import { Kind } from '../../type/symbols/index.mjs' -import type { TSchema } from '../../type/schema/index' -import type { TAsyncIterator } from '../../type/async-iterator/index' -import type { TAny } from '../../type/any/index' -import type { TArray } from '../../type/array/index' -import type { TBigInt } from '../../type/bigint/index' -import type { TBoolean } from '../../type/boolean/index' -import type { TDate } from '../../type/date/index' -import type { TConstructor } from '../../type/constructor/index' -import type { TFunction } from '../../type/function/index' -import type { TInteger } from '../../type/integer/index' -import type { TIntersect } from '../../type/intersect/index' -import type { TIterator } from '../../type/iterator/index' -import type { TLiteral } from '../../type/literal/index' -import type { TNever } from '../../type/never/index' -import type { TNot } from '../../type/not/index' -import type { TNull } from '../../type/null/index' -import type { TNumber } from '../../type/number/index' -import type { TObject } from '../../type/object/index' -import type { TPromise } from '../../type/promise/index' -import type { TRecord } from '../../type/record/index' -import type { TRef } from '../../type/ref/index' -import type { TTemplateLiteral } from '../../type/template-literal/index' -import type { TThis } from '../../type/recursive/index' -import type { TTuple } from '../../type/tuple/index' -import type { TUnion } from '../../type/union/index' -import type { TUnknown } from '../../type/unknown/index' -import type { Static } from '../../type/static/index' -import type { TString } from '../../type/string/index' -import type { TSymbol } from '../../type/symbol/index' -import type { TUndefined } from '../../type/undefined/index' -import type { TUint8Array } from '../../type/uint8array/index' -import type { TVoid } from '../../type/void/index' +import type { TSchema } from '../../type/schema/index.mjs' +import type { TAsyncIterator } from '../../type/async-iterator/index.mjs' +import type { TAny } from '../../type/any/index.mjs' +import type { TArray } from '../../type/array/index.mjs' +import type { TBigInt } from '../../type/bigint/index.mjs' +import type { TBoolean } from '../../type/boolean/index.mjs' +import type { TDate } from '../../type/date/index.mjs' +import type { TConstructor } from '../../type/constructor/index.mjs' +import type { TFunction } from '../../type/function/index.mjs' +import type { TInteger } from '../../type/integer/index.mjs' +import type { TIntersect } from '../../type/intersect/index.mjs' +import type { TIterator } from '../../type/iterator/index.mjs' +import type { TLiteral } from '../../type/literal/index.mjs' +import type { TNever } from '../../type/never/index.mjs' +import type { TNot } from '../../type/not/index.mjs' +import type { TNull } from '../../type/null/index.mjs' +import type { TNumber } from '../../type/number/index.mjs' +import type { TObject } from '../../type/object/index.mjs' +import type { TPromise } from '../../type/promise/index.mjs' +import type { TRecord } from '../../type/record/index.mjs' +import type { TRef } from '../../type/ref/index.mjs' +import type { TTemplateLiteral } from '../../type/template-literal/index.mjs' +import type { TThis } from '../../type/recursive/index.mjs' +import type { TTuple } from '../../type/tuple/index.mjs' +import type { TUnion } from '../../type/union/index.mjs' +import type { TUnknown } from '../../type/unknown/index.mjs' +import type { Static } from '../../type/static/index.mjs' +import type { TString } from '../../type/string/index.mjs' +import type { TSymbol } from '../../type/symbol/index.mjs' +import type { TUndefined } from '../../type/undefined/index.mjs' +import type { TUint8Array } from '../../type/uint8array/index.mjs' +import type { TVoid } from '../../type/void/index.mjs' // ------------------------------------------------------------------ // Errors diff --git a/src/value/create/index.mts b/src/value/create/index.mts new file mode 100644 index 000000000..15ca9f646 --- /dev/null +++ b/src/value/create/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './create.mjs' diff --git a/src/value/create/index.ts b/src/value/create/index.ts deleted file mode 100644 index 62543e72b..000000000 --- a/src/value/create/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './create' diff --git a/src/value/default/default.ts b/src/value/default/default.mts similarity index 91% rename from src/value/default/default.ts rename to src/value/default/default.mts index 852498e74..75fa28fc1 100644 --- a/src/value/default/default.ts +++ b/src/value/default/default.mts @@ -26,21 +26,21 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { IsString, IsObject, IsArray, IsUndefined } from '../guard/index' -import { TSchema as IsSchemaType } from '../../type/guard/type' -import { Check } from '../check/index' -import { Deref } from '../deref/index' -import { Kind } from '../../type/symbols/index' +import { IsString, IsObject, IsArray, IsUndefined } from '../guard/index.mjs' +import { TSchema as IsSchemaType } from '../../type/guard/type.mjs' +import { Check } from '../check/index.mjs' +import { Deref } from '../deref/index.mjs' +import { Kind } from '../../type/symbols/index.mjs' -import type { TSchema } from '../../type/schema/index' -import type { TArray } from '../../type/array/index' -import type { TIntersect } from '../../type/intersect/index' -import type { TObject } from '../../type/object/index' -import type { TRecord } from '../../type/record/index' -import type { TRef } from '../../type/ref/index' -import type { TThis } from '../../type/recursive/index' -import type { TTuple } from '../../type/tuple/index' -import type { TUnion } from '../../type/union/index' +import type { TSchema } from '../../type/schema/index.mjs' +import type { TArray } from '../../type/array/index.mjs' +import type { TIntersect } from '../../type/intersect/index.mjs' +import type { TObject } from '../../type/object/index.mjs' +import type { TRecord } from '../../type/record/index.mjs' +import type { TRef } from '../../type/ref/index.mjs' +import type { TThis } from '../../type/recursive/index.mjs' +import type { TTuple } from '../../type/tuple/index.mjs' +import type { TUnion } from '../../type/union/index.mjs' // ------------------------------------------------------------------ // ValueOrDefault diff --git a/src/value/default/index.mts b/src/value/default/index.mts new file mode 100644 index 000000000..b79696468 --- /dev/null +++ b/src/value/default/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './default.mjs' diff --git a/src/value/default/index.ts b/src/value/default/index.ts deleted file mode 100644 index fb74557fd..000000000 --- a/src/value/default/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './default' diff --git a/src/value/delta/delta.ts b/src/value/delta/delta.mts similarity index 94% rename from src/value/delta/delta.ts rename to src/value/delta/delta.mts index a87aaedbe..efd3af3f4 100644 --- a/src/value/delta/delta.ts +++ b/src/value/delta/delta.mts @@ -26,17 +26,17 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { IsPlainObject, IsArray, IsTypedArray, IsValueType, IsSymbol, IsUndefined } from '../guard/index' -import type { ObjectType, ArrayType, TypedArrayType, ValueType } from '../guard/index' -import type { Static } from '../../type/static/index' -import { ValuePointer } from '../pointer/index' -import { Clone } from '../clone/index' +import { IsPlainObject, IsArray, IsTypedArray, IsValueType, IsSymbol, IsUndefined } from '../guard/index.mjs' +import type { ObjectType, ArrayType, TypedArrayType, ValueType } from '../guard/index.mjs' +import type { Static } from '../../type/static/index.mjs' +import { ValuePointer } from '../pointer/index.mjs' +import { Clone } from '../clone/index.mjs' -import { Literal as CreateLiteral } from '../../type/literal/index' -import { Object as CreateObject } from '../../type/object/index' -import { String as CreateString } from '../../type/string/index' -import { Unknown as CreateUnknown } from '../../type/unknown/index' -import { Union as CreateUnion } from '../../type/union/index' +import { Literal as CreateLiteral } from '../../type/literal/index.mjs' +import { Object as CreateObject } from '../../type/object/index.mjs' +import { String as CreateString } from '../../type/string/index.mjs' +import { Unknown as CreateUnknown } from '../../type/unknown/index.mjs' +import { Union as CreateUnion } from '../../type/union/index.mjs' // ------------------------------------------------------------------ // Commands diff --git a/src/value/delta/index.mts b/src/value/delta/index.mts new file mode 100644 index 000000000..02f54bb97 --- /dev/null +++ b/src/value/delta/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './delta.mjs' diff --git a/src/value/delta/index.ts b/src/value/delta/index.ts deleted file mode 100644 index 3eca3782f..000000000 --- a/src/value/delta/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './delta' diff --git a/src/value/deref/deref.ts b/src/value/deref/deref.mts similarity index 91% rename from src/value/deref/deref.ts rename to src/value/deref/deref.mts index 97f3bcf68..ab7726710 100644 --- a/src/value/deref/deref.ts +++ b/src/value/deref/deref.mts @@ -26,9 +26,9 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import type { TSchema } from '../../type/schema/index' -import type { TRef } from '../../type/ref/index' -import type { TThis } from '../../type/recursive/index' +import type { TSchema } from '../../type/schema/index.mjs' +import type { TRef } from '../../type/ref/index.mjs' +import type { TThis } from '../../type/recursive/index.mjs' export class TypeDereferenceError extends Error { constructor(public readonly schema: TRef | TThis) { diff --git a/src/value/deref/index.mts b/src/value/deref/index.mts new file mode 100644 index 000000000..bc48c386b --- /dev/null +++ b/src/value/deref/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './deref.mjs' diff --git a/src/value/deref/index.ts b/src/value/deref/index.ts deleted file mode 100644 index d0bf7e45b..000000000 --- a/src/value/deref/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './deref' diff --git a/src/value/equal/equal.ts b/src/value/equal/equal.mts similarity index 98% rename from src/value/equal/equal.ts rename to src/value/equal/equal.mts index 264093959..f6bfcdca5 100644 --- a/src/value/equal/equal.ts +++ b/src/value/equal/equal.mts @@ -26,8 +26,8 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { IsPlainObject, IsDate, IsArray, IsTypedArray, IsValueType } from '../guard/index' -import type { ObjectType, ArrayType, TypedArrayType, ValueType } from '../guard/index' +import { IsPlainObject, IsDate, IsArray, IsTypedArray, IsValueType } from '../guard/index.mjs' +import type { ObjectType, ArrayType, TypedArrayType, ValueType } from '../guard/index.mjs' // ------------------------------------------------------------------ // Equality Checks diff --git a/src/value/equal/index.mts b/src/value/equal/index.mts new file mode 100644 index 000000000..b25241131 --- /dev/null +++ b/src/value/equal/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './equal.mjs' diff --git a/src/value/equal/index.ts b/src/value/equal/index.ts deleted file mode 100644 index cf0e42f72..000000000 --- a/src/value/equal/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './equal' diff --git a/src/value/guard/guard.ts b/src/value/guard/guard.mts similarity index 100% rename from src/value/guard/guard.ts rename to src/value/guard/guard.mts diff --git a/src/value/guard/index.mts b/src/value/guard/index.mts new file mode 100644 index 000000000..7f9769b86 --- /dev/null +++ b/src/value/guard/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './guard.mjs' diff --git a/src/value/guard/index.ts b/src/value/guard/index.ts deleted file mode 100644 index 36d7e3fa8..000000000 --- a/src/value/guard/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './guard' diff --git a/src/value/hash/hash.ts b/src/value/hash/hash.mts similarity index 99% rename from src/value/hash/hash.ts rename to src/value/hash/hash.mts index e0f637751..e2872e68f 100644 --- a/src/value/hash/hash.ts +++ b/src/value/hash/hash.mts @@ -26,7 +26,7 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { IsArray, IsBoolean, IsBigInt, IsDate, IsNull, IsNumber, IsPlainObject, IsString, IsSymbol, IsUint8Array, IsUndefined } from '../guard/index' +import { IsArray, IsBoolean, IsBigInt, IsDate, IsNull, IsNumber, IsPlainObject, IsString, IsSymbol, IsUint8Array, IsUndefined } from '../guard/index.mjs' // ------------------------------------------------------------------ // Errors diff --git a/src/value/check/index.ts b/src/value/hash/index.mts similarity index 97% rename from src/value/check/index.ts rename to src/value/hash/index.mts index e318a6581..8198a2936 100644 --- a/src/value/check/index.ts +++ b/src/value/hash/index.mts @@ -26,4 +26,4 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -export * from './check' +export * from './hash.mjs' diff --git a/src/value/hash/index.ts b/src/value/hash/index.ts deleted file mode 100644 index a2607845e..000000000 --- a/src/value/hash/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './hash' diff --git a/src/value/index.ts b/src/value/index.mts similarity index 83% rename from src/value/index.ts rename to src/value/index.mts index aab2729a8..e941cf83e 100644 --- a/src/value/index.ts +++ b/src/value/index.mts @@ -29,23 +29,23 @@ THE SOFTWARE. // ------------------------------------------------------------------ // Value Errors (re-export) // ------------------------------------------------------------------ -export { ValueError, ValueErrorType, ValueErrorIterator } from '../errors/index' +export { ValueError, ValueErrorType, ValueErrorIterator } from '../errors/index.mjs' // ------------------------------------------------------------------ // Value Operators // ------------------------------------------------------------------ -export { Cast, ValueCastArrayUniqueItemsTypeError, ValueCastNeverTypeError, ValueCastRecursiveTypeError, ValueCastUnknownTypeError } from './cast/index' -export { Check } from './check/index' -export { Clean } from './clean/index' -export { Clone } from './clone/index' -export { Convert, ValueConvertUnknownTypeError } from './convert/index' -export { Create, ValueCreateIntersectTypeError, ValueCreateNeverTypeError, ValueCreateNotTypeError, ValueCreateRecursiveInstantiationError, ValueCreateTempateLiteralTypeError, ValueCreateUnknownTypeError } from './create/index' -export { Default } from './default/index' -export { Diff, Patch, Edit, Delete, Insert, Update, ValueDeltaObjectWithSymbolKeyError, ValueDeltaUnableToDiffUnknownValue } from './delta/index' -export { Equal } from './equal/index' -export { Hash, ValueHashError } from './hash/index' -export { Mutate, type Mutable, ValueMutateInvalidRootMutationError, ValueMutateTypeMismatchError } from './mutate/index' -export { ValuePointer } from './pointer/index' -export { Decode, Encode, HasTransform, TransformDecodeCheckError, TransformDecodeError, TransformEncodeCheckError, TransformEncodeError } from './transform/index' +export { Cast, ValueCastArrayUniqueItemsTypeError, ValueCastNeverTypeError, ValueCastRecursiveTypeError, ValueCastUnknownTypeError } from './cast/index.mjs' +export { Check } from './check/index.mjs' +export { Clean } from './clean/index.mjs' +export { Clone } from './clone/index.mjs' +export { Convert, ValueConvertUnknownTypeError } from './convert/index.mjs' +export { Create, ValueCreateIntersectTypeError, ValueCreateNeverTypeError, ValueCreateNotTypeError, ValueCreateRecursiveInstantiationError, ValueCreateTempateLiteralTypeError, ValueCreateUnknownTypeError } from './create/index.mjs' +export { Default } from './default/index.mjs' +export { Diff, Patch, Edit, Delete, Insert, Update, ValueDeltaObjectWithSymbolKeyError, ValueDeltaUnableToDiffUnknownValue } from './delta/index.mjs' +export { Equal } from './equal/index.mjs' +export { Hash, ValueHashError } from './hash/index.mjs' +export { Mutate, type Mutable, ValueMutateInvalidRootMutationError, ValueMutateTypeMismatchError } from './mutate/index.mjs' +export { ValuePointer } from './pointer/index.mjs' +export { Decode, Encode, HasTransform, TransformDecodeCheckError, TransformDecodeError, TransformEncodeCheckError, TransformEncodeError } from './transform/index.mjs' // ------------------------------------------------------------------ // Value Guards // ------------------------------------------------------------------ @@ -74,10 +74,10 @@ export { ObjectType, TypedArrayType, ValueType, -} from './guard/index' +} from './guard/index.mjs' // ------------------------------------------------------------------ // Value Namespace // ------------------------------------------------------------------ -import { Value } from './value/index' +import { Value } from './value/index.mjs' export { Value } export default Value diff --git a/src/value/mutate/index.mts b/src/value/mutate/index.mts new file mode 100644 index 000000000..d8a7abd08 --- /dev/null +++ b/src/value/mutate/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './mutate.mjs' diff --git a/src/value/mutate/index.ts b/src/value/mutate/index.ts deleted file mode 100644 index cf8bd9248..000000000 --- a/src/value/mutate/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './mutate' diff --git a/src/value/mutate/mutate.ts b/src/value/mutate/mutate.mts similarity index 97% rename from src/value/mutate/mutate.ts rename to src/value/mutate/mutate.mts index c1871402d..f8709ff3c 100644 --- a/src/value/mutate/mutate.ts +++ b/src/value/mutate/mutate.mts @@ -26,9 +26,9 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { IsPlainObject, IsArray, IsTypedArray, IsValueType, type TypedArrayType } from '../guard/index' -import { ValuePointer } from '../pointer/index' -import { Clone } from '../clone/index' +import { IsPlainObject, IsArray, IsTypedArray, IsValueType, type TypedArrayType } from '../guard/index.mjs' +import { ValuePointer } from '../pointer/index.mjs' +import { Clone } from '../clone/index.mjs' // ------------------------------------------------------------------ // Errors diff --git a/src/value/pointer/index.mts b/src/value/pointer/index.mts new file mode 100644 index 000000000..c6783dfd9 --- /dev/null +++ b/src/value/pointer/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * as ValuePointer from './pointer.mjs' diff --git a/src/value/pointer/index.ts b/src/value/pointer/index.ts deleted file mode 100644 index d4071966d..000000000 --- a/src/value/pointer/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * as ValuePointer from './pointer' diff --git a/src/value/pointer/pointer.ts b/src/value/pointer/pointer.mts similarity index 100% rename from src/value/pointer/pointer.ts rename to src/value/pointer/pointer.mts diff --git a/src/value/transform/decode.ts b/src/value/transform/decode.mts similarity index 89% rename from src/value/transform/decode.ts rename to src/value/transform/decode.mts index 9cfb66f6b..e11eadc74 100644 --- a/src/value/transform/decode.ts +++ b/src/value/transform/decode.mts @@ -26,25 +26,25 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { TTransform as IsTransformType, TSchema as IsSchemaType } from '../../type/guard/type' -import { Kind, TransformKind } from '../../type/symbols/index' -import { IsPlainObject, IsArray, IsValueType } from '../guard/index' -import { ValueError } from '../../errors/index' -import { KeyOfStringResolve } from '../../type/keyof/index' -import { IndexedTypeResolve } from '../../type/indexed/index' -import { Deref } from '../deref/index' -import { Check } from '../check/index' +import { TTransform as IsTransformType, TSchema as IsSchemaType } from '../../type/guard/type.mjs' +import { Kind, TransformKind } from '../../type/symbols/index.mjs' +import { IsPlainObject, IsArray, IsValueType } from '../guard/index.mjs' +import { ValueError } from '../../errors/index.mjs' +import { KeyOfStringResolve } from '../../type/keyof/index.mjs' +import { IndexedTypeResolve } from '../../type/indexed/index.mjs' +import { Deref } from '../deref/index.mjs' +import { Check } from '../check/index.mjs' -import type { TSchema } from '../../type/schema/index' -import type { TArray } from '../../type/array/index' -import type { TIntersect } from '../../type/intersect/index' -import type { TNot } from '../../type/not/index' -import type { TObject } from '../../type/object/index' -import type { TRecord } from '../../type/record/index' -import type { TRef } from '../../type/ref/index' -import type { TThis } from '../../type/recursive/index' -import type { TTuple } from '../../type/tuple/index' -import type { TUnion } from '../../type/union/index' +import type { TSchema } from '../../type/schema/index.mjs' +import type { TArray } from '../../type/array/index.mjs' +import type { TIntersect } from '../../type/intersect/index.mjs' +import type { TNot } from '../../type/not/index.mjs' +import type { TObject } from '../../type/object/index.mjs' +import type { TRecord } from '../../type/record/index.mjs' +import type { TRef } from '../../type/ref/index.mjs' +import type { TThis } from '../../type/recursive/index.mjs' +import type { TTuple } from '../../type/tuple/index.mjs' +import type { TUnion } from '../../type/union/index.mjs' // ------------------------------------------------------------------ // Errors diff --git a/src/value/transform/encode.ts b/src/value/transform/encode.mts similarity index 89% rename from src/value/transform/encode.ts rename to src/value/transform/encode.mts index 6f5f2d71f..bd678385a 100644 --- a/src/value/transform/encode.ts +++ b/src/value/transform/encode.mts @@ -26,25 +26,25 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { TTransform as IsTransformType, TSchema as IsSchemaType } from '../../type/guard/type' -import { Kind, TransformKind } from '../../type/symbols/index' -import { IsPlainObject, IsArray, IsValueType } from '../guard/index' -import { ValueError } from '../../errors/index' -import { KeyOfStringResolve } from '../../type/keyof/index' -import { IndexedTypeResolve } from '../../type/indexed/index' -import { Deref } from '../deref/index' -import { Check } from '../check/index' +import { TTransform as IsTransformType, TSchema as IsSchemaType } from '../../type/guard/type.mjs' +import { Kind, TransformKind } from '../../type/symbols/index.mjs' +import { IsPlainObject, IsArray, IsValueType } from '../guard/index.mjs' +import { ValueError } from '../../errors/index.mjs' +import { KeyOfStringResolve } from '../../type/keyof/index.mjs' +import { IndexedTypeResolve } from '../../type/indexed/index.mjs' +import { Deref } from '../deref/index.mjs' +import { Check } from '../check/index.mjs' -import type { TSchema } from '../../type/schema/index' -import type { TArray } from '../../type/array/index' -import type { TIntersect } from '../../type/intersect/index' -import type { TNot } from '../../type/not/index' -import type { TObject } from '../../type/object/index' -import type { TRecord } from '../../type/record/index' -import type { TRef } from '../../type/ref/index' -import type { TThis } from '../../type/recursive/index' -import type { TTuple } from '../../type/tuple/index' -import type { TUnion } from '../../type/union/index' +import type { TSchema } from '../../type/schema/index.mjs' +import type { TArray } from '../../type/array/index.mjs' +import type { TIntersect } from '../../type/intersect/index.mjs' +import type { TNot } from '../../type/not/index.mjs' +import type { TObject } from '../../type/object/index.mjs' +import type { TRecord } from '../../type/record/index.mjs' +import type { TRef } from '../../type/ref/index.mjs' +import type { TThis } from '../../type/recursive/index.mjs' +import type { TTuple } from '../../type/tuple/index.mjs' +import type { TUnion } from '../../type/union/index.mjs' // ------------------------------------------------------------------ // Errors diff --git a/src/value/transform/has.ts b/src/value/transform/has.mts similarity index 84% rename from src/value/transform/has.ts rename to src/value/transform/has.mts index 03ea4097a..3477c66ae 100644 --- a/src/value/transform/has.ts +++ b/src/value/transform/has.mts @@ -26,26 +26,26 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { TTransform as IsTransformType, TSchema as IsSchemaType } from '../../type/guard/type' -import { IsString, IsUndefined } from '../guard/index' -import { Deref } from '../deref/index' -import { Kind } from '../../type/symbols/index' +import { TTransform as IsTransformType, TSchema as IsSchemaType } from '../../type/guard/type.mjs' +import { IsString, IsUndefined } from '../guard/index.mjs' +import { Deref } from '../deref/index.mjs' +import { Kind } from '../../type/symbols/index.mjs' -import type { TSchema } from '../../type/schema/index' -import type { TArray } from '../../type/array/index' -import type { TAsyncIterator } from '../../type/async-iterator/index' -import type { TConstructor } from '../../type/constructor/index' -import type { TFunction } from '../../type/function/index' -import type { TIntersect } from '../../type/intersect/index' -import type { TIterator } from '../../type/iterator/index' -import type { TNot } from '../../type/not/index' -import type { TObject } from '../../type/object/index' -import type { TPromise } from '../../type/promise/index' -import type { TRecord } from '../../type/record/index' -import type { TRef } from '../../type/ref/index' -import type { TThis } from '../../type/recursive/index' -import type { TTuple } from '../../type/tuple/index' -import type { TUnion } from '../../type/union/index' +import type { TSchema } from '../../type/schema/index.mjs' +import type { TArray } from '../../type/array/index.mjs' +import type { TAsyncIterator } from '../../type/async-iterator/index.mjs' +import type { TConstructor } from '../../type/constructor/index.mjs' +import type { TFunction } from '../../type/function/index.mjs' +import type { TIntersect } from '../../type/intersect/index.mjs' +import type { TIterator } from '../../type/iterator/index.mjs' +import type { TNot } from '../../type/not/index.mjs' +import type { TObject } from '../../type/object/index.mjs' +import type { TPromise } from '../../type/promise/index.mjs' +import type { TRecord } from '../../type/record/index.mjs' +import type { TRef } from '../../type/ref/index.mjs' +import type { TThis } from '../../type/recursive/index.mjs' +import type { TTuple } from '../../type/tuple/index.mjs' +import type { TUnion } from '../../type/union/index.mjs' // prettier-ignore function TArray(schema: TArray, references: TSchema[]): boolean { diff --git a/src/value/transform/index.mts b/src/value/transform/index.mts new file mode 100644 index 000000000..dddc85b27 --- /dev/null +++ b/src/value/transform/index.mts @@ -0,0 +1,31 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * from './decode.mjs' +export * from './encode.mjs' +export * from './has.mjs' diff --git a/src/value/transform/index.ts b/src/value/transform/index.ts deleted file mode 100644 index f821f6d29..000000000 --- a/src/value/transform/index.ts +++ /dev/null @@ -1,31 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * from './decode' -export * from './encode' -export * from './has' diff --git a/src/value/value/index.mts b/src/value/value/index.mts new file mode 100644 index 000000000..580968c3e --- /dev/null +++ b/src/value/value/index.mts @@ -0,0 +1,29 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox/value + +The MIT License (MIT) + +Copyright (c) 2017-2023 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +export * as Value from './value.mjs' diff --git a/src/value/value/index.ts b/src/value/value/index.ts deleted file mode 100644 index 3af158d90..000000000 --- a/src/value/value/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*-------------------------------------------------------------------------- - -@sinclair/typebox/value - -The MIT License (MIT) - -Copyright (c) 2017-2023 Haydn Paterson (sinclair) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ----------------------------------------------------------------------------*/ - -export * as Value from './value' diff --git a/src/value/value/value.ts b/src/value/value/value.mts similarity index 93% rename from src/value/value/value.ts rename to src/value/value/value.mts index 13bbce657..812d30ed3 100644 --- a/src/value/value/value.ts +++ b/src/value/value/value.mts @@ -26,22 +26,22 @@ THE SOFTWARE. ---------------------------------------------------------------------------*/ -import { Decode as DecodeValue, Encode as EncodeValue, TransformDecodeCheckError, TransformEncodeCheckError } from '../transform/index' -import { Mutate as MutateValue, type Mutable } from '../mutate/index' -import { Hash as HashValue } from '../hash/index' -import { Equal as EqualValue } from '../equal/index' -import { Cast as CastValue } from '../cast/index' -import { Clone as CloneValue } from '../clone/index' -import { Convert as ConvertValue } from '../convert/index' -import { Create as CreateValue } from '../create/index' -import { Clean as CleanValue } from '../clean/index' -import { Check as CheckValue } from '../check/index' -import { Default as DefaultValue } from '../default/index' -import { Diff as DiffValue, Patch as PatchValue, Edit } from '../delta/index' -import { Errors as ValueErrors, ValueErrorIterator } from '../../errors/index' +import { Decode as DecodeValue, Encode as EncodeValue, TransformDecodeCheckError, TransformEncodeCheckError } from '../transform/index.mjs' +import { Mutate as MutateValue, type Mutable } from '../mutate/index.mjs' +import { Hash as HashValue } from '../hash/index.mjs' +import { Equal as EqualValue } from '../equal/index.mjs' +import { Cast as CastValue } from '../cast/index.mjs' +import { Clone as CloneValue } from '../clone/index.mjs' +import { Convert as ConvertValue } from '../convert/index.mjs' +import { Create as CreateValue } from '../create/index.mjs' +import { Clean as CleanValue } from '../clean/index.mjs' +import { Check as CheckValue } from '../check/index.mjs' +import { Default as DefaultValue } from '../default/index.mjs' +import { Diff as DiffValue, Patch as PatchValue, Edit } from '../delta/index.mjs' +import { Errors as ValueErrors, ValueErrorIterator } from '../../errors/index.mjs' -import type { TSchema } from '../../type/schema/index' -import type { Static, StaticDecode, StaticEncode } from '../../type/static/index' +import type { TSchema } from '../../type/schema/index.mjs' +import type { Static, StaticDecode, StaticEncode } from '../../type/static/index.mjs' /** Casts a value into a given type. The return value will retain as much information of the original value as possible. */ export function Cast(schema: T, references: TSchema[], value: unknown): Static diff --git a/tsconfig.json b/tsconfig.json index 7b0dea6c6..2da253404 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,18 +1,18 @@ { "compilerOptions": { "strict": true, - "target": "ES2020", - "module": "CommonJS", + "target": "ESNext", + "module": "ESNext", "moduleResolution": "node", "declaration": true, "baseUrl": ".", "paths": { - "@sinclair/typebox/compiler": ["src/compiler/index.ts"], - "@sinclair/typebox/errors": ["src/errors/index.ts"], - "@sinclair/typebox/system": ["src/system/index.ts"], - "@sinclair/typebox/type": ["src/type/index.ts"], - "@sinclair/typebox/value": ["src/value/index.ts"], - "@sinclair/typebox": ["src/index.ts"], + "@sinclair/typebox/compiler": ["src/compiler/index.mts"], + "@sinclair/typebox/errors": ["src/errors/index.mts"], + "@sinclair/typebox/system": ["src/system/index.mts"], + "@sinclair/typebox/type": ["src/type/index.mts"], + "@sinclair/typebox/value": ["src/value/index.mts"], + "@sinclair/typebox": ["src/index.mts"], } } } \ No newline at end of file