From 62ca0cd775784670c47486969013103811d3a618 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Oct 2023 08:45:42 +0000 Subject: [PATCH 1/2] chore: bump @babel/traverse from 7.22.5 to 7.23.2 Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.22.5 to 7.23.2. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 172 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 122 insertions(+), 50 deletions(-) diff --git a/package-lock.json b/package-lock.json index 915784b..237a340 100644 --- a/package-lock.json +++ b/package-lock.json @@ -57,17 +57,89 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", - "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "dependencies": { - "@babel/highlight": "^7.22.5" + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@babel/code-frame/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/code-frame/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/code-frame/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/compat-data": { "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.5.tgz", @@ -123,12 +195,12 @@ } }, "node_modules/@babel/generator": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.5.tgz", - "integrity": "sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5", + "@babel/types": "^7.23.0", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -166,22 +238,22 @@ } }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz", - "integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-function-name": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", - "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, "dependencies": { - "@babel/template": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" @@ -252,9 +324,9 @@ } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.5.tgz", - "integrity": "sha512-thqK5QFghPKWLhAV321lxF95yCg2K3Ob5yw+M3VHWfdia0IkPXUtoLH8x/6Fh486QUvzhb8YOWHChTVen2/PoQ==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "dependencies": { "@babel/types": "^7.22.5" @@ -273,9 +345,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", - "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true, "engines": { "node": ">=6.9.0" @@ -305,13 +377,13 @@ } }, "node_modules/@babel/highlight": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", - "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "engines": { @@ -390,9 +462,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.5.tgz", - "integrity": "sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -579,33 +651,33 @@ } }, "node_modules/@babel/template": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz", - "integrity": "sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.22.5", - "@babel/parser": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.5.tgz", - "integrity": "sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ==", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.22.5", - "@babel/generator": "^7.22.5", - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-function-name": "^7.22.5", + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.5", - "@babel/parser": "^7.22.5", - "@babel/types": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -623,13 +695,13 @@ } }, "node_modules/@babel/types": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, "engines": { From 56184f325caf6c104544f3d9fd22a0d49902f83b Mon Sep 17 00:00:00 2001 From: Paco van der Linden Date: Thu, 26 Oct 2023 11:41:18 +0200 Subject: [PATCH 2/2] chore: bundle using tsup and remove deprecated TypeScript config options (#84) --- .eslintignore | 10 +- .eslintrc.js | 3 +- .gitignore | 12 +- .npmignore | 14 +- api-extractor.json | 2 +- markdown/types.array.md | 2 +- markdown/types.arraytype.md | 2 +- markdown/types.arraytypeconfig.md | 2 +- markdown/types.arrayviolation.md | 2 +- markdown/types.baseobjectliketypeimpl.md | 2 +- markdown/types.basetypeimpl.md | 2 +- markdown/types.basictype.md | 2 +- markdown/types.booleanautocaster.md | 2 +- markdown/types.branded.md | 2 +- markdown/types.createtype.md | 2 +- markdown/types.custommessage.md | 2 +- markdown/types.deepunbranded.md | 2 +- markdown/types.failure.md | 2 +- markdown/types.failuredetails.md | 2 +- markdown/types.fulltype.md | 2 +- markdown/types.interfacetype.md | 2 +- markdown/types.interfacetypeoptions.md | 2 +- markdown/types.intersection.md | 2 +- markdown/types.intersectionoftypetuple.md | 2 +- markdown/types.intersectiontype.md | 2 +- markdown/types.istype.md | 2 +- markdown/types.keyof.md | 2 +- markdown/types.keyoftype.md | 2 +- markdown/types.lengthchecksconfig.md | 2 +- markdown/types.lengthviolation.md | 2 +- markdown/types.literal.md | 2 +- markdown/types.literaltype.md | 2 +- markdown/types.literalvalue.md | 2 +- markdown/types.mergeintersection.md | 2 +- markdown/types.messagedetails.md | 2 +- markdown/types.numberautocaster.md | 2 +- markdown/types.numbertypeconfig.md | 2 +- markdown/types.numberviolation.md | 2 +- markdown/types.object.md | 2 +- markdown/types.objecttype.md | 2 +- markdown/types.oneormore.md | 2 +- markdown/types.parseroptions.md | 2 +- markdown/types.partial.md | 2 +- markdown/types.partialtype.md | 2 +- markdown/types.pattern.md | 2 +- markdown/types.possiblediscriminator.md | 2 +- markdown/types.primitive.md | 2 +- markdown/types.printkey.md | 2 +- markdown/types.printpath.md | 2 +- markdown/types.printvalue.md | 2 +- markdown/types.properties.md | 2 +- markdown/types.propertiesinfo.md | 2 +- markdown/types.propertiesoftypetuple.md | 2 +- markdown/types.record.md | 2 +- markdown/types.recordtype.md | 2 +- markdown/types.reporterror_2.md | 2 +- markdown/types.result.md | 2 +- markdown/types.simpletype.md | 2 +- markdown/types.simpletypeoptions.md | 2 +- markdown/types.stringtypeconfig.md | 2 +- markdown/types.stringviolation.md | 2 +- markdown/types.success.md | 2 +- markdown/types.the.md | 2 +- markdown/types.transposed.md | 2 +- markdown/types.type.md | 2 +- markdown/types.typedpropertyinformation.md | 2 +- markdown/types.typeguardfor.md | 2 +- markdown/types.typeguardresult.md | 2 +- markdown/types.typeimpl.md | 2 +- markdown/types.typelink.md | 2 +- markdown/types.typeof.md | 2 +- markdown/types.typeofproperties.md | 2 +- markdown/types.unbranded.md | 2 +- markdown/types.union.md | 2 +- markdown/types.uniontype.md | 2 +- markdown/types.validationdetails.md | 2 +- markdown/types.validationerror.md | 2 +- markdown/types.validationmode.md | 2 +- markdown/types.validationoptions.md | 2 +- markdown/types.validationresult.md | 2 +- markdown/types.validator.md | 2 +- markdown/types.valueof.md | 4 +- markdown/types.visitor.md | 2 +- markdown/types.withbrands.md | 2 +- markdown/types.writable.md | 2 +- package-lock.json | 781 +++++++++++++++++++++ package.json | 19 +- src/autocast.test.ts | 2 +- src/base-type.test.ts | 8 +- src/base-type.ts | 8 +- src/decorators.test.ts | 2 +- src/error-reporter.test.ts | 4 +- src/error-reporter.ts | 6 +- src/index.ts | 22 +- src/interfaces.ts | 6 +- src/simple-type.test.ts | 8 +- src/simple-type.ts | 4 +- src/testutils.ts | 10 +- src/type-guard.test.ts | 6 +- src/type-guard.ts | 4 +- src/types.test.ts | 12 +- src/types/array.test.ts | 14 +- src/types/array.ts | 8 +- src/types/boolean.test.ts | 4 +- src/types/boolean.ts | 8 +- src/types/index.ts | 22 +- src/types/interface.test.ts | 16 +- src/types/interface.ts | 8 +- src/types/intersection.test.ts | 18 +- src/types/intersection.ts | 12 +- src/types/keyof.test.ts | 10 +- src/types/keyof.ts | 6 +- src/types/literal.test.ts | 6 +- src/types/literal.ts | 12 +- src/types/number.test.ts | 6 +- src/types/number.ts | 8 +- src/types/record.test.ts | 20 +- src/types/record.ts | 8 +- src/types/string.test.ts | 8 +- src/types/string.ts | 6 +- src/types/union.test.ts | 20 +- src/types/union.ts | 6 +- src/types/unknown.test.ts | 4 +- src/types/unknown.ts | 6 +- src/utils/collection-utils.ts | 2 +- src/utils/failure-utils.ts | 6 +- src/utils/index.ts | 12 +- src/utils/print-utils.test.ts | 2 +- src/utils/print-utils.ts | 6 +- src/utils/stringifiers.test.ts | 2 +- src/utils/stringifiers.ts | 2 +- src/utils/type-utils.ts | 2 +- src/validation-error.test.ts | 6 +- src/validation-error.ts | 6 +- tsconfig.json | 10 +- tsconfig.test.json | 4 +- tsup.config.ts | 22 + 137 files changed, 1115 insertions(+), 308 deletions(-) create mode 100644 tsup.config.ts diff --git a/.eslintignore b/.eslintignore index 5d2de66..102f947 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,6 @@ -node_modules -dist -coverage -**/*.js \ No newline at end of file +/node_modules +/build +/dist +/coverage +/*.js +/*.ts \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index fe22250..3f300d8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -11,12 +11,11 @@ const config = { rules: { 'no-fallthrough': 'off', // checked by TS compiler 'object-shorthand': ['error', 'always'], - 'sort-imports': ['error', { ignoreDeclarationSort: true }], + 'sort-imports': ['off'], '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-unused-vars': 'off', '@typescript-eslint/no-invalid-void-type': 'off', '@typescript-eslint/no-throw-literal': 'off', - 'import/extensions': ['error', 'ignorePackages'], }, overrides: [ { diff --git a/.gitignore b/.gitignore index e99cd91..68de174 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ -dist -node_modules -coverage -*.tsbuildinfo -temp +/dist +/node_modules +/coverage +/temp +/build + +*.tsbuildinfo \ No newline at end of file diff --git a/.npmignore b/.npmignore index 5479d0a..5dd169e 100644 --- a/.npmignore +++ b/.npmignore @@ -1,11 +1,17 @@ -.* -node_modules -/*.js +/node_modules /temp +/build /markdown /etc /api-extractor.json -/tsconfig.* /coverage + +/*.js +/*.ts + +tsconfig.* *.tsbuildinfo *.tgz +.* +*.test.ts +testutils.ts \ No newline at end of file diff --git a/api-extractor.json b/api-extractor.json index 292f5dc..7b5ce8e 100644 --- a/api-extractor.json +++ b/api-extractor.json @@ -45,7 +45,7 @@ * * SUPPORTED TOKENS: , , */ - "mainEntryPointFilePath": "/dist/esm/index.d.ts", + "mainEntryPointFilePath": "/dist/index.d.ts", /** * A list of NPM package names whose exports should be treated as part of this package. diff --git a/markdown/types.array.md b/markdown/types.array.md index 05dec08..052de65 100644 --- a/markdown/types.array.md +++ b/markdown/types.array.md @@ -9,7 +9,7 @@ Create a type that checks whether the input is an array and all elements conform **Signature:** ```typescript -export declare function array( +declare function array( ...args: | [name: string, elementType: BaseTypeImpl, typeConfig?: ArrayTypeConfig] | [elementType: BaseTypeImpl, typeConfig?: ArrayTypeConfig] diff --git a/markdown/types.arraytype.md b/markdown/types.arraytype.md index 5cac378..d972bf6 100644 --- a/markdown/types.arraytype.md +++ b/markdown/types.arraytype.md @@ -9,7 +9,7 @@ The implementation behind types created with [array()](./types.array.md) **Signature:** ```typescript -export declare class ArrayType, Element, ResultType extends Element[]> extends BaseTypeImpl +declare class ArrayType, Element, ResultType extends Element[]> extends BaseTypeImpl ``` **Extends:** [BaseTypeImpl](./types.basetypeimpl.md)<ResultType, [ArrayTypeConfig](./types.arraytypeconfig.md)> diff --git a/markdown/types.arraytypeconfig.md b/markdown/types.arraytypeconfig.md index d1a07d0..df2ff81 100644 --- a/markdown/types.arraytypeconfig.md +++ b/markdown/types.arraytypeconfig.md @@ -9,7 +9,7 @@ Configuration of additional checks on array types. **Signature:** ```typescript -export interface ArrayTypeConfig extends LengthChecksConfig +interface ArrayTypeConfig extends LengthChecksConfig ``` **Extends:** [LengthChecksConfig](./types.lengthchecksconfig.md) diff --git a/markdown/types.arrayviolation.md b/markdown/types.arrayviolation.md index a006b7b..48bb8af 100644 --- a/markdown/types.arrayviolation.md +++ b/markdown/types.arrayviolation.md @@ -9,7 +9,7 @@ The supported additional checks on array types. **Signature:** ```typescript -export type ArrayViolation = LengthViolation; +type ArrayViolation = LengthViolation; ``` **References:** [LengthViolation](./types.lengthviolation.md) diff --git a/markdown/types.baseobjectliketypeimpl.md b/markdown/types.baseobjectliketypeimpl.md index ba5f6fb..2ff4876 100644 --- a/markdown/types.baseobjectliketypeimpl.md +++ b/markdown/types.baseobjectliketypeimpl.md @@ -9,7 +9,7 @@ The base implementation for all object-like Types. **Signature:** ```typescript -export declare abstract class BaseObjectLikeTypeImpl extends BaseTypeImpl +declare abstract class BaseObjectLikeTypeImpl extends BaseTypeImpl ``` **Extends:** [BaseTypeImpl](./types.basetypeimpl.md)<ResultType, TypeConfig> diff --git a/markdown/types.basetypeimpl.md b/markdown/types.basetypeimpl.md index 6ef55e4..91bb59a 100644 --- a/markdown/types.basetypeimpl.md +++ b/markdown/types.basetypeimpl.md @@ -9,7 +9,7 @@ The base-class of all type-implementations. **Signature:** ```typescript -export declare abstract class BaseTypeImpl implements TypeLink +declare abstract class BaseTypeImpl implements TypeLink ``` **Implements:** [TypeLink](./types.typelink.md)<ResultType> diff --git a/markdown/types.basictype.md b/markdown/types.basictype.md index 3f7f7c7..b78bbee 100644 --- a/markdown/types.basictype.md +++ b/markdown/types.basictype.md @@ -9,7 +9,7 @@ Basic categories of types. **Signature:** ```typescript -export type BasicType = 'string' | 'number' | 'bigint' | 'boolean' | 'function' | 'object' | 'array' | 'symbol' | 'undefined' | 'null'; +type BasicType = 'string' | 'number' | 'bigint' | 'boolean' | 'function' | 'object' | 'array' | 'symbol' | 'undefined' | 'null'; ``` ## Remarks diff --git a/markdown/types.booleanautocaster.md b/markdown/types.booleanautocaster.md index 58bd67a..5c9da3f 100644 --- a/markdown/types.booleanautocaster.md +++ b/markdown/types.booleanautocaster.md @@ -7,7 +7,7 @@ **Signature:** ```typescript -export declare function booleanAutoCaster(input: unknown): boolean | typeof autoCastFailure; +declare function booleanAutoCaster(input: unknown): boolean | typeof autoCastFailure; ``` ## Parameters diff --git a/markdown/types.branded.md b/markdown/types.branded.md index 28a20b0..ae33e29 100644 --- a/markdown/types.branded.md +++ b/markdown/types.branded.md @@ -9,7 +9,7 @@ Create a Branded type with a given `BrandName`. **Signature:** ```typescript -export type Branded = T extends WithBrands +type Branded = T extends WithBrands ? WithBrands : WithBrands; ``` diff --git a/markdown/types.createtype.md b/markdown/types.createtype.md index 6ccc303..6e42f4c 100644 --- a/markdown/types.createtype.md +++ b/markdown/types.createtype.md @@ -9,7 +9,7 @@ Create a Type from the given type-implementation. **Signature:** ```typescript -export declare function createType>( +declare function createType>( impl: Impl, override?: Partial | 'typeValidator' | 'typeParser', PropertyDescriptor>>, ): TypeImpl; diff --git a/markdown/types.custommessage.md b/markdown/types.custommessage.md index 2158bde..59ac5ed 100644 --- a/markdown/types.custommessage.md +++ b/markdown/types.custommessage.md @@ -9,7 +9,7 @@ The type for optional custom messages **Signature:** ```typescript -export type CustomMessage = undefined | string | ((got: string, input: T, explanation: E) => string); +type CustomMessage = undefined | string | ((got: string, input: T, explanation: E) => string); ``` ## Remarks diff --git a/markdown/types.deepunbranded.md b/markdown/types.deepunbranded.md index d59cf45..571c3b8 100644 --- a/markdown/types.deepunbranded.md +++ b/markdown/types.deepunbranded.md @@ -9,7 +9,7 @@ Unbrand a given type (recursive). **Signature:** ```typescript -export type DeepUnbranded = T extends ReadonlyArray +type DeepUnbranded = T extends ReadonlyArray ? { [P in keyof T & number]: DeepUnbranded; } diff --git a/markdown/types.failure.md b/markdown/types.failure.md index f9fd527..13fd430 100644 --- a/markdown/types.failure.md +++ b/markdown/types.failure.md @@ -9,7 +9,7 @@ A failed validation result. **Signature:** ```typescript -export interface Failure +interface Failure ``` ## Properties diff --git a/markdown/types.failuredetails.md b/markdown/types.failuredetails.md index cfb775b..6fc6d9f 100644 --- a/markdown/types.failuredetails.md +++ b/markdown/types.failuredetails.md @@ -9,7 +9,7 @@ Individual message with info about the performed validation for error-reporting. **Signature:** ```typescript -export type FailureDetails = ValidationDetails & MessageDetails; +type FailureDetails = ValidationDetails & MessageDetails; ``` **References:** [ValidationDetails](./types.validationdetails.md), [MessageDetails](./types.messagedetails.md) diff --git a/markdown/types.fulltype.md b/markdown/types.fulltype.md index bcbd754..6cd4c26 100644 --- a/markdown/types.fulltype.md +++ b/markdown/types.fulltype.md @@ -7,7 +7,7 @@ **Signature:** ```typescript -export type FullType = TypeImpl>>>; +type FullType = TypeImpl>>>; ``` **References:** [Properties](./types.properties.md), [TypeImpl](./types.typeimpl.md), [InterfaceType](./types.interfacetype.md), [TypeOfProperties](./types.typeofproperties.md), [Writable](./types.writable.md) diff --git a/markdown/types.interfacetype.md b/markdown/types.interfacetype.md index 6a4c2f4..97a73db 100644 --- a/markdown/types.interfacetype.md +++ b/markdown/types.interfacetype.md @@ -9,7 +9,7 @@ The implementation behind types created with [object()](./types.object.md) and [ **Signature:** ```typescript -export declare class InterfaceType extends BaseObjectLikeTypeImpl implements TypedPropertyInformation +declare class InterfaceType extends BaseObjectLikeTypeImpl implements TypedPropertyInformation ``` **Extends:** [BaseObjectLikeTypeImpl](./types.baseobjectliketypeimpl.md)<ResultType> diff --git a/markdown/types.interfacetypeoptions.md b/markdown/types.interfacetypeoptions.md index 47b8c6d..86f8152 100644 --- a/markdown/types.interfacetypeoptions.md +++ b/markdown/types.interfacetypeoptions.md @@ -9,7 +9,7 @@ Options for [object()](./types.object.md). **Signature:** ```typescript -export interface InterfaceTypeOptions +interface InterfaceTypeOptions ``` ## Properties diff --git a/markdown/types.intersection.md b/markdown/types.intersection.md index f37d745..e9525d7 100644 --- a/markdown/types.intersection.md +++ b/markdown/types.intersection.md @@ -9,7 +9,7 @@ Intersect the given types. **Signature:** ```typescript -export declare function intersection>>( +declare function intersection>>( ...args: [name: string, types: Types] | [types: Types] ): TypeImpl>; ``` diff --git a/markdown/types.intersectionoftypetuple.md b/markdown/types.intersectionoftypetuple.md index 4c7f3ff..9f3824d 100644 --- a/markdown/types.intersectionoftypetuple.md +++ b/markdown/types.intersectionoftypetuple.md @@ -7,7 +7,7 @@ **Signature:** ```typescript -export type IntersectionOfTypeTuple = Tuple extends [ +type IntersectionOfTypeTuple = Tuple extends [ { readonly [designType]: infer A; }, diff --git a/markdown/types.intersectiontype.md b/markdown/types.intersectiontype.md index f2a3d50..2c45f21 100644 --- a/markdown/types.intersectiontype.md +++ b/markdown/types.intersectiontype.md @@ -9,7 +9,7 @@ The implementation behind types created with [intersection()](./types.intersecti **Signature:** ```typescript -export declare class IntersectionType>> extends BaseObjectLikeTypeImpl, undefined> implements TypedPropertyInformation> +declare class IntersectionType>> extends BaseObjectLikeTypeImpl, undefined> implements TypedPropertyInformation> ``` **Extends:** [BaseObjectLikeTypeImpl](./types.baseobjectliketypeimpl.md)<[IntersectionOfTypeTuple](./types.intersectionoftypetuple.md)<Types>, undefined> diff --git a/markdown/types.istype.md b/markdown/types.istype.md index 783300a..dee85fa 100644 --- a/markdown/types.istype.md +++ b/markdown/types.istype.md @@ -9,7 +9,7 @@ Type-guard that asserts that a given value is a Type. **Signature:** ```typescript -export declare function isType(value: unknown): value is Type; +declare function isType(value: unknown): value is Type; ``` ## Parameters diff --git a/markdown/types.keyof.md b/markdown/types.keyof.md index d0c20d0..090beb2 100644 --- a/markdown/types.keyof.md +++ b/markdown/types.keyof.md @@ -7,7 +7,7 @@ **Signature:** ```typescript -export declare function keyof>(...args: [name: string, keys: T] | [keys: T]): TypeImpl>; +declare function keyof>(...args: [name: string, keys: T] | [keys: T]): TypeImpl>; ``` ## Parameters diff --git a/markdown/types.keyoftype.md b/markdown/types.keyoftype.md index 2b17522..98091b3 100644 --- a/markdown/types.keyoftype.md +++ b/markdown/types.keyoftype.md @@ -9,7 +9,7 @@ The implementation behind types created with [keyof()](./types.keyof.md) and [va **Signature:** ```typescript -export declare class KeyofType, ResultType extends keyof T = keyof T> extends BaseTypeImpl +declare class KeyofType, ResultType extends keyof T = keyof T> extends BaseTypeImpl ``` **Extends:** [BaseTypeImpl](./types.basetypeimpl.md)<ResultType> diff --git a/markdown/types.lengthchecksconfig.md b/markdown/types.lengthchecksconfig.md index 12423e3..cf91700 100644 --- a/markdown/types.lengthchecksconfig.md +++ b/markdown/types.lengthchecksconfig.md @@ -7,7 +7,7 @@ **Signature:** ```typescript -export interface LengthChecksConfig +interface LengthChecksConfig ``` ## Properties diff --git a/markdown/types.lengthviolation.md b/markdown/types.lengthviolation.md index 97803af..4c26788 100644 --- a/markdown/types.lengthviolation.md +++ b/markdown/types.lengthviolation.md @@ -7,5 +7,5 @@ **Signature:** ```typescript -export type LengthViolation = 'minLength' | 'maxLength'; +type LengthViolation = 'minLength' | 'maxLength'; ``` diff --git a/markdown/types.literal.md b/markdown/types.literal.md index 9160a05..5a10832 100644 --- a/markdown/types.literal.md +++ b/markdown/types.literal.md @@ -7,7 +7,7 @@ **Signature:** ```typescript -export declare function literal(value: T): TypeImpl>; +declare function literal(value: T): TypeImpl>; ``` ## Parameters diff --git a/markdown/types.literaltype.md b/markdown/types.literaltype.md index d4503e5..c6aa146 100644 --- a/markdown/types.literaltype.md +++ b/markdown/types.literaltype.md @@ -9,7 +9,7 @@ The implementation behind types created with [literal()](./types.literal.md) and **Signature:** ```typescript -export declare class LiteralType extends BaseTypeImpl +declare class LiteralType extends BaseTypeImpl ``` **Extends:** [BaseTypeImpl](./types.basetypeimpl.md)<ResultType> diff --git a/markdown/types.literalvalue.md b/markdown/types.literalvalue.md index e6a0edd..a1f20dd 100644 --- a/markdown/types.literalvalue.md +++ b/markdown/types.literalvalue.md @@ -9,5 +9,5 @@ The supported types of literals. **Signature:** ```typescript -export type LiteralValue = string | number | boolean | null | undefined | void; +type LiteralValue = string | number | boolean | null | undefined | void; ``` diff --git a/markdown/types.mergeintersection.md b/markdown/types.mergeintersection.md index 3839268..94f1fcb 100644 --- a/markdown/types.mergeintersection.md +++ b/markdown/types.mergeintersection.md @@ -9,7 +9,7 @@ Merge an intersection of types into one type, mostly for tooltip-readability in **Signature:** ```typescript -export type MergeIntersection = T extends Record +type MergeIntersection = T extends Record ? { [P in keyof T]: T[P]; } & {} diff --git a/markdown/types.messagedetails.md b/markdown/types.messagedetails.md index 8ad54bb..bbdcdf8 100644 --- a/markdown/types.messagedetails.md +++ b/markdown/types.messagedetails.md @@ -9,7 +9,7 @@ Individual message details with optional info about the performed validation. **Signature:** ```typescript -export type MessageDetails = Partial & { +type MessageDetails = Partial & { path?: PropertyKey[]; context?: string; omitInput?: boolean; diff --git a/markdown/types.numberautocaster.md b/markdown/types.numberautocaster.md index dc5c702..e10799f 100644 --- a/markdown/types.numberautocaster.md +++ b/markdown/types.numberautocaster.md @@ -7,7 +7,7 @@ **Signature:** ```typescript -export declare function numberAutoCaster(input: unknown): number | typeof autoCastFailure; +declare function numberAutoCaster(input: unknown): number | typeof autoCastFailure; ``` ## Parameters diff --git a/markdown/types.numbertypeconfig.md b/markdown/types.numbertypeconfig.md index 8340bbd..7b39c7c 100644 --- a/markdown/types.numbertypeconfig.md +++ b/markdown/types.numbertypeconfig.md @@ -9,7 +9,7 @@ Configuration of additional checks on numeric types. **Signature:** ```typescript -export type NumberTypeConfig = { +type NumberTypeConfig = { multipleOf?: number; customMessage?: CustomMessage | Partial>>; } & ( diff --git a/markdown/types.numberviolation.md b/markdown/types.numberviolation.md index 3264dd1..315ad30 100644 --- a/markdown/types.numberviolation.md +++ b/markdown/types.numberviolation.md @@ -9,5 +9,5 @@ The supported additional checks on numeric types. **Signature:** ```typescript -export type NumberViolation = 'min' | 'max' | 'multipleOf'; +type NumberViolation = 'min' | 'max' | 'multipleOf'; ``` diff --git a/markdown/types.object.md b/markdown/types.object.md index a31985a..94e3a14 100644 --- a/markdown/types.object.md +++ b/markdown/types.object.md @@ -9,7 +9,7 @@ Create a type-validator that validates (or parses) an object structure. **Signature:** ```typescript -export declare function object( +declare function object( ...args: [props: Props] | [name: string, props: Props] | [options: InterfaceTypeOptions, props: Props] ): FullType; ``` diff --git a/markdown/types.objecttype.md b/markdown/types.objecttype.md index a0bb56d..6651280 100644 --- a/markdown/types.objecttype.md +++ b/markdown/types.objecttype.md @@ -9,7 +9,7 @@ A type-validator/-parser that validates or parses object-like type `ResultType`< **Signature:** ```typescript -export type ObjectType = TypeImpl>; +type ObjectType = TypeImpl>; ``` **References:** [TypeImpl](./types.typeimpl.md), [BaseObjectLikeTypeImpl](./types.baseobjectliketypeimpl.md) diff --git a/markdown/types.oneormore.md b/markdown/types.oneormore.md index 45966e4..5b9fb7f 100644 --- a/markdown/types.oneormore.md +++ b/markdown/types.oneormore.md @@ -9,5 +9,5 @@ An Array with at least one element. **Signature:** ```typescript -export type OneOrMore = [T, ...T[]]; +type OneOrMore = [T, ...T[]]; ``` diff --git a/markdown/types.parseroptions.md b/markdown/types.parseroptions.md index 1c1a091..090d02e 100644 --- a/markdown/types.parseroptions.md +++ b/markdown/types.parseroptions.md @@ -9,7 +9,7 @@ Options that can be passed to [BaseTypeImpl.withParser()](./types.basetypeimpl.w **Signature:** ```typescript -export interface ParserOptions +interface ParserOptions ``` ## Properties diff --git a/markdown/types.partial.md b/markdown/types.partial.md index 7618ac3..088a99e 100644 --- a/markdown/types.partial.md +++ b/markdown/types.partial.md @@ -9,7 +9,7 @@ Create a type-validator that validates (or parses) an object structure with only **Signature:** ```typescript -export declare function partial( +declare function partial( ...args: [props: Props] | [name: string, props: Props] | [options: Omit, props: Props] ): PartialType; ``` diff --git a/markdown/types.partialtype.md b/markdown/types.partialtype.md index 897bc37..d26c98a 100644 --- a/markdown/types.partialtype.md +++ b/markdown/types.partialtype.md @@ -7,7 +7,7 @@ **Signature:** ```typescript -export type PartialType = TypeImpl>>>>; +type PartialType = TypeImpl>>>>; ``` **References:** [Properties](./types.properties.md), [TypeImpl](./types.typeimpl.md), [InterfaceType](./types.interfacetype.md), [TypeOfProperties](./types.typeofproperties.md), [Writable](./types.writable.md) diff --git a/markdown/types.pattern.md b/markdown/types.pattern.md index 6da5cbb..e3421aa 100644 --- a/markdown/types.pattern.md +++ b/markdown/types.pattern.md @@ -7,7 +7,7 @@ **Signature:** ```typescript -export declare function pattern( +declare function pattern( name: BrandName, regExp: RegExp, customMessage?: StringTypeConfig['customMessage'], diff --git a/markdown/types.possiblediscriminator.md b/markdown/types.possiblediscriminator.md index 3c68263..424308b 100644 --- a/markdown/types.possiblediscriminator.md +++ b/markdown/types.possiblediscriminator.md @@ -9,7 +9,7 @@ A description of the property-paths and possible values that might be used to id **Signature:** ```typescript -export type PossibleDiscriminator = { +type PossibleDiscriminator = { readonly path: readonly string[]; readonly values: readonly LiteralValue[]; readonly mapping?: ReadonlyArray<{ diff --git a/markdown/types.primitive.md b/markdown/types.primitive.md index c9ed6c0..854faea 100644 --- a/markdown/types.primitive.md +++ b/markdown/types.primitive.md @@ -7,7 +7,7 @@ **Signature:** ```typescript -export type Primitive = LiteralValue | bigint | symbol; +type Primitive = LiteralValue | bigint | symbol; ``` **References:** [LiteralValue](./types.literalvalue.md) diff --git a/markdown/types.printkey.md b/markdown/types.printkey.md index 1c09de7..1924531 100644 --- a/markdown/types.printkey.md +++ b/markdown/types.printkey.md @@ -9,7 +9,7 @@ Print a property-key in a JavaScript compatible way. **Signature:** ```typescript -export declare function printKey(key: string): string; +declare function printKey(key: string): string; ``` ## Parameters diff --git a/markdown/types.printpath.md b/markdown/types.printpath.md index bbd9225..688dae0 100644 --- a/markdown/types.printpath.md +++ b/markdown/types.printpath.md @@ -9,7 +9,7 @@ Print a property-path in a "JavaScripty way". **Signature:** ```typescript -export declare function printPath(path: ReadonlyArray): string; +declare function printPath(path: ReadonlyArray): string; ``` ## Parameters diff --git a/markdown/types.printvalue.md b/markdown/types.printvalue.md index c70b69e..a7c224c 100644 --- a/markdown/types.printvalue.md +++ b/markdown/types.printvalue.md @@ -9,7 +9,7 @@ Print an unknown value with a given character budget (default: 50). **Signature:** ```typescript -export declare function printValue(input: unknown, budget?: number, visited?: Set): string; +declare function printValue(input: unknown, budget?: number, visited?: Set): string; ``` ## Parameters diff --git a/markdown/types.properties.md b/markdown/types.properties.md index 3631195..fd2e539 100644 --- a/markdown/types.properties.md +++ b/markdown/types.properties.md @@ -9,7 +9,7 @@ The properties of an object type. **Signature:** ```typescript -export type Properties = Record>; +type Properties = Record>; ``` **References:** [Type](./types.type.md) diff --git a/markdown/types.propertiesinfo.md b/markdown/types.propertiesinfo.md index 48faed5..d60e33f 100644 --- a/markdown/types.propertiesinfo.md +++ b/markdown/types.propertiesinfo.md @@ -9,7 +9,7 @@ Properties of an object type, including per-property optionality. **Signature:** ```typescript -export type PropertiesInfo = { +type PropertiesInfo = { [Key in keyof Props]: { partial: boolean; type: Props[Key]; diff --git a/markdown/types.propertiesoftypetuple.md b/markdown/types.propertiesoftypetuple.md index cdc9b3f..843d388 100644 --- a/markdown/types.propertiesoftypetuple.md +++ b/markdown/types.propertiesoftypetuple.md @@ -7,7 +7,7 @@ **Signature:** ```typescript -export type PropertiesOfTypeTuple = Tuple extends [ +type PropertiesOfTypeTuple = Tuple extends [ { readonly props: infer A; }, diff --git a/markdown/types.record.md b/markdown/types.record.md index 839cd57..8d66536 100644 --- a/markdown/types.record.md +++ b/markdown/types.record.md @@ -9,7 +9,7 @@ Note: record has strict validation by default, while type does not have strict v **Signature:** ```typescript -export declare function record( +declare function record( ...args: | [name: string, keyType: BaseTypeImpl, valueType: BaseTypeImpl, strict?: boolean] | [keyType: BaseTypeImpl, valueType: BaseTypeImpl, strict?: boolean] diff --git a/markdown/types.recordtype.md b/markdown/types.recordtype.md index aa479de..482fc31 100644 --- a/markdown/types.recordtype.md +++ b/markdown/types.recordtype.md @@ -9,7 +9,7 @@ The implementation behind types created with [record()](./types.record.md)<ResultType> diff --git a/markdown/types.reporterror_2.md b/markdown/types.reporterror_2.md index 79831b0..58200b7 100644 --- a/markdown/types.reporterror_2.md +++ b/markdown/types.reporterror_2.md @@ -9,7 +9,7 @@ Creates an human-readable error report of the given failure. **Signature:** ```typescript -export declare function reportError(root: Failure, level?: number, omitInput?: boolean): string; +declare function reportError(root: Failure, level?: number, omitInput?: boolean): string; ``` ## Parameters diff --git a/markdown/types.result.md b/markdown/types.result.md index 4d5fea2..9185b5c 100644 --- a/markdown/types.result.md +++ b/markdown/types.result.md @@ -9,7 +9,7 @@ The result of a type validation. **Signature:** ```typescript -export type Result = Success | Failure; +type Result = Success | Failure; ``` **References:** [Success](./types.success.md), [Failure](./types.failure.md) diff --git a/markdown/types.simpletype.md b/markdown/types.simpletype.md index 2c10374..944d63f 100644 --- a/markdown/types.simpletype.md +++ b/markdown/types.simpletype.md @@ -9,7 +9,7 @@ Implementation for simple types such as primitive types. **Signature:** ```typescript -export declare class SimpleType extends BaseTypeImpl +declare class SimpleType extends BaseTypeImpl ``` **Extends:** [BaseTypeImpl](./types.basetypeimpl.md)<ResultType, TypeConfig> diff --git a/markdown/types.simpletypeoptions.md b/markdown/types.simpletypeoptions.md index 6febb1d..bdd1fb2 100644 --- a/markdown/types.simpletypeoptions.md +++ b/markdown/types.simpletypeoptions.md @@ -7,7 +7,7 @@ **Signature:** ```typescript -export interface SimpleTypeOptions +interface SimpleTypeOptions ``` ## Properties diff --git a/markdown/types.stringtypeconfig.md b/markdown/types.stringtypeconfig.md index f17b741..52dbb7e 100644 --- a/markdown/types.stringtypeconfig.md +++ b/markdown/types.stringtypeconfig.md @@ -9,7 +9,7 @@ Configuration of additional checks on string types. **Signature:** ```typescript -export interface StringTypeConfig extends LengthChecksConfig +interface StringTypeConfig extends LengthChecksConfig ``` **Extends:** [LengthChecksConfig](./types.lengthchecksconfig.md) diff --git a/markdown/types.stringviolation.md b/markdown/types.stringviolation.md index ee88fe6..57e5d80 100644 --- a/markdown/types.stringviolation.md +++ b/markdown/types.stringviolation.md @@ -9,7 +9,7 @@ The supported additional checks on string types. **Signature:** ```typescript -export type StringViolation = 'pattern' | LengthViolation; +type StringViolation = 'pattern' | LengthViolation; ``` **References:** [LengthViolation](./types.lengthviolation.md) diff --git a/markdown/types.success.md b/markdown/types.success.md index 537a5b4..f231a3b 100644 --- a/markdown/types.success.md +++ b/markdown/types.success.md @@ -9,7 +9,7 @@ A successful validation result. **Signature:** ```typescript -export interface Success +interface Success ``` ## Properties diff --git a/markdown/types.the.md b/markdown/types.the.md index 0be846a..6e84574 100644 --- a/markdown/types.the.md +++ b/markdown/types.the.md @@ -9,7 +9,7 @@ Obtains the TypeScript type of the given runtime Type-checker. Aka [TypeOf](./ty **Signature:** ```typescript -export type The = TypeOf; +type The = TypeOf; ``` **References:** [TypeOf](./types.typeof.md) diff --git a/markdown/types.transposed.md b/markdown/types.transposed.md index d3424da..cbc34fe 100644 --- a/markdown/types.transposed.md +++ b/markdown/types.transposed.md @@ -7,5 +7,5 @@ **Signature:** ```typescript -export type Transposed> = Record; +type Transposed> = Record; ``` diff --git a/markdown/types.type.md b/markdown/types.type.md index 543346a..c2ea60d 100644 --- a/markdown/types.type.md +++ b/markdown/types.type.md @@ -9,7 +9,7 @@ A type-validator/-parser that validates or parses `ResultType`. **Signature:** ```typescript -export type Type = TypeImpl>; +type Type = TypeImpl>; ``` **References:** [TypeImpl](./types.typeimpl.md), [BaseTypeImpl](./types.basetypeimpl.md) diff --git a/markdown/types.typedpropertyinformation.md b/markdown/types.typedpropertyinformation.md index b892282..4f5e888 100644 --- a/markdown/types.typedpropertyinformation.md +++ b/markdown/types.typedpropertyinformation.md @@ -9,7 +9,7 @@ Interface that provides more detailed type-information about the `props` and `pr **Signature:** ```typescript -export interface TypedPropertyInformation +interface TypedPropertyInformation ``` ## Properties diff --git a/markdown/types.typeguardfor.md b/markdown/types.typeguardfor.md index 81c0ca0..31cf811 100644 --- a/markdown/types.typeguardfor.md +++ b/markdown/types.typeguardfor.md @@ -9,7 +9,7 @@ The type of the type-guard that comes with each Type (the \#is method). **Signature:** ```typescript -export type TypeguardFor = (this: void, input: Input) => input is TypeguardResult; +type TypeguardFor = (this: void, input: Input) => input is TypeguardResult; ``` **References:** [TypeguardResult](./types.typeguardresult.md) diff --git a/markdown/types.typeguardresult.md b/markdown/types.typeguardresult.md index 7c45007..14f2509 100644 --- a/markdown/types.typeguardresult.md +++ b/markdown/types.typeguardresult.md @@ -9,7 +9,7 @@ The resulting type of a typeguard based on the `ResultType` of the Type and the **Signature:** ```typescript -export type TypeguardResult = unknown extends Input +type TypeguardResult = unknown extends Input ? Input & ResultType : [Extract] extends [never] ? Input & ResultType diff --git a/markdown/types.typeimpl.md b/markdown/types.typeimpl.md index be228b5..621b468 100644 --- a/markdown/types.typeimpl.md +++ b/markdown/types.typeimpl.md @@ -9,7 +9,7 @@ The Type with the given type implementation. **Signature:** ```typescript -export type TypeImpl> = Impl & { +type TypeImpl> = Impl & { new (input: unknown): TypeOf; (this: void, input: unknown): TypeOf; }; diff --git a/markdown/types.typelink.md b/markdown/types.typelink.md index ca7177f..88c8672 100644 --- a/markdown/types.typelink.md +++ b/markdown/types.typelink.md @@ -9,7 +9,7 @@ An object that has an associated TypeScript type. **Signature:** ```typescript -export interface TypeLink +interface TypeLink ``` ## Properties diff --git a/markdown/types.typeof.md b/markdown/types.typeof.md index 77698b7..018caef 100644 --- a/markdown/types.typeof.md +++ b/markdown/types.typeof.md @@ -9,7 +9,7 @@ Obtains the TypeScript type of the given runtime Type-checker. Aka [The](./types **Signature:** ```typescript -export type TypeOf = T extends { +type TypeOf = T extends { readonly [designType]: infer Q; } ? Q diff --git a/markdown/types.typeofproperties.md b/markdown/types.typeofproperties.md index bc99104..3c6ff49 100644 --- a/markdown/types.typeofproperties.md +++ b/markdown/types.typeofproperties.md @@ -9,7 +9,7 @@ Translates the type of a Properties-object into the proper TypeScript type to be **Signature:** ```typescript -export type TypeOfProperties = { +type TypeOfProperties = { [P in keyof T]: MergeIntersection>; }; ``` diff --git a/markdown/types.unbranded.md b/markdown/types.unbranded.md index 7c62507..12d2872 100644 --- a/markdown/types.unbranded.md +++ b/markdown/types.unbranded.md @@ -9,7 +9,7 @@ Unbrand a given type (not recursive). **Signature:** ```typescript -export type Unbranded = T extends WithBrands ? Base : T; +type Unbranded = T extends WithBrands ? Base : T; ``` **References:** [WithBrands](./types.withbrands.md) diff --git a/markdown/types.union.md b/markdown/types.union.md index c2b00cd..c4b9589 100644 --- a/markdown/types.union.md +++ b/markdown/types.union.md @@ -7,7 +7,7 @@ **Signature:** ```typescript -export declare function union>>( +declare function union>>( ...args: [name: string, types: Types] | [types: Types] ): TypeImpl>; ``` diff --git a/markdown/types.uniontype.md b/markdown/types.uniontype.md index 8978d0a..275cff3 100644 --- a/markdown/types.uniontype.md +++ b/markdown/types.uniontype.md @@ -9,7 +9,7 @@ The implementation behind types created with [union()](./types.union.md) and [Ba **Signature:** ```typescript -export declare class UnionType>, ResultType extends TypeOf = TypeOf> extends BaseObjectLikeTypeImpl +declare class UnionType>, ResultType extends TypeOf = TypeOf> extends BaseObjectLikeTypeImpl ``` **Extends:** [BaseObjectLikeTypeImpl](./types.baseobjectliketypeimpl.md)<ResultType> diff --git a/markdown/types.validationdetails.md b/markdown/types.validationdetails.md index d223345..7f159e2 100644 --- a/markdown/types.validationdetails.md +++ b/markdown/types.validationdetails.md @@ -9,7 +9,7 @@ Information about the performed validation for error-reporting. **Signature:** ```typescript -export type ValidationDetails = { +type ValidationDetails = { type: BaseTypeImpl; input: unknown; parserInput?: unknown; diff --git a/markdown/types.validationerror.md b/markdown/types.validationerror.md index a71249e..3a23910 100644 --- a/markdown/types.validationerror.md +++ b/markdown/types.validationerror.md @@ -9,7 +9,7 @@ The error that is thrown on any validation- or parse-error within this library. **Signature:** ```typescript -export declare class ValidationError extends Error implements Failure +declare class ValidationError extends Error implements Failure ``` **Extends:** Error diff --git a/markdown/types.validationmode.md b/markdown/types.validationmode.md index a3bffdf..85b7d25 100644 --- a/markdown/types.validationmode.md +++ b/markdown/types.validationmode.md @@ -9,7 +9,7 @@ The validation mode to use. **Signature:** ```typescript -export type ValidationMode = 'check' | 'construct'; +type ValidationMode = 'check' | 'construct'; ``` ## Remarks diff --git a/markdown/types.validationoptions.md b/markdown/types.validationoptions.md index d921300..5a672f9 100644 --- a/markdown/types.validationoptions.md +++ b/markdown/types.validationoptions.md @@ -7,7 +7,7 @@ **Signature:** ```typescript -export interface ValidationOptions +interface ValidationOptions ``` ## Properties diff --git a/markdown/types.validationresult.md b/markdown/types.validationresult.md index eb55315..0aa38ba 100644 --- a/markdown/types.validationresult.md +++ b/markdown/types.validationresult.md @@ -9,7 +9,7 @@ The possible return values inside validation and constraint functions. **Signature:** ```typescript -export type ValidationResult = boolean | string | MessageDetails | Array; +type ValidationResult = boolean | string | MessageDetails | Array; ``` **References:** [MessageDetails](./types.messagedetails.md) diff --git a/markdown/types.validator.md b/markdown/types.validator.md index 2d165fb..543f333 100644 --- a/markdown/types.validator.md +++ b/markdown/types.validator.md @@ -9,7 +9,7 @@ The validation-logic as needed by [BaseTypeImpl.withConstraint()](./types.basety **Signature:** ```typescript -export type Validator = (input: ResultType, options: ValidationOptions) => ValidationResult; +type Validator = (input: ResultType, options: ValidationOptions) => ValidationResult; ``` **References:** [ValidationOptions](./types.validationoptions.md), [ValidationResult](./types.validationresult.md) diff --git a/markdown/types.valueof.md b/markdown/types.valueof.md index 01e0401..5a8cc96 100644 --- a/markdown/types.valueof.md +++ b/markdown/types.valueof.md @@ -7,9 +7,7 @@ **Signature:** ```typescript -export declare function valueof>( - ...args: [name: string, obj: T] | [obj: T] -): TypeImpl>>; +declare function valueof>(...args: [name: string, obj: T] | [obj: T]): TypeImpl>>; ``` ## Parameters diff --git a/markdown/types.visitor.md b/markdown/types.visitor.md index 9ec1c61..7c0593a 100644 --- a/markdown/types.visitor.md +++ b/markdown/types.visitor.md @@ -9,7 +9,7 @@ Interface for a visitor that is accepted by all types (classic visitor-pattern). **Signature:** ```typescript -export interface Visitor +interface Visitor ``` ## Methods diff --git a/markdown/types.withbrands.md b/markdown/types.withbrands.md index 6c2711a..7c9da1a 100644 --- a/markdown/types.withbrands.md +++ b/markdown/types.withbrands.md @@ -7,7 +7,7 @@ **Signature:** ```typescript -export type WithBrands = T & { +type WithBrands = T & { readonly [brands]: { [P in BrandNames]: true; }; diff --git a/markdown/types.writable.md b/markdown/types.writable.md index 4848145..12757ac 100644 --- a/markdown/types.writable.md +++ b/markdown/types.writable.md @@ -9,7 +9,7 @@ The opposite of the built-in `Readonly<...>` type. **Signature:** ```typescript -export type Writable = { +type Writable = { -readonly [P in keyof T]: T[P]; }; ``` diff --git a/package-lock.json b/package-lock.json index 237a340..c7872d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,11 @@ "reflect-metadata": "^0.1.13", "semantic-release": "^22.0.5", "ts-jest": "^29.1.1", + "tsup": "^7.2.0", "typescript": "^5.2.2" + }, + "peerDependencies": { + "typescript": ">=5.1" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -724,6 +728,358 @@ "node": ">=0.1.90" } }, + "node_modules/@esbuild/android-arm": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", + "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", + "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", + "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", + "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", + "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", + "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", + "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", + "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", + "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", + "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", + "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", + "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", + "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", + "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", + "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", + "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", + "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", + "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", + "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", + "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", + "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", + "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -2642,6 +2998,12 @@ "integrity": "sha512-QXu7BPrP29VllRxH8GwB7x5iX5qWKAAMLqKQGWTeLWVlNHNOpVMJ91dsxQAIWXpjuW5wqvxu3Jd/nRjrJ+0pqg==", "dev": true }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true + }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -2920,6 +3282,15 @@ "url": "https://opencollective.com/bigjs" } }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/bottleneck": { "version": "2.19.5", "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", @@ -3007,6 +3378,30 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "node_modules/bundle-require": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-4.0.2.tgz", + "integrity": "sha512-jwzPOChofl67PSTW2SGubV9HBQAhhR2i6nskiOThauo9dzwDUgOWQScFVaJkjEfYX+UXiD+LEx8EblQMc2wIag==", + "dev": true, + "dependencies": { + "load-tsconfig": "^0.2.3" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "peerDependencies": { + "esbuild": ">=0.17" + } + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -3096,6 +3491,45 @@ "node": ">=10" } }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/ci-info": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", @@ -3854,6 +4288,43 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/esbuild": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", + "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.18.20", + "@esbuild/android-arm64": "0.18.20", + "@esbuild/android-x64": "0.18.20", + "@esbuild/darwin-arm64": "0.18.20", + "@esbuild/darwin-x64": "0.18.20", + "@esbuild/freebsd-arm64": "0.18.20", + "@esbuild/freebsd-x64": "0.18.20", + "@esbuild/linux-arm": "0.18.20", + "@esbuild/linux-arm64": "0.18.20", + "@esbuild/linux-ia32": "0.18.20", + "@esbuild/linux-loong64": "0.18.20", + "@esbuild/linux-mips64el": "0.18.20", + "@esbuild/linux-ppc64": "0.18.20", + "@esbuild/linux-riscv64": "0.18.20", + "@esbuild/linux-s390x": "0.18.20", + "@esbuild/linux-x64": "0.18.20", + "@esbuild/netbsd-x64": "0.18.20", + "@esbuild/openbsd-x64": "0.18.20", + "@esbuild/sunos-x64": "0.18.20", + "@esbuild/win32-arm64": "0.18.20", + "@esbuild/win32-ia32": "0.18.20", + "@esbuild/win32-x64": "0.18.20" + } + }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -4996,6 +5467,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/is-boolean-object": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", @@ -5968,6 +6451,15 @@ "integrity": "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==", "dev": true }, + "node_modules/joycon": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", + "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -6106,6 +6598,15 @@ "node": ">= 0.8.0" } }, + "node_modules/lilconfig": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", + "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -6149,6 +6650,15 @@ "node": ">=4" } }, + "node_modules/load-tsconfig": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz", + "integrity": "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -6224,6 +6734,12 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, + "node_modules/lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==", + "dev": true + }, "node_modules/lodash.uniqby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz", @@ -6437,6 +6953,17 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -10045,6 +10572,15 @@ "inBundle": true, "license": "ISC" }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/object-inspect": { "version": "1.12.3", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", @@ -10534,6 +11070,35 @@ "node": ">=8" } }, + "node_modules/postcss-load-config": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.1.tgz", + "integrity": "sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==", + "dev": true, + "dependencies": { + "lilconfig": "^2.0.5", + "yaml": "^2.1.1" + }, + "engines": { + "node": ">= 14" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": ">=8.0.9", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -10939,6 +11504,18 @@ "util-deprecate": "~1.0.1" } }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, "node_modules/redeyed": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/redeyed/-/redeyed-2.1.1.tgz", @@ -11073,6 +11650,22 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/rollup": { + "version": "3.29.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.3.tgz", + "integrity": "sha512-T7du6Hum8jOkSWetjRgbwpM6Sy0nECYrYRSmZjayFcOddtKJWU4d17AC3HNUk7HRuqy4p+G7aEZclSHytqUmEg==", + "dev": true, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=14.18.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -11889,6 +12482,57 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/sucrase": { + "version": "3.34.0", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.34.0.tgz", + "integrity": "sha512-70/LQEZ07TEcxiU2dz51FKaE6hCTWC6vr7FOk3Gr0U60C3shtAN+H+BFr9XlYe5xqf3RA8nrc+VIwzCfnxuXJw==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "glob": "7.1.6", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/sucrase/node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/sucrase/node_modules/glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -12009,6 +12653,27 @@ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -12067,6 +12732,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "bin": { + "tree-kill": "cli.js" + } + }, "node_modules/ts-api-utils": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", @@ -12079,6 +12753,12 @@ "typescript": ">=4.2.0" } }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", + "dev": true + }, "node_modules/ts-jest": { "version": "29.1.1", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.1.tgz", @@ -12169,6 +12849,98 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "node_modules/tsup": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/tsup/-/tsup-7.2.0.tgz", + "integrity": "sha512-vDHlczXbgUvY3rWvqFEbSqmC1L7woozbzngMqTtL2PGBODTtWlRwGDDawhvWzr5c1QjKe4OAKqJGfE1xeXUvtQ==", + "dev": true, + "dependencies": { + "bundle-require": "^4.0.0", + "cac": "^6.7.12", + "chokidar": "^3.5.1", + "debug": "^4.3.1", + "esbuild": "^0.18.2", + "execa": "^5.0.0", + "globby": "^11.0.3", + "joycon": "^3.0.1", + "postcss-load-config": "^4.0.1", + "resolve-from": "^5.0.0", + "rollup": "^3.2.5", + "source-map": "0.8.0-beta.0", + "sucrase": "^3.20.3", + "tree-kill": "^1.2.2" + }, + "bin": { + "tsup": "dist/cli-default.js", + "tsup-node": "dist/cli-node.js" + }, + "engines": { + "node": ">=16.14" + }, + "peerDependencies": { + "@swc/core": "^1", + "postcss": "^8.4.12", + "typescript": ">=4.1.0" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "postcss": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/tsup/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/tsup/node_modules/source-map": { + "version": "0.8.0-beta.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", + "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==", + "dev": true, + "dependencies": { + "whatwg-url": "^7.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/tsup/node_modules/tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/tsup/node_modules/webidl-conversions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "dev": true + }, + "node_modules/tsup/node_modules/whatwg-url": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", + "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", + "dev": true, + "dependencies": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -12581,6 +13353,15 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true }, + "node_modules/yaml": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.2.tgz", + "integrity": "sha512-N/lyzTPaJasoDmfV7YTrYCI0G/3ivm/9wdG0aHuheKowWQwGTsK0Eoiw6utmzAnI6pkJa0DUVygvp3spqqEKXg==", + "dev": true, + "engines": { + "node": ">= 14" + } + }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", diff --git a/package.json b/package.json index 5eaf803..86907ef 100644 --- a/package.json +++ b/package.json @@ -2,22 +2,22 @@ "name": "@skunkteam/types", "version": "0.0.0-development", "description": "Runtime type-validation with TypeScript support", - "main": "dist/cjs/index.js", - "module": "dist/esm/index.js", + "main": "dist/index.js", + "module": "dist/index.mjs", "exports": { ".": { - "require": "./dist/cjs/index.js", - "default": "./dist/esm/index.js" + "require": "./dist/index.js", + "default": "./dist/index.mjs" } }, - "types": "dist/esm/index.d.ts", + "types": "dist/index.d.ts", "scripts": { - "build": "npm-run-all clean tsc fix-esm test lint", - "clean": "rm -rf dist temp coverage && tsc --build --clean", - "tsc": "tsc --build && tsc --project tsconfig.lib.json --module CommonJs --outDir dist/cjs", - "fix-esm": "echo '{ \"type\": \"module\" }' > dist/esm/package.json", + "build": "npm-run-all clean tsc test lint bundle", + "clean": "rm -rf build dist temp coverage && tsc --build --clean", + "tsc": "tsc --build", "test": "jest", "lint": "eslint . --ext .ts --max-warnings 0", + "bundle": "tsup", "pr": "npm-run-all api format", "api": "npm-run-all api:*", "api:extract": "api-extractor run --local --verbose --typescript-compiler-folder=node_modules/typescript", @@ -58,6 +58,7 @@ "reflect-metadata": "^0.1.13", "semantic-release": "^22.0.5", "ts-jest": "^29.1.1", + "tsup": "^7.2.0", "typescript": "^5.2.2" }, "dependencies": { diff --git a/src/autocast.test.ts b/src/autocast.test.ts index 01f8add..a05a8e7 100644 --- a/src/autocast.test.ts +++ b/src/autocast.test.ts @@ -1,4 +1,4 @@ -import { int, number, string } from './types/index.js'; +import { int, number, string } from './types'; test('autoCast should not override existing parsers', () => { const HourOfDay = int.withConstraint('HourOfDay', n => 0 <= n && n < 24).withParser(number.andThen(n => n % 24)); diff --git a/src/base-type.test.ts b/src/base-type.test.ts index 1de4f4b..afe7d06 100644 --- a/src/base-type.test.ts +++ b/src/base-type.test.ts @@ -1,8 +1,8 @@ import assert from 'assert'; -import { BaseTypeImpl } from './base-type.js'; -import type { The } from './interfaces.js'; -import { assignableTo, testTypes } from './testutils.js'; -import { boolean, int, literal, number, object, pattern, string, undefinedType, unknownRecord } from './types/index.js'; +import { BaseTypeImpl } from './base-type'; +import type { The } from './interfaces'; +import { assignableTo, testTypes } from './testutils'; +import { boolean, int, literal, number, object, pattern, string, undefinedType, unknownRecord } from './types'; describe(BaseTypeImpl, () => { test.each(['a string', 123, false, { key: 'value' }] as const)('guard value: %p', value => { diff --git a/src/base-type.ts b/src/base-type.ts index 6f7c0d5..7e0f6cd 100644 --- a/src/base-type.ts +++ b/src/base-type.ts @@ -19,8 +19,8 @@ import type { ValidationResult, Validator, Visitor, -} from './interfaces.js'; -import { autoCastFailure, designType } from './symbols.js'; +} from './interfaces'; +import { autoCastFailure, designType } from './symbols'; import { addParserInputToResult, an, @@ -32,8 +32,8 @@ import { defaultStringify, prependContextToDetails, printValue, -} from './utils/index.js'; -import { ValidationError } from './validation-error.js'; +} from './utils'; +import { ValidationError } from './validation-error'; /** * The base-class of all type-implementations. diff --git a/src/decorators.test.ts b/src/decorators.test.ts index 1cb2a33..d5ae248 100644 --- a/src/decorators.test.ts +++ b/src/decorators.test.ts @@ -1,5 +1,5 @@ import 'reflect-metadata'; -import { int } from './types/index.js'; +import { int } from './types'; describe('compatibility with TypeScript decorator metadata', () => { const decorator: MethodDecorator = () => undefined; diff --git a/src/error-reporter.test.ts b/src/error-reporter.test.ts index 7c93b35..e874658 100644 --- a/src/error-reporter.test.ts +++ b/src/error-reporter.test.ts @@ -1,5 +1,5 @@ -import { reportError } from './error-reporter.js'; -import { string, unknown } from './types/index.js'; +import { reportError } from './error-reporter'; +import { string, unknown } from './types'; describe(reportError, () => { const rootType = unknown.withName('RootType'); diff --git a/src/error-reporter.ts b/src/error-reporter.ts index 85fddc9..3a25c9c 100644 --- a/src/error-reporter.ts +++ b/src/error-reporter.ts @@ -1,6 +1,6 @@ -import type { BaseObjectLikeTypeImpl, BaseTypeImpl } from './base-type.js'; -import type { BasicType, Failure, FailureDetails, OneOrMore, ValidationDetails } from './interfaces.js'; -import { an, basicType, checkOneOrMore, humanList, isSingle, plural, printKey, printPath, printValue, remove } from './utils/index.js'; +import type { BaseObjectLikeTypeImpl, BaseTypeImpl } from './base-type'; +import type { BasicType, Failure, FailureDetails, OneOrMore, ValidationDetails } from './interfaces'; +import { an, basicType, checkOneOrMore, humanList, isSingle, plural, printKey, printPath, printValue, remove } from './utils'; const BULLETS = ['-', '•', '‣', '◦']; const DEFAULT_BULLET = '*'; diff --git a/src/index.ts b/src/index.ts index 0a8d9f7..eebdb77 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,14 +1,8 @@ -/** - * Runtime type-validation with derived TypeScript types. - * - * @packageDocumentation - */ - -export * from './base-type.js'; -export * from './error-reporter.js'; -export * from './interfaces.js'; -export * from './simple-type.js'; -export * from './type-guard.js'; -export * from './types/index.js'; -export { printKey, printPath, printValue } from './utils/print-utils.js'; -export * from './validation-error.js'; +export * from './base-type'; +export * from './error-reporter'; +export * from './interfaces'; +export * from './simple-type'; +export * from './type-guard'; +export * from './types'; +export { printKey, printPath, printValue } from './utils/print-utils'; +export * from './validation-error'; diff --git a/src/interfaces.ts b/src/interfaces.ts index 132703d..dd538c0 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -1,6 +1,6 @@ -import type { BaseObjectLikeTypeImpl, BaseTypeImpl } from './base-type.js'; -import type { brands, designType } from './symbols.js'; -import type { ArrayType, KeyofType, LiteralType, RecordType, UnionType } from './types/index.js'; +import type { BaseObjectLikeTypeImpl, BaseTypeImpl } from './base-type'; +import type { brands, designType } from './symbols'; +import type { ArrayType, KeyofType, LiteralType, RecordType, UnionType } from './types'; /** * A type-validator/-parser that validates or parses `ResultType`. diff --git a/src/simple-type.test.ts b/src/simple-type.test.ts index 8ce19c6..9534e40 100644 --- a/src/simple-type.test.ts +++ b/src/simple-type.test.ts @@ -1,7 +1,7 @@ -import type { The } from './interfaces.js'; -import { SimpleType } from './simple-type.js'; -import { createExample } from './testutils.js'; -import { object } from './types/interface.js'; +import type { The } from './interfaces'; +import { SimpleType } from './simple-type'; +import { createExample } from './testutils'; +import { object } from './types/interface'; describe(SimpleType, () => { test('create simple types with ease', () => { diff --git a/src/simple-type.ts b/src/simple-type.ts index 3cea6b2..6fcf350 100644 --- a/src/simple-type.ts +++ b/src/simple-type.ts @@ -1,5 +1,5 @@ -import { BaseTypeImpl, createType } from './base-type.js'; -import type { BasicType, Result, Type, ValidationOptions, ValidationResult, Visitor } from './interfaces.js'; +import { BaseTypeImpl, createType } from './base-type'; +import type { BasicType, Result, Type, ValidationOptions, ValidationResult, Visitor } from './interfaces'; type SimpleAcceptVisitor = (type: SimpleType, visitor: Visitor) => R; diff --git a/src/testutils.ts b/src/testutils.ts index 4521167..1286ceb 100644 --- a/src/testutils.ts +++ b/src/testutils.ts @@ -1,10 +1,10 @@ /* eslint-disable @typescript-eslint/no-unsafe-return */ -import type { BaseObjectLikeTypeImpl, BaseTypeImpl } from './base-type.js'; -import type { BasicType, LiteralValue, NumberTypeConfig, OneOrMore, StringTypeConfig, Type, Visitor } from './interfaces.js'; -import type { ArrayType, KeyofType, LiteralType, RecordType, UnionType } from './types/index.js'; -import { an, basicType, printValue } from './utils/index.js'; -import { ValidationError } from './validation-error.js'; +import type { BaseObjectLikeTypeImpl, BaseTypeImpl } from './base-type'; +import type { BasicType, LiteralValue, NumberTypeConfig, OneOrMore, StringTypeConfig, Type, Visitor } from './interfaces'; +import type { ArrayType, KeyofType, LiteralType, RecordType, UnionType } from './types'; +import { an, basicType, printValue } from './utils'; +import { ValidationError } from './validation-error'; export function assignableTo(_value: T): void { // intentionally left blank diff --git a/src/type-guard.test.ts b/src/type-guard.test.ts index 9e4c940..f8887fd 100644 --- a/src/type-guard.test.ts +++ b/src/type-guard.test.ts @@ -1,6 +1,6 @@ -import { BaseTypeImpl } from './base-type.js'; -import { isType } from './type-guard.js'; -import { InterfaceType, object, string } from './types/index.js'; +import { BaseTypeImpl } from './base-type'; +import { isType } from './type-guard'; +import { InterfaceType, object, string } from './types'; describe(isType, () => { test('correctly identify types', () => { diff --git a/src/type-guard.ts b/src/type-guard.ts index a03f5a3..afb6992 100644 --- a/src/type-guard.ts +++ b/src/type-guard.ts @@ -1,5 +1,5 @@ -import { BaseTypeImpl } from './base-type.js'; -import type { Type } from './interfaces.js'; +import { BaseTypeImpl } from './base-type'; +import type { Type } from './interfaces'; /** * Type-guard that asserts that a given value is a Type. diff --git a/src/types.test.ts b/src/types.test.ts index d9a6ac4..c788a11 100644 --- a/src/types.test.ts +++ b/src/types.test.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-unsafe-return */ -import type { DeepUnbranded, MessageDetails, ObjectType, The, Type, Unbranded, Writable } from './interfaces.js'; +import type { DeepUnbranded, MessageDetails, ObjectType, The, Type, Unbranded, Writable } from './interfaces'; import { assignableTo, basicTypeMessage, @@ -9,11 +9,11 @@ import { stripped, testTypeImpl, testTypes, -} from './testutils.js'; -import { array, boolean, int, number, object, string } from './types/index.js'; -import { partial } from './types/interface.js'; -import { intersection } from './types/intersection.js'; -import { printValue } from './utils/index.js'; +} from './testutils'; +import { array, boolean, int, number, object, string } from './types'; +import { partial } from './types/interface'; +import { intersection } from './types/intersection'; +import { printValue } from './utils'; /** An example of a simple constraint without a custom message. */ const SmallString = string.withConstraint('SmallString', s => s.length < 10); diff --git a/src/types/array.test.ts b/src/types/array.test.ts index d446434..8cf95d8 100644 --- a/src/types/array.test.ts +++ b/src/types/array.test.ts @@ -1,10 +1,10 @@ -import type { The } from '../interfaces.js'; -import { assignableTo, createExample, defaultUsualSuspects, testTypeImpl, testTypes } from '../testutils.js'; -import { array } from './array.js'; -import { object } from './interface.js'; -import { undefinedType } from './literal.js'; -import { number } from './number.js'; -import { string } from './string.js'; +import type { The } from '../interfaces'; +import { assignableTo, createExample, defaultUsualSuspects, testTypeImpl, testTypes } from '../testutils'; +import { array } from './array'; +import { object } from './interface'; +import { undefinedType } from './literal'; +import { number } from './number'; +import { string } from './string'; testTypeImpl({ name: 'string[]', diff --git a/src/types/array.ts b/src/types/array.ts index 4124ee7..c81d2cb 100644 --- a/src/types/array.ts +++ b/src/types/array.ts @@ -1,5 +1,5 @@ -import { BaseTypeImpl, createType } from '../base-type.js'; -import type { ArrayTypeConfig, Result, TypeImpl, ValidationOptions, Visitor } from '../interfaces.js'; +import { BaseTypeImpl, createType } from '../base-type'; +import type { ArrayTypeConfig, Result, TypeImpl, ValidationOptions, Visitor } from '../interfaces'; import { castArray, decodeOptionalName, @@ -9,8 +9,8 @@ import { isValidIdentifier, partition, prependPathToDetails, -} from '../utils/index.js'; -import { unknownArray } from './unknown.js'; +} from '../utils'; +import { unknownArray } from './unknown'; /** * The implementation behind types created with {@link array}. diff --git a/src/types/boolean.test.ts b/src/types/boolean.test.ts index 6a38363..8478afd 100644 --- a/src/types/boolean.test.ts +++ b/src/types/boolean.test.ts @@ -1,5 +1,5 @@ -import { basicTypeMessage, testTypeImpl } from '../testutils.js'; -import { boolean } from './boolean.js'; +import { basicTypeMessage, testTypeImpl } from '../testutils'; +import { boolean } from './boolean'; testTypeImpl({ name: 'boolean', diff --git a/src/types/boolean.ts b/src/types/boolean.ts index 644fbe6..f651534 100644 --- a/src/types/boolean.ts +++ b/src/types/boolean.ts @@ -1,7 +1,7 @@ -import type { Type } from '../interfaces.js'; -import { SimpleType } from '../simple-type.js'; -import { autoCastFailure } from '../symbols.js'; -import { basicTypeChecker, booleanStringify } from '../utils/index.js'; +import type { Type } from '../interfaces'; +import { SimpleType } from '../simple-type'; +import { autoCastFailure } from '../symbols'; +import { basicTypeChecker, booleanStringify } from '../utils'; /** * Built-in validator for boolean-values. diff --git a/src/types/index.ts b/src/types/index.ts index e90ee26..9340728 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,11 +1,11 @@ -export * from './array.js'; -export * from './boolean.js'; -export * from './interface.js'; -export * from './intersection.js'; -export * from './keyof.js'; -export * from './literal.js'; -export * from './number.js'; -export * from './record.js'; -export * from './string.js'; -export * from './union.js'; -export * from './unknown.js'; +export * from './array'; +export * from './boolean'; +export * from './interface'; +export * from './intersection'; +export * from './keyof'; +export * from './literal'; +export * from './number'; +export * from './record'; +export * from './string'; +export * from './union'; +export * from './unknown'; diff --git a/src/types/interface.test.ts b/src/types/interface.test.ts index d06c502..061d46c 100644 --- a/src/types/interface.test.ts +++ b/src/types/interface.test.ts @@ -1,11 +1,11 @@ -import type { The } from '../interfaces.js'; -import { assignableTo, defaultUsualSuspects, stripped, testTypeImpl, testTypes } from '../testutils.js'; -import { boolean } from './boolean.js'; -import { PartialType, object, partial } from './interface.js'; -import { IntersectionType } from './intersection.js'; -import { undefinedType } from './literal.js'; -import { number } from './number.js'; -import { string } from './string.js'; +import type { The } from '../interfaces'; +import { assignableTo, defaultUsualSuspects, stripped, testTypeImpl, testTypes } from '../testutils'; +import { boolean } from './boolean'; +import { PartialType, object, partial } from './interface'; +import { IntersectionType } from './intersection'; +import { undefinedType } from './literal'; +import { number } from './number'; +import { string } from './string'; testTypeImpl({ name: '{ force?: boolean }', diff --git a/src/types/interface.ts b/src/types/interface.ts index ad2d019..4a015ef 100644 --- a/src/types/interface.ts +++ b/src/types/interface.ts @@ -1,4 +1,4 @@ -import { BaseObjectLikeTypeImpl, BaseTypeImpl, TypedPropertyInformation, createType } from '../base-type.js'; +import { BaseObjectLikeTypeImpl, BaseTypeImpl, createType, type TypedPropertyInformation } from '../base-type'; import type { MergeIntersection, MessageDetails, @@ -13,7 +13,7 @@ import type { ValidationOptions, Visitor, Writable, -} from '../interfaces.js'; +} from '../interfaces'; import { decodeOptionalName, decodeOptionalOptions, @@ -23,8 +23,8 @@ import { hasOwnProperty, interfaceStringify, prependPathToDetails, -} from '../utils/index.js'; -import { unknownRecord } from './unknown.js'; +} from '../utils'; +import { unknownRecord } from './unknown'; /** * Options for {@link object}. diff --git a/src/types/intersection.test.ts b/src/types/intersection.test.ts index b1fdf6d..8f5eea1 100644 --- a/src/types/intersection.test.ts +++ b/src/types/intersection.test.ts @@ -1,12 +1,12 @@ -import { BaseTypeImpl } from '../base-type.js'; -import type { The } from '../interfaces.js'; -import { assignableTo, testTypeImpl, testTypes } from '../testutils.js'; -import { boolean } from './boolean.js'; -import { object, partial } from './interface.js'; -import { IntersectionOfTypeTuple, intersection } from './intersection.js'; -import { literal } from './literal.js'; -import { number } from './number.js'; -import { union } from './union.js'; +import { BaseTypeImpl } from '../base-type'; +import type { The } from '../interfaces'; +import { assignableTo, testTypeImpl, testTypes } from '../testutils'; +import { boolean } from './boolean'; +import { object, partial } from './interface'; +import { IntersectionOfTypeTuple, intersection } from './intersection'; +import { literal } from './literal'; +import { number } from './number'; +import { union } from './union'; /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ diff --git a/src/types/intersection.ts b/src/types/intersection.ts index 5a01935..f5b464e 100644 --- a/src/types/intersection.ts +++ b/src/types/intersection.ts @@ -1,4 +1,4 @@ -import { BaseObjectLikeTypeImpl, TypedPropertyInformation, createType } from '../base-type.js'; +import { BaseObjectLikeTypeImpl, createType, type TypedPropertyInformation } from '../base-type'; import type { MergeIntersection, OneOrMore, @@ -9,8 +9,8 @@ import type { TypeImpl, ValidationOptions, Visitor, -} from '../interfaces.js'; -import type { designType } from '../symbols.js'; +} from '../interfaces'; +import type { designType } from '../symbols'; import { bracketsIfNeeded, decodeOptionalName, @@ -21,9 +21,9 @@ import { interfaceStringify, isFailure, partition, -} from '../utils/index.js'; -import { UnionType } from './union.js'; -import { unknownRecord } from './unknown.js'; +} from '../utils'; +import { UnionType } from './union'; +import { unknownRecord } from './unknown'; /** * The implementation behind types created with {@link intersection} and {@link BaseObjectLikeTypeImpl.and}. diff --git a/src/types/keyof.test.ts b/src/types/keyof.test.ts index 69b4c4b..d30b6d9 100644 --- a/src/types/keyof.test.ts +++ b/src/types/keyof.test.ts @@ -1,8 +1,8 @@ -import type { The } from '../interfaces.js'; -import { ValidationErrorForTest, assignableTo, basicTypeMessage, defaultUsualSuspects, testTypeImpl, testTypes } from '../testutils.js'; -import { keyof, valueof } from './keyof.js'; -import { literal } from './literal.js'; -import { union } from './union.js'; +import type { The } from '../interfaces'; +import { ValidationErrorForTest, assignableTo, basicTypeMessage, defaultUsualSuspects, testTypeImpl, testTypes } from '../testutils'; +import { keyof, valueof } from './keyof'; +import { literal } from './literal'; +import { union } from './union'; testTypeImpl({ name: '"yes" | "no"', diff --git a/src/types/keyof.ts b/src/types/keyof.ts index f6a313c..8cc5862 100644 --- a/src/types/keyof.ts +++ b/src/types/keyof.ts @@ -1,6 +1,6 @@ -import { BaseTypeImpl, createType } from '../base-type.js'; -import type { Result, Transposed, TypeImpl, Visitor } from '../interfaces.js'; -import { decodeOptionalName, define, hasOwnProperty, stringStringify, transpose } from '../utils/index.js'; +import { BaseTypeImpl, createType } from '../base-type'; +import type { Result, Transposed, TypeImpl, Visitor } from '../interfaces'; +import { decodeOptionalName, define, hasOwnProperty, stringStringify, transpose } from '../utils'; /** * The implementation behind types created with {@link keyof} and {@link valueof}. diff --git a/src/types/literal.test.ts b/src/types/literal.test.ts index 00719ae..976ef9c 100644 --- a/src/types/literal.test.ts +++ b/src/types/literal.test.ts @@ -1,6 +1,6 @@ -import type { The } from '../interfaces.js'; -import { assignableTo, testTypeImpl, testTypes } from '../testutils.js'; -import { literal, nullType, undefinedType } from './literal.js'; +import type { The } from '../interfaces'; +import { assignableTo, testTypeImpl, testTypes } from '../testutils'; +import { literal, nullType, undefinedType } from './literal'; testTypeImpl({ name: 'false', diff --git a/src/types/literal.ts b/src/types/literal.ts index 735b8cc..a3e2a33 100644 --- a/src/types/literal.ts +++ b/src/types/literal.ts @@ -1,9 +1,9 @@ -import { BaseTypeImpl, createType } from '../base-type.js'; -import type { BasicType, LiteralValue, Result, TypeImpl, Visitor } from '../interfaces.js'; -import { autoCastFailure } from '../symbols.js'; -import { basicType, defaultStringify, define, printValue } from '../utils/index.js'; -import { booleanAutoCaster } from './boolean.js'; -import { numberAutoCaster } from './number.js'; +import { BaseTypeImpl, createType } from '../base-type'; +import type { BasicType, LiteralValue, Result, TypeImpl, Visitor } from '../interfaces'; +import { autoCastFailure } from '../symbols'; +import { basicType, defaultStringify, define, printValue } from '../utils'; +import { booleanAutoCaster } from './boolean'; +import { numberAutoCaster } from './number'; /** * The implementation behind types created with {@link literal} and {@link nullType}, {@link undefinedType} and {@link voidType}. diff --git a/src/types/number.test.ts b/src/types/number.test.ts index f5d2577..673fb86 100644 --- a/src/types/number.test.ts +++ b/src/types/number.test.ts @@ -1,6 +1,6 @@ -import { basicTypeMessage, defaultMessage, defaultUsualSuspects, testTypeImpl } from '../testutils.js'; -import { humanList } from '../utils/print-utils.js'; -import { int, number } from './number.js'; +import { basicTypeMessage, defaultMessage, defaultUsualSuspects, testTypeImpl } from '../testutils'; +import { humanList } from '../utils/print-utils'; +import { int, number } from './number'; testTypeImpl({ name: 'number', diff --git a/src/types/number.ts b/src/types/number.ts index b2c6c02..dedb508 100644 --- a/src/types/number.ts +++ b/src/types/number.ts @@ -1,8 +1,8 @@ import big from 'big.js'; -import type { Branded, NumberTypeConfig, The, Type } from '../interfaces.js'; -import { SimpleType } from '../simple-type.js'; -import { autoCastFailure } from '../symbols.js'; -import { evalAdditionalChecks, numberStringify } from '../utils/index.js'; +import type { Branded, NumberTypeConfig, The, Type } from '../interfaces'; +import { SimpleType } from '../simple-type'; +import { autoCastFailure } from '../symbols'; +import { evalAdditionalChecks, numberStringify } from '../utils'; export const number: Type = SimpleType.create( 'number', diff --git a/src/types/record.test.ts b/src/types/record.test.ts index 0227d5f..4a19ee1 100644 --- a/src/types/record.test.ts +++ b/src/types/record.test.ts @@ -1,13 +1,13 @@ -import type { MessageDetails, The } from '../interfaces.js'; -import { createExample, defaultUsualSuspects, stripped, testTypeImpl } from '../testutils.js'; -import { printKey, printValue } from '../utils/index.js'; -import { object } from './interface.js'; -import { keyof } from './keyof.js'; -import { literal } from './literal.js'; -import { int, number } from './number.js'; -import { record } from './record.js'; -import { string } from './string.js'; -import { union } from './union.js'; +import type { MessageDetails, The } from '../interfaces'; +import { createExample, defaultUsualSuspects, stripped, testTypeImpl } from '../testutils'; +import { printKey, printValue } from '../utils'; +import { object } from './interface'; +import { keyof } from './keyof'; +import { literal } from './literal'; +import { int, number } from './number'; +import { record } from './record'; +import { string } from './string'; +import { union } from './union'; testTypeImpl({ name: 'Record', type: record(string, object({ nested: literal('object') })) }); testTypeImpl({ name: 'Record', type: record(number, object({ nested: literal('object') }), false) }); diff --git a/src/types/record.ts b/src/types/record.ts index 838002a..4fc1359 100644 --- a/src/types/record.ts +++ b/src/types/record.ts @@ -1,7 +1,7 @@ -import { BaseTypeImpl, createType } from '../base-type.js'; -import type { MessageDetails, Result, TypeImpl, ValidationOptions, Visitor } from '../interfaces.js'; -import { decodeOptionalName, define, extensionName, prependPathToDetails, stringStringify } from '../utils/index.js'; -import { unknownRecord } from './unknown.js'; +import { BaseTypeImpl, createType } from '../base-type'; +import type { MessageDetails, Result, TypeImpl, ValidationOptions, Visitor } from '../interfaces'; +import { decodeOptionalName, define, extensionName, prependPathToDetails, stringStringify } from '../utils'; +import { unknownRecord } from './unknown'; /** * The implementation behind types created with {@link record}. diff --git a/src/types/string.test.ts b/src/types/string.test.ts index 9ce1511..368c3c6 100644 --- a/src/types/string.test.ts +++ b/src/types/string.test.ts @@ -1,7 +1,7 @@ -import type { The } from '../interfaces.js'; -import { assignableTo, basicTypeMessage, defaultUsualSuspects, testTypeImpl, testTypes } from '../testutils.js'; -import { plural } from '../utils/index.js'; -import { pattern, string } from './string.js'; +import type { The } from '../interfaces'; +import { assignableTo, basicTypeMessage, defaultUsualSuspects, testTypeImpl, testTypes } from '../testutils'; +import { plural } from '../utils'; +import { pattern, string } from './string'; testTypeImpl({ name: 'string', diff --git a/src/types/string.ts b/src/types/string.ts index be3fba1..7b9514f 100644 --- a/src/types/string.ts +++ b/src/types/string.ts @@ -1,6 +1,6 @@ -import type { Branded, StringTypeConfig, Type } from '../interfaces.js'; -import { SimpleType } from '../simple-type.js'; -import { evalAdditionalChecks, stringStringify } from '../utils/index.js'; +import type { Branded, StringTypeConfig, Type } from '../interfaces'; +import { SimpleType } from '../simple-type'; +import { evalAdditionalChecks, stringStringify } from '../utils'; /** * Built-in validator for string-values. diff --git a/src/types/union.test.ts b/src/types/union.test.ts index 876125f..d464d17 100644 --- a/src/types/union.test.ts +++ b/src/types/union.test.ts @@ -1,13 +1,13 @@ -import type { DeepUnbranded, The } from '../interfaces.js'; -import { createExample, defaultUsualSuspects, testTypeImpl } from '../testutils.js'; -import { boolean } from './boolean.js'; -import { object, partial } from './interface.js'; -import { keyof } from './keyof.js'; -import { literal, nullType, undefinedType } from './literal.js'; -import { number } from './number.js'; -import { string } from './string.js'; -import { union } from './union.js'; -import { unknownRecord } from './unknown.js'; +import type { DeepUnbranded, The } from '../interfaces'; +import { createExample, defaultUsualSuspects, testTypeImpl } from '../testutils'; +import { boolean } from './boolean'; +import { object, partial } from './interface'; +import { keyof } from './keyof'; +import { literal, nullType, undefinedType } from './literal'; +import { number } from './number'; +import { string } from './string'; +import { union } from './union'; +import { unknownRecord } from './unknown'; testTypeImpl({ name: 'number | null', diff --git a/src/types/union.ts b/src/types/union.ts index 8ce03ea..7bed380 100644 --- a/src/types/union.ts +++ b/src/types/union.ts @@ -1,4 +1,4 @@ -import { BaseObjectLikeTypeImpl, BaseTypeImpl, createType } from '../base-type.js'; +import { BaseObjectLikeTypeImpl, BaseTypeImpl, createType } from '../base-type'; import type { BasicType, LiteralValue, @@ -11,8 +11,8 @@ import type { TypeOf, ValidationOptions, Visitor, -} from '../interfaces.js'; -import { an, basicType, bracketsIfNeeded, decodeOptionalName, defaultStringify, define, extensionName, printPath } from '../utils/index.js'; +} from '../interfaces'; +import { an, basicType, bracketsIfNeeded, decodeOptionalName, defaultStringify, define, extensionName, printPath } from '../utils'; /** * The implementation behind types created with {@link union} and {@link BaseTypeImpl.or}. diff --git a/src/types/unknown.test.ts b/src/types/unknown.test.ts index c95f477..468df41 100644 --- a/src/types/unknown.test.ts +++ b/src/types/unknown.test.ts @@ -1,5 +1,5 @@ -import { USUAL_SUSPECTS, basicTypeMessage, createExample, defaultUsualSuspects, testTypeImpl } from '../testutils.js'; -import { unknown, unknownArray, unknownRecord } from './unknown.js'; +import { USUAL_SUSPECTS, basicTypeMessage, createExample, defaultUsualSuspects, testTypeImpl } from '../testutils'; +import { unknown, unknownArray, unknownRecord } from './unknown'; testTypeImpl({ name: 'unknown', diff --git a/src/types/unknown.ts b/src/types/unknown.ts index 2451ef5..70ead9d 100644 --- a/src/types/unknown.ts +++ b/src/types/unknown.ts @@ -1,6 +1,6 @@ -import type { Type } from '../interfaces.js'; -import { SimpleType } from '../simple-type.js'; -import { basicTypeChecker, castArray, fallbackStringify } from '../utils/index.js'; +import type { Type } from '../interfaces'; +import { SimpleType } from '../simple-type'; +import { basicTypeChecker, castArray, fallbackStringify } from '../utils'; /** * Built-in validator that accepts all values. diff --git a/src/utils/collection-utils.ts b/src/utils/collection-utils.ts index 429ee8a..bc39ee5 100644 --- a/src/utils/collection-utils.ts +++ b/src/utils/collection-utils.ts @@ -1,4 +1,4 @@ -import type { Transposed } from '../interfaces.js'; +import type { Transposed } from '../interfaces'; export function castArray(input: undefined | T | T[]): T[] { return input === undefined ? [] : Array.isArray(input) ? input : [input]; diff --git a/src/utils/failure-utils.ts b/src/utils/failure-utils.ts index fd617d8..c35f6bb 100644 --- a/src/utils/failure-utils.ts +++ b/src/utils/failure-utils.ts @@ -1,6 +1,6 @@ -import type { CustomMessage, Failure, FailureDetails, MessageDetails, OneOrMore, Result } from '../interfaces.js'; -import { printValue } from './print-utils.js'; -import { checkOneOrMore } from './type-utils.js'; +import type { CustomMessage, Failure, FailureDetails, MessageDetails, OneOrMore, Result } from '../interfaces'; +import { printValue } from './print-utils'; +import { checkOneOrMore } from './type-utils'; export function prependPathToDetails(failure: Failure, key: PropertyKey): OneOrMore { return checkOneOrMore(failure.details.map(d => ({ ...d, path: d.path ? [key, ...d.path] : [key] }))); diff --git a/src/utils/index.ts b/src/utils/index.ts index 3e07637..e317230 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,6 +1,6 @@ -export * from './collection-utils.js'; -export * from './define.js'; -export * from './failure-utils.js'; -export * from './print-utils.js'; -export * from './stringifiers.js'; -export * from './type-utils.js'; +export * from './collection-utils'; +export * from './define'; +export * from './failure-utils'; +export * from './print-utils'; +export * from './stringifiers'; +export * from './type-utils'; diff --git a/src/utils/print-utils.test.ts b/src/utils/print-utils.test.ts index ba5cc22..45eac44 100644 --- a/src/utils/print-utils.test.ts +++ b/src/utils/print-utils.test.ts @@ -1,4 +1,4 @@ -import { bracketsIfNeeded, printValue } from './print-utils.js'; +import { bracketsIfNeeded, printValue } from './print-utils'; describe(printValue, () => { const circular = { nested: { prop: { value: 123, circular: 0 as unknown } } }; diff --git a/src/utils/print-utils.ts b/src/utils/print-utils.ts index 1fdb93a..93ff0db 100644 --- a/src/utils/print-utils.ts +++ b/src/utils/print-utils.ts @@ -1,6 +1,6 @@ -import type { OneOrMore, PropertiesInfo } from '../interfaces.js'; -import { castArray } from './collection-utils.js'; -import { isOneOrMore, isValidIdentifier } from './type-utils.js'; +import type { OneOrMore, PropertiesInfo } from '../interfaces'; +import { castArray } from './collection-utils'; +import { isOneOrMore, isValidIdentifier } from './type-utils'; /** * Print an unknown value with a given character budget (default: 50). diff --git a/src/utils/stringifiers.test.ts b/src/utils/stringifiers.test.ts index 28bd0f8..102e9c9 100644 --- a/src/utils/stringifiers.test.ts +++ b/src/utils/stringifiers.test.ts @@ -1,4 +1,4 @@ -import { NEEDS_ESCAPE, defaultStringify, stringStringify } from './stringifiers.js'; +import { NEEDS_ESCAPE, defaultStringify, stringStringify } from './stringifiers'; describe(stringStringify, () => { test('NEEDS_ESCAPE', () => { diff --git a/src/utils/stringifiers.ts b/src/utils/stringifiers.ts index df47a07..f086e8d 100644 --- a/src/utils/stringifiers.ts +++ b/src/utils/stringifiers.ts @@ -1,4 +1,4 @@ -import type { BasicType, Type } from '../interfaces.js'; +import type { BasicType, Type } from '../interfaces'; /** * Default stringifier for all primitive values. diff --git a/src/utils/type-utils.ts b/src/utils/type-utils.ts index 9fd1ec1..c17c26f 100644 --- a/src/utils/type-utils.ts +++ b/src/utils/type-utils.ts @@ -1,4 +1,4 @@ -import type { BasicType, Failure, OneOrMore, Result, ValidationResult } from '../interfaces.js'; +import type { BasicType, Failure, OneOrMore, Result, ValidationResult } from '../interfaces'; export function isOneOrMore(arr: T[]): arr is OneOrMore { return arr.length > 0; diff --git a/src/validation-error.test.ts b/src/validation-error.test.ts index 385c28c..d1b6e89 100644 --- a/src/validation-error.test.ts +++ b/src/validation-error.test.ts @@ -1,6 +1,6 @@ -import type { Failure } from './interfaces.js'; -import { unknown } from './types/index.js'; -import { ValidationError } from './validation-error.js'; +import type { Failure } from './interfaces'; +import { unknown } from './types'; +import { ValidationError } from './validation-error'; describe(ValidationError, () => { const type = unknown.withName('GreatType'); diff --git a/src/validation-error.ts b/src/validation-error.ts index 70b2c80..7ea39b1 100644 --- a/src/validation-error.ts +++ b/src/validation-error.ts @@ -1,6 +1,6 @@ -import type { BaseTypeImpl } from './base-type.js'; -import { reportError } from './error-reporter.js'; -import type { Failure, FailureDetails, OneOrMore, Result } from './interfaces.js'; +import type { BaseTypeImpl } from './base-type'; +import { reportError } from './error-reporter'; +import type { Failure, FailureDetails, OneOrMore, Result } from './interfaces'; /** * The error that is thrown on any validation- or parse-error within this library. diff --git a/tsconfig.json b/tsconfig.json index e4ed00a..f90788d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,13 +1,13 @@ { "compilerOptions": { "target": "ES2019", - "module": "ES2015", + "module": "ESNext", + "moduleResolution": "Bundler", "declaration": true, "declarationMap": true, "sourceMap": true, - "outDir": "dist/esm", + "outDir": "build", "rootDir": "src", - "moduleResolution": "node", "importHelpers": true, "strict": true, "noUnusedLocals": true, @@ -20,9 +20,9 @@ "forceConsistentCasingInFileNames": true, "pretty": true, "composite": true, - "importsNotUsedAsValues": "error", + "verbatimModuleSyntax": true, "extendedDiagnostics": true, - "ignoreDeprecations": "5.0" + "useDefineForClassFields": false }, "include": [], "files": [], diff --git a/tsconfig.test.json b/tsconfig.test.json index 3ae4a62..353be41 100644 --- a/tsconfig.test.json +++ b/tsconfig.test.json @@ -3,9 +3,11 @@ "compilerOptions": { "noEmit": true, "module": "CommonJS", + "moduleResolution": "Node", "types": ["jest", "jest-extended", "node"], "experimentalDecorators": true, - "emitDecoratorMetadata": true + "emitDecoratorMetadata": true, + "verbatimModuleSyntax": false }, "include": ["src/**/*.test.ts", "src/testutils.ts"], "references": [{ "path": "./tsconfig.lib.json" }] diff --git a/tsup.config.ts b/tsup.config.ts new file mode 100644 index 0000000..521d326 --- /dev/null +++ b/tsup.config.ts @@ -0,0 +1,22 @@ +import { defineConfig } from 'tsup'; + +const banner = ` +/** + * Runtime type-validation with derived TypeScript types. + * + * @packageDocumentation + */ +`; + +export default defineConfig({ + entry: ['src/index.ts'], + platform: 'neutral', + format: ['cjs', 'esm'], + tsconfig: 'tsconfig.lib.json', + dts: { + banner, + compilerOptions: { composite: false }, + }, + sourcemap: true, + clean: true, +});