From def3054ddeb5d4aa565192a66ba30859f2860be4 Mon Sep 17 00:00:00 2001 From: Olzhas Alexandrov Date: Tue, 17 Nov 2020 00:10:53 -0600 Subject: [PATCH 1/2] Added "madge" to run linting for circular references --- package.json | 2 + yarn.lock | 639 +++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 628 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index f63a66020..95526d2da 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "inference" ], "scripts": { + "lint:circular": "madge src/index.ts --circular", "clean": "rm -rf lib/*", "build": "yarn run clean && tsc --p tsconfig.json", "buildall": "yarn add typescript@3.4 && yarn build && yarn add typescript@3.5 && yarn build && yarn add typescript@3.6 && yarn build && yarn add typescript@3.7 && yarn build && yarn add typescript@3.8 && yarn build && yarn add typescript@3.9 && yarn build && yarn add typescript@4 && yarn build && yarn add typescript@3.4", @@ -42,6 +43,7 @@ "devDependencies": { "@types/jest": "^25.1.4", "jest": "^25.1.0", + "madge": "^3.12.0", "make-coverage-badge": "^1.2.0", "nodemon": "^2.0.2", "prettier": "^1.19.1", diff --git a/yarn.lock b/yarn.lock index 76e2e0c8a..a7af1349f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -86,6 +86,11 @@ esutils "^2.0.2" js-tokens "^4.0.0" +"@babel/parser@^7.0.0": + version "7.12.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.5.tgz#b4af32ddd473c0bfa643bd7ff0728b8e71b81ea0" + integrity sha512-FVM6RZQ0mn2KCf1VUED7KepYeUWoVShczewOCfm3nzoBybaih51h+sYVVGthW9M6lPByEPTQf+xm27PBdlpwmQ== + "@babel/parser@^7.1.0", "@babel/parser@^7.7.5", "@babel/parser@^7.8.6", "@babel/parser@^7.8.7": version "7.8.8" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.8.8.tgz#4c3b7ce36db37e0629be1f0d50a571d2f86f6cd4" @@ -415,6 +420,19 @@ dependencies: "@types/yargs-parser" "*" +"@typescript-eslint/typescript-estree@^2.29.0": + version "2.34.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.34.0.tgz#14aeb6353b39ef0732cc7f1b8285294937cf37d5" + integrity sha512-OMAr+nJWKdlVM9LOqCqh3pQQPwxHAN7Du8DR6dmwCrAmxtiXQnhHJ6tBNtf+cggqfo51SG/FCwnKhXCIM7hnVg== + dependencies: + debug "^4.1.1" + eslint-visitor-keys "^1.1.0" + glob "^7.1.6" + is-glob "^4.0.1" + lodash "^4.17.15" + semver "^7.3.2" + tsutils "^3.17.1" + abab@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.3.tgz#623e2075e02eb2d3f2475e49f99c91846467907a" @@ -518,6 +536,11 @@ anymatch@^3.0.3, anymatch@~3.1.1: normalize-path "^3.0.0" picomatch "^2.0.4" +app-module-path@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/app-module-path/-/app-module-path-2.2.0.tgz#641aa55dfb7d6a6f0a8141c4b9c0aa50b6c24dd5" + integrity sha1-ZBqlXft9am8KgUHEucCqULbCTdU= + argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -567,6 +590,11 @@ assign-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= +ast-module-types@^2.3.2, ast-module-types@^2.4.0, ast-module-types@^2.6.0, ast-module-types@^2.7.0, ast-module-types@^2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/ast-module-types/-/ast-module-types-2.7.1.tgz#3f7989ef8dfa1fdb82dfe0ab02bdfc7c77a57dd3" + integrity sha512-Rnnx/4Dus6fn7fTqdeLEAn5vUll5w7/vts0RN608yFa6si/rDOUonlIIiwugHBFWjylHjxm9owoSZn71KwG4gw== + astral-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" @@ -789,7 +817,7 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.3.0: +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.3.0, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -806,6 +834,14 @@ chalk@^3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" +chalk@^4.0.0, chalk@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" + integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + chokidar@^3.2.2: version "3.3.1" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.3.1.tgz#c84e5b3d18d9a4d77558fef466b1bf16bbeb3450" @@ -846,6 +882,18 @@ cli-boxes@^1.0.0: resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" integrity sha1-T6kXw+WclKAEzWH47lCdplFocUM= +cli-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" + integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== + dependencies: + restore-cursor "^3.1.0" + +cli-spinners@^2.4.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.5.0.tgz#12763e47251bf951cb75c201dfa58ff1bcb2d047" + integrity sha512-PC+AmIuK04E6aeSs/pUccSujsTzBhu4HzC2dL+CfJB/Jcc2qTRbEwZQDfIUpt2Xl8BodYBEq8w4fc0kU2I9DjQ== + cliui@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" @@ -855,6 +903,11 @@ cliui@^6.0.0: strip-ansi "^6.0.0" wrap-ansi "^6.2.0" +clone@^1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" + integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= + co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -904,11 +957,21 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -commander@^2.12.1: +commander@^2.12.1, commander@^2.13.0, commander@^2.16.0, commander@^2.20.3, commander@^2.8.1: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== +commander@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae" + integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg== + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= + component-emitter@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" @@ -943,7 +1006,7 @@ copy-descriptor@^0.1.0: resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= -core-util-is@1.0.2: +core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= @@ -1036,6 +1099,13 @@ debug@^3.2.6: dependencies: ms "^2.1.1" +debug@^4.0.0, debug@^4.0.1: + version "4.2.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.2.0.tgz#7f150f93920e94c58f5574c2fd01a3110effe7f1" + integrity sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg== + dependencies: + ms "2.1.2" + debug@^4.1.0, debug@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" @@ -1043,6 +1113,13 @@ debug@^4.1.0, debug@^4.1.1: dependencies: ms "^2.1.1" +debug@^4.2.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.0.tgz#efa41cbf14fc9448075367fdaaddf82376da211e" + integrity sha512-jjO6JD2rKfiZQnBoRzhRTbXjHLGLfH+UtGkWLc/UXAh/rzZMyjbgn0NcfFpqT8nd1kTtFnDiJcrIFkq4UKeJVg== + dependencies: + ms "2.1.2" + decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -1053,6 +1130,13 @@ decode-uri-component@^0.2.0: resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= +decomment@^0.9.2: + version "0.9.3" + resolved "https://registry.yarnpkg.com/decomment/-/decomment-0.9.3.tgz#b913f32e5fe1113848f516caa5c7afefa9544d38" + integrity sha512-5skH5BfUL3n09RDmMVaHS1QGCiZRnl2nArUwmsE9JRY93Ueh3tihYl5wIrDdAuXnoFhxVis/DmRWREO2c6DG3w== + dependencies: + esprima "4.0.1" + deep-extend@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" @@ -1063,6 +1147,13 @@ deep-is@~0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= +defaults@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" + integrity sha1-xlYFHpgX2f8I7YgUd/P+QBnz730= + dependencies: + clone "^1.0.2" + define-properties@^1.1.2, define-properties@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" @@ -1097,11 +1188,99 @@ delayed-stream@~1.0.0: resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= +dependency-tree@^7.2.2: + version "7.2.2" + resolved "https://registry.yarnpkg.com/dependency-tree/-/dependency-tree-7.2.2.tgz#2366c96c0a905adfc19e9ed8dcdbfcb93476dfb5" + integrity sha512-WWZJpNuMWqEM97CGykmyKLjjUWGVGkRRMSIEBWk5izmugxmivnItg4MMHkDzuvmB/7vglhudEoc5wyMp5ODD+Q== + dependencies: + commander "^2.20.3" + debug "^4.2.1" + filing-cabinet "^2.6.0" + precinct "^6.3.1" + typescript "^3.9.7" + detect-newline@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== +detective-amd@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/detective-amd/-/detective-amd-3.0.1.tgz#aca8eddb1f405821953faf4a893d9b9e0430b09e" + integrity sha512-vJgluSKkPyo+/McW9hzwmZwY1VPA3BS0VS1agdpPAWAhr65HwC1ox4Ig82rVfGYDYCa4GcKQON5JWBk++2Kf1Q== + dependencies: + ast-module-types "^2.7.0" + escodegen "^1.8.0" + get-amd-module-type "^3.0.0" + node-source-walk "^4.0.0" + +detective-cjs@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/detective-cjs/-/detective-cjs-3.1.1.tgz#18da3e39a002d2098a1123d45ce1de1b0d9045a0" + integrity sha512-JQtNTBgFY6h8uT6pgph5QpV3IyxDv+z3qPk/FZRDT9TlFfm5dnRtpH39WtQEr1khqsUxVqXzKjZHpdoQvQbllg== + dependencies: + ast-module-types "^2.4.0" + node-source-walk "^4.0.0" + +detective-es6@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/detective-es6/-/detective-es6-2.2.0.tgz#8f2baba3f8cd90a5cfd748f5ac436f0158ed2585" + integrity sha512-fSpNY0SLER7/sVgQZ1NxJPwmc9uCTzNgdkQDhAaj8NPYwr7Qji9QBcmbNvtMCnuuOGMuKn3O7jv0An+/WRWJZQ== + dependencies: + node-source-walk "^4.0.0" + +detective-less@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/detective-less/-/detective-less-1.0.2.tgz#a68af9ca5f69d74b7d0aa190218b211d83b4f7e3" + integrity sha512-Rps1xDkEEBSq3kLdsdnHZL1x2S4NGDcbrjmd4q+PykK5aJwDdP5MBgrJw1Xo+kyUHuv3JEzPqxr+Dj9ryeDRTA== + dependencies: + debug "^4.0.0" + gonzales-pe "^4.2.3" + node-source-walk "^4.0.0" + +detective-postcss@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/detective-postcss/-/detective-postcss-3.0.1.tgz#511921951f66135e17d0ece2e7604c6e4966c9c6" + integrity sha512-tfTS2GdpUal5NY0aCqI4dpEy8Xfr88AehYKB0iBIZvo8y2g3UsrcDnrp9PR2FbzoW7xD5Rip3NJW7eCSvtqdUw== + dependencies: + debug "^4.1.1" + is-url "^1.2.4" + postcss "^7.0.2" + postcss-values-parser "^1.5.0" + +detective-sass@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/detective-sass/-/detective-sass-3.0.1.tgz#496b819efd1f5c4dd3f0e19b43a8634bdd6927c4" + integrity sha512-oSbrBozRjJ+QFF4WJFbjPQKeakoaY1GiR380NPqwdbWYd5wfl5cLWv0l6LsJVqrgWfFN1bjFqSeo32Nxza8Lbw== + dependencies: + debug "^4.1.1" + gonzales-pe "^4.2.3" + node-source-walk "^4.0.0" + +detective-scss@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/detective-scss/-/detective-scss-2.0.1.tgz#06f8c21ae6dedad1fccc26d544892d968083eaf8" + integrity sha512-VveyXW4WQE04s05KlJ8K0bG34jtHQVgTc9InspqoQxvnelj/rdgSAy7i2DXAazyQNFKlWSWbS+Ro2DWKFOKTPQ== + dependencies: + debug "^4.1.1" + gonzales-pe "^4.2.3" + node-source-walk "^4.0.0" + +detective-stylus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/detective-stylus/-/detective-stylus-1.0.0.tgz#50aee7db8babb990381f010c63fabba5b58e54cd" + integrity sha1-UK7n24uruZA4HwEMY/q7pbWOVM0= + +detective-typescript@^5.8.0: + version "5.8.0" + resolved "https://registry.yarnpkg.com/detective-typescript/-/detective-typescript-5.8.0.tgz#c46776571e26bad6c9ada020cb3cb4e5625d1311" + integrity sha512-SrsUCfCaDTF64QVMHMidRal+kmkbIc5zP8cxxZPsomWx9vuEUjBlSJNhf7/ypE5cLdJJDI4qzKDmyzqQ+iz/xg== + dependencies: + "@typescript-eslint/typescript-estree" "^2.29.0" + ast-module-types "^2.6.0" + node-source-walk "^4.2.0" + typescript "^3.8.3" + diff-sequences@^25.1.0: version "25.1.0" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-25.1.0.tgz#fd29a46f1c913fd66c22645dc75bffbe43051f32" @@ -1151,6 +1330,22 @@ end-of-stream@^1.1.0: dependencies: once "^1.4.0" +enhanced-resolve@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.3.0.tgz#3b806f3bfafc1ec7de69551ef93cca46c1704126" + integrity sha512-3e87LvavsdxyoCfGusJnrZ5G8SLPOFeHSNpZI/ATL9a5leXo2k0w6MKnbqhdBad9qTobSfB20Ld7UmgoNbAZkQ== + dependencies: + graceful-fs "^4.1.2" + memory-fs "^0.5.0" + tapable "^1.0.0" + +errno@^0.1.3: + version "0.1.7" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" + integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg== + dependencies: + prr "~1.0.1" + es-abstract@^1.17.0-next.1, es-abstract@^1.17.2: version "1.17.4" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.4.tgz#e3aedf19706b20e7c2594c35fc0d57605a79e184" @@ -1194,7 +1389,24 @@ escodegen@^1.11.1: optionalDependencies: source-map "~0.6.1" -esprima@^4.0.0, esprima@^4.0.1: +escodegen@^1.8.0: + version "1.14.3" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503" + integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== + dependencies: + esprima "^4.0.1" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + +eslint-visitor-keys@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" + integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== + +esprima@4.0.1, esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== @@ -1352,6 +1564,30 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" +file-exists-dazinatorfork@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/file-exists-dazinatorfork/-/file-exists-dazinatorfork-1.0.2.tgz#cd8d0d85f63e39dc81eceb0b687c44a2cca95c47" + integrity sha512-r70c72ln2YHzQINNfxDp02hAhbGkt1HffZ+Du8oetWDLjDtFja/Lm10lUaSh9e+wD+7VDvPee0b0C9SAy8pWZg== + +filing-cabinet@^2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/filing-cabinet/-/filing-cabinet-2.6.0.tgz#3d4d5093a98b6fae84cf282e8bded1b8ad5f9c0c" + integrity sha512-7kSlTScEkxoYKXCix7tAQ52ZeIHcx7ZWWArEZgXY+eTMe6yDYFdDhHdkXm9rSmvrrpzdZeR1wiufS1rUt4OzMA== + dependencies: + app-module-path "^2.2.0" + commander "^2.13.0" + debug "^4.1.1" + decomment "^0.9.2" + enhanced-resolve "^4.1.0" + is-relative-path "^1.0.2" + module-definition "^3.0.0" + module-lookup-amd "^6.1.0" + resolve "^1.11.1" + resolve-dependency-path "^2.0.0" + sass-lookup "^3.0.0" + stylus-lookup "^3.0.1" + typescript "^3.0.3" + fill-range@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" @@ -1377,6 +1613,18 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" +find@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/find/-/find-0.3.0.tgz#4082e8fc8d8320f1a382b5e4f521b9bc50775cb8" + integrity sha512-iSd+O4OEYV/I36Zl8MdYJO0xD82wH528SaCieTVHhclgiYNe9y+yPKSwK+A7/WsmHL1EZ+pYUJBXWTL5qofksw== + dependencies: + traverse-chain "~0.1.0" + +flatten@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.3.tgz#c1283ac9f27b368abc1e36d1ff7b04501a30356b" + integrity sha512-dVsPA/UwQ8+2uoFe5GHtiBMu48dWLTdsuEd7CKGlZlD78r1TTWBvDuFaFGKCo/ZfEr95Uk56vZoX86OsHkUeIg== + for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -1423,11 +1671,24 @@ gensync@^1.0.0-beta.1: resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.1.tgz#58f4361ff987e5ff6e1e7a210827aa371eaac269" integrity sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg== +get-amd-module-type@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-amd-module-type/-/get-amd-module-type-3.0.0.tgz#bb334662fa04427018c937774570de495845c288" + integrity sha512-99Q7COuACPfVt18zH9N4VAMyb81S6TUgJm2NgV6ERtkh9VIkAaByZkW530wl3lLN5KTtSrK9jVLxYsoP5hQKsw== + dependencies: + ast-module-types "^2.3.2" + node-source-walk "^4.0.0" + get-caller-file@^2.0.1: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +get-own-enumerable-property-symbols@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz#b5fde77f22cbe35f390b4e089922c50bce6ef664" + integrity sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g== + get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" @@ -1466,7 +1727,7 @@ glob-parent@~5.1.0: dependencies: is-glob "^4.0.1" -glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4: +glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: version "7.1.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== @@ -1490,6 +1751,13 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== +gonzales-pe@^4.2.3: + version "4.3.0" + resolved "https://registry.yarnpkg.com/gonzales-pe/-/gonzales-pe-4.3.0.tgz#fe9dec5f3c557eead09ff868c65826be54d067b3" + integrity sha512-otgSPpUmdWJ43VXyiNgEYE4luzHCL2pz4wQ0OnDluC6Eg4Ko3Vexy/SrSynglw/eR+OhkzmqFCZa/OFa/RgAOQ== + dependencies: + minimist "^1.2.5" + got@^6.7.1: version "6.7.1" resolved "https://registry.yarnpkg.com/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" @@ -1512,6 +1780,13 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.2.3: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== +graphviz@0.0.9: + version "0.0.9" + resolved "https://registry.yarnpkg.com/graphviz/-/graphviz-0.0.9.tgz#0bbf1df588c6a92259282da35323622528c4bbc4" + integrity sha512-SmoY2pOtcikmMCqCSy2NO1YsRfu9OO0wpTlOYW++giGjfX1a6gax/m1Fo8IdUd0/3H15cTOfR1SMKwohj4LKsg== + dependencies: + temp "~0.4.0" + growly@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" @@ -1639,6 +1914,11 @@ imurmurhash@^0.1.4: resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= +indexes-of@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/indexes-of/-/indexes-of-1.0.1.tgz#f30f716c8e2bd346c7b67d3df3915566a7c05607" + integrity sha1-8w9xbI4r00bHtn0985FVZqfAVgc= + inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -1647,7 +1927,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2: +inherits@2, inherits@~2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -1707,6 +1987,13 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" +is-core-module@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.1.0.tgz#a4cc031d9b1aca63eecbd18a650e13cb4eeab946" + integrity sha512-YcV7BgVMRFRua2FqQzKtTDMz8iCuLEyGKjr70q8Zm1yy2qKcurbFEd79PAdHV77oL3NrAaOVQIbMmiHQCHB7ZA== + dependencies: + has "^1.0.3" + is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" @@ -1791,6 +2078,11 @@ is-installed-globally@^0.1.0: global-dirs "^0.1.0" is-path-inside "^1.0.0" +is-interactive@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" + integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== + is-npm@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" @@ -1808,7 +2100,7 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -is-obj@^1.0.0: +is-obj@^1.0.0, is-obj@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= @@ -1839,6 +2131,16 @@ is-regex@^1.0.5: dependencies: has "^1.0.3" +is-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" + integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk= + +is-relative-path@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-relative-path/-/is-relative-path-1.0.2.tgz#091b46a0d67c1ed0fe85f1f8cfdde006bb251d46" + integrity sha1-CRtGoNZ8HtD+hfH4z93gBrslHUY= + is-retry-allowed@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz#d778488bd0a4666a3be8a1482b9f2baafedea8b4" @@ -1866,6 +2168,11 @@ is-typedarray@^1.0.0, is-typedarray@~1.0.0: resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= +is-url@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52" + integrity sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww== + is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" @@ -1876,7 +2183,7 @@ is-wsl@^2.1.1: resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.1.1.tgz#4a1c152d429df3d441669498e2486d3596ebaf1d" integrity sha512-umZHcSrwlDHo2TGMXv0DZ8dIUGunZ2Iv68YZnrmCiBPkZ4aaOhtv7pXJKeki9k3qJ3RJr0cDyitcl5wEH3AYog== -isarray@1.0.0: +isarray@1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= @@ -2453,6 +2760,13 @@ lodash@^4.17.13, lodash@^4.17.15: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== +log-symbols@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.0.0.tgz#69b3cc46d20f448eccdb75ea1fa733d9e821c920" + integrity sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA== + dependencies: + chalk "^4.0.0" + lolex@^5.0.0: version "5.1.2" resolved "https://registry.yarnpkg.com/lolex/-/lolex-5.1.2.tgz#953694d098ce7c07bc5ed6d0e42bc6c0c6d5a367" @@ -2473,6 +2787,34 @@ lru-cache@^4.0.1: pseudomap "^1.0.2" yallist "^2.1.2" +madge@^3.12.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/madge/-/madge-3.12.0.tgz#727c1ebb268150d52e6d0c3ccd382b4c7bd0bf19" + integrity sha512-9kA2W5RIbvH25CWc8tzPNn1X47AOcHEEwZJxWAMxhEOKEziVR1iMCbGCFUea5tWXs/A+xgJF59o/oSbNkOXpeg== + dependencies: + chalk "^4.1.0" + commander "^5.1.0" + commondir "^1.0.1" + debug "^4.0.1" + dependency-tree "^7.2.2" + detective-amd "^3.0.0" + detective-cjs "^3.1.1" + detective-es6 "^2.1.0" + detective-less "^1.0.2" + detective-postcss "^3.0.1" + detective-sass "^3.0.1" + detective-scss "^2.0.1" + detective-stylus "^1.0.0" + detective-typescript "^5.8.0" + graphviz "0.0.9" + ora "^5.1.0" + pluralize "^8.0.0" + precinct "^6.3.1" + pretty-ms "^7.0.0" + rc "^1.2.7" + typescript "^3.9.5" + walkdir "^0.4.1" + make-coverage-badge@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/make-coverage-badge/-/make-coverage-badge-1.2.0.tgz#125c337531ce7e036c64fa96a8b42ce60e33b437" @@ -2487,6 +2829,14 @@ make-dir@^1.0.0: dependencies: pify "^3.0.0" +make-dir@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" + integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== + dependencies: + pify "^4.0.1" + semver "^5.6.0" + make-dir@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.0.2.tgz#04a1acbf22221e1d6ef43559f43e05a90dbb4392" @@ -2518,6 +2868,14 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" +memory-fs@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.5.0.tgz#324c01288b88652966d161db77838720845a8e3c" + integrity sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA== + dependencies: + errno "^0.1.3" + readable-stream "^2.0.1" + merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" @@ -2579,7 +2937,7 @@ minimist@0.0.8: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= -minimist@^1.1.1, minimist@^1.2.0: +minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== @@ -2599,6 +2957,26 @@ mkdirp@0.x, mkdirp@^0.5.1: dependencies: minimist "0.0.8" +module-definition@^3.0.0, module-definition@^3.3.0: + version "3.3.1" + resolved "https://registry.yarnpkg.com/module-definition/-/module-definition-3.3.1.tgz#fedef71667713e36988b93d0626a4fe7b35aebfc" + integrity sha512-kLidGPwQ2yq484nSD+D3JoJp4Etc0Ox9P0L34Pu/cU4X4HcG7k7p62XI5BBuvURWMRX3RPyuhOcBHbKus+UH4A== + dependencies: + ast-module-types "^2.7.1" + node-source-walk "^4.0.0" + +module-lookup-amd@^6.1.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/module-lookup-amd/-/module-lookup-amd-6.2.0.tgz#70600008b3f26630fde9ef9ae6165ac69de6ecbb" + integrity sha512-uxHCj5Pw9psZiC1znjU2qPsubt6haCSsN9m7xmIdoTciEgfxUkE1vhtDvjHPuOXEZrVJhjKgkmkP+w73rRuelQ== + dependencies: + commander "^2.8.1" + debug "^4.1.0" + file-exists-dazinatorfork "^1.0.2" + find "^0.3.0" + requirejs "^2.3.5" + requirejs-config-file "^3.1.1" + mri@1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/mri/-/mri-1.1.4.tgz#7cb1dd1b9b40905f1fac053abe25b6720f44744a" @@ -2609,11 +2987,16 @@ ms@2.0.0: resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= -ms@^2.1.1: +ms@2.1.2, ms@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== +mute-stream@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" + integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== + nanomatch@^1.2.9: version "1.2.13" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" @@ -2662,6 +3045,13 @@ node-notifier@^6.0.0: shellwords "^0.1.1" which "^1.3.1" +node-source-walk@^4.0.0, node-source-walk@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/node-source-walk/-/node-source-walk-4.2.0.tgz#c2efe731ea8ba9c03c562aa0a9d984e54f27bc2c" + integrity sha512-hPs/QMe6zS94f5+jG3kk9E7TNm4P2SulrKiLWMzKszBfNZvL/V6wseHlTd7IvfW0NZWqPtK3+9yYNr+3USGteA== + dependencies: + "@babel/parser" "^7.0.0" + nodemon@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-2.0.2.tgz#9c7efeaaf9b8259295a97e5d4585ba8f0cbe50b0" @@ -2798,6 +3188,20 @@ optionator@^0.8.1: type-check "~0.3.2" word-wrap "~1.2.3" +ora@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/ora/-/ora-5.1.0.tgz#b188cf8cd2d4d9b13fd25383bc3e5cba352c94f8" + integrity sha512-9tXIMPvjZ7hPTbk8DFq1f7Kow/HU/pQYB60JbNq+QnGwcyhWVZaQ4hM9zQDEsPxw/muLpgiHSaumUZxCAmod/w== + dependencies: + chalk "^4.1.0" + cli-cursor "^3.1.0" + cli-spinners "^2.4.0" + is-interactive "^1.0.0" + log-symbols "^4.0.0" + mute-stream "0.0.8" + strip-ansi "^6.0.0" + wcwidth "^1.0.1" + p-each-series@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-2.1.0.tgz#961c8dd3f195ea96c747e636b262b800a6b1af48" @@ -2842,6 +3246,11 @@ package-json@^4.0.0: registry-url "^3.0.3" semver "^5.1.0" +parse-ms@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/parse-ms/-/parse-ms-2.1.0.tgz#348565a753d4391fa524029956b172cb7753097d" + integrity sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA== + parse5@5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.0.tgz#c59341c9723f414c452975564c7c00a68d58acd2" @@ -2897,6 +3306,11 @@ pify@^3.0.0: resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= +pify@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" + integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== + pirates@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87" @@ -2911,6 +3325,11 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" +pluralize@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-8.0.0.tgz#1a6fa16a38d12a1901e0320fa017051c539ce3b1" + integrity sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA== + pn@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" @@ -2921,6 +3340,43 @@ posix-character-classes@^0.1.0: resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= +postcss-values-parser@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/postcss-values-parser/-/postcss-values-parser-1.5.0.tgz#5d9fa63e2bcb0179ce48f3235303765eb89f3047" + integrity sha512-3M3p+2gMp0AH3da530TlX8kiO1nxdTnc3C6vr8dMxRLIlh8UYkz0/wcwptSXjhtx2Fr0TySI7a+BHDQ8NL7LaQ== + dependencies: + flatten "^1.0.2" + indexes-of "^1.0.1" + uniq "^1.0.1" + +postcss@^7.0.2: + version "7.0.35" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.35.tgz#d2be00b998f7f211d8a276974079f2e92b970e24" + integrity sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg== + dependencies: + chalk "^2.4.2" + source-map "^0.6.1" + supports-color "^6.1.0" + +precinct@^6.3.1: + version "6.3.1" + resolved "https://registry.yarnpkg.com/precinct/-/precinct-6.3.1.tgz#8ad735a8afdfc48b56ed39c9ad3bf999b6b928dc" + integrity sha512-JAwyLCgTylWminoD7V0VJwMElWmwrVSR6r9HaPWCoswkB4iFzX7aNtO7VBfAVPy+NhmjKb8IF8UmlWJXzUkOIQ== + dependencies: + commander "^2.20.3" + debug "^4.1.1" + detective-amd "^3.0.0" + detective-cjs "^3.1.1" + detective-es6 "^2.1.0" + detective-less "^1.0.2" + detective-postcss "^3.0.1" + detective-sass "^3.0.1" + detective-scss "^2.0.1" + detective-stylus "^1.0.0" + detective-typescript "^5.8.0" + module-definition "^3.3.0" + node-source-walk "^4.2.0" + prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" @@ -2946,6 +3402,18 @@ pretty-format@^25.1.0: ansi-styles "^4.0.0" react-is "^16.12.0" +pretty-ms@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-7.0.1.tgz#7d903eaab281f7d8e03c66f867e239dc32fb73e8" + integrity sha512-973driJZvxiGOQ5ONsFhOF/DtzPMOMtgC11kCpUrPGMTgqp2q/1gwzCquocrN33is0VZ5GFHXZYMM9l6h67v2Q== + dependencies: + parse-ms "^2.1.0" + +process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + prompts@^2.0.1: version "2.3.1" resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.3.1.tgz#b63a9ce2809f106fa9ae1277c275b167af46ea05" @@ -2954,6 +3422,11 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.4" +prr@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" + integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= + pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" @@ -2987,7 +3460,7 @@ qs@~6.5.2: resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== -rc@^1.0.1, rc@^1.1.6: +rc@^1.0.1, rc@^1.1.6, rc@^1.2.7: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== @@ -3002,6 +3475,19 @@ react-is@^16.12.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.0.tgz#0f37c3613c34fe6b37cd7f763a0d6293ab15c527" integrity sha512-GFMtL0vHkiBv9HluwNZTggSn/sCyEt9n02aM0dSAjGGyqyNlAyftYm4phPxdvCigG15JreC5biwxCgTAJZ7yAA== +readable-stream@^2.0.1: + version "2.3.7" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" + integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + readdirp@~3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.3.0.tgz#984458d13a1e42e2e9f5841b129e162f369aff17" @@ -3106,6 +3592,20 @@ require-main-filename@^2.0.0: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== +requirejs-config-file@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/requirejs-config-file/-/requirejs-config-file-3.1.2.tgz#de8c0b3eebdf243511c994a8a24b006f8b825997" + integrity sha512-sdLWywcDuNz7EIOhenSbRfT4YF84nItDv90coN2htbokjmU2QeyQuSBZILQUKNksepl8UPVU+hgYySFaDxbJPQ== + dependencies: + esprima "^4.0.0" + make-dir "^2.1.0" + stringify-object "^3.2.1" + +requirejs@^2.3.5: + version "2.3.6" + resolved "https://registry.yarnpkg.com/requirejs/-/requirejs-2.3.6.tgz#e5093d9601c2829251258c0b9445d4d19fa9e7c9" + integrity sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg== + resolve-cwd@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" @@ -3113,6 +3613,11 @@ resolve-cwd@^3.0.0: dependencies: resolve-from "^5.0.0" +resolve-dependency-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-dependency-path/-/resolve-dependency-path-2.0.0.tgz#11700e340717b865d216c66cabeb4a2a3c696736" + integrity sha512-DIgu+0Dv+6v2XwRaNWnumKu7GPufBBOr5I1gRPJHkvghrfCGOooJODFvgFimX/KRxk9j0whD2MnKHzM1jYvk9w== + resolve-from@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" @@ -3135,6 +3640,22 @@ resolve@1.x, resolve@^1.3.2: dependencies: path-parse "^1.0.6" +resolve@^1.11.1: + version "1.19.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.19.0.tgz#1af5bf630409734a067cae29318aac7fa29a267c" + integrity sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg== + dependencies: + is-core-module "^2.1.0" + path-parse "^1.0.6" + +restore-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" + integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== + dependencies: + onetime "^5.1.0" + signal-exit "^3.0.2" + ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" @@ -3157,7 +3678,7 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.2: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== -safe-buffer@~5.1.1: +safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== @@ -3189,6 +3710,13 @@ sane@^4.0.3: minimist "^1.1.1" walker "~1.0.5" +sass-lookup@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/sass-lookup/-/sass-lookup-3.0.0.tgz#3b395fa40569738ce857bc258e04df2617c48cac" + integrity sha512-TTsus8CfFRn1N44bvdEai1no6PqdmDiQUiqW5DlpmtT+tYnIt1tXtDIph5KA1efC+LmioJXSnCtUVpcK9gaKIg== + dependencies: + commander "^2.16.0" + saxes@^3.1.9: version "3.1.11" resolved "https://registry.yarnpkg.com/saxes/-/saxes-3.1.11.tgz#d59d1fd332ec92ad98a2e0b2ee644702384b1c5b" @@ -3203,7 +3731,7 @@ semver-diff@^2.0.0: dependencies: semver "^5.0.3" -semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5, semver@^5.5.0, semver@^5.7.1: +semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5, semver@^5.5.0, semver@^5.6.0, semver@^5.7.1: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -3218,6 +3746,11 @@ semver@^7.1.1: resolved "https://registry.yarnpkg.com/semver/-/semver-7.1.3.tgz#e4345ce73071c53f336445cfc19efb1c311df2a6" integrity sha512-ekM0zfiA9SCBlsKa2X1hxyxiI4L3B6EbVJkkdgQXnSEEaHlGdvyodMruTiulSRWMMB4NeIuYNMC9rTKTz97GxA== +semver@^7.3.2: + version "7.3.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938" + integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== + set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -3432,6 +3965,22 @@ string.prototype.trimright@^2.1.1: define-properties "^1.1.3" function-bind "^1.1.1" +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +stringify-object@^3.2.1: + version "3.3.0" + resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" + integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw== + dependencies: + get-own-enumerable-property-symbols "^3.0.0" + is-obj "^1.0.1" + is-regexp "^1.0.0" + strip-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" @@ -3473,6 +4022,14 @@ strip-json-comments@~2.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= +stylus-lookup@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/stylus-lookup/-/stylus-lookup-3.0.2.tgz#c9eca3ff799691020f30b382260a67355fefdddd" + integrity sha512-oEQGHSjg/AMaWlKe7gqsnYzan8DLcGIHe0dUaFkucZZ14z4zjENRlQMCHT4FNsiWnJf17YN9OvrCfCoi7VvOyg== + dependencies: + commander "^2.8.1" + debug "^4.1.0" + supports-color@^5.3.0, supports-color@^5.5.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -3480,6 +4037,13 @@ supports-color@^5.3.0, supports-color@^5.5.0: dependencies: has-flag "^3.0.0" +supports-color@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" + integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== + dependencies: + has-flag "^3.0.0" + supports-color@^7.0.0, supports-color@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1" @@ -3500,6 +4064,16 @@ symbol-tree@^3.2.2: resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== +tapable@^1.0.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" + integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== + +temp@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/temp/-/temp-0.4.0.tgz#671ad63d57be0fe9d7294664b3fc400636678a60" + integrity sha1-ZxrWPVe+D+nXKUZks/xABjZnimA= + term-size@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/term-size/-/term-size-1.2.0.tgz#458b83887f288fc56d6fffbfad262e26638efa69" @@ -3607,6 +4181,11 @@ tr46@^1.0.1: dependencies: punycode "^2.1.0" +traverse-chain@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/traverse-chain/-/traverse-chain-0.1.0.tgz#61dbc2d53b69ff6091a12a168fd7d433107e40f1" + integrity sha1-YdvC1Ttp/2CRoSoWj9fUMxB+QPE= + ts-jest@^25.2.1: version "25.2.1" resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-25.2.1.tgz#49bf05da26a8b7fbfbc36b4ae2fcdc2fef35c85d" @@ -3659,6 +4238,13 @@ tsutils@^2.29.0: dependencies: tslib "^1.8.1" +tsutils@^3.17.1: + version "3.17.1" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759" + integrity sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g== + dependencies: + tslib "^1.8.1" + tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -3700,6 +4286,11 @@ typescript@4.0: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.5.tgz#ae9dddfd1069f1cb5beb3ef3b2170dd7c1332389" integrity sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ== +typescript@^3.0.3, typescript@^3.8.3, typescript@^3.9.5, typescript@^3.9.7: + version "3.9.7" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa" + integrity sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw== + undefsafe@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.3.tgz#6b166e7094ad46313b2202da7ecc2cd7cc6e7aae" @@ -3717,6 +4308,11 @@ union-value@^1.0.0: is-extendable "^0.1.1" set-value "^2.0.1" +uniq@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" + integrity sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8= + unique-string@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-1.0.0.tgz#9e1057cca851abb93398f8b33ae187b99caec11a" @@ -3777,6 +4373,11 @@ use@^3.1.0: resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + util.promisify@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.1.tgz#6baf7774b80eeb0f7520d8b81d07982a59abbaee" @@ -3826,6 +4427,11 @@ w3c-xmlserializer@^1.1.2: webidl-conversions "^4.0.2" xml-name-validator "^3.0.0" +walkdir@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/walkdir/-/walkdir-0.4.1.tgz#dc119f83f4421df52e3061e514228a2db20afa39" + integrity sha512-3eBwRyEln6E1MSzcxcVpQIhRG8Q1jLvEqRmCZqS3dsfXEDR/AhOF4d+jHg1qvDCpYaVRZjENPQyrVxAkQqxPgQ== + walker@^1.0.7, walker@~1.0.5: version "1.0.7" resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" @@ -3833,6 +4439,13 @@ walker@^1.0.7, walker@~1.0.5: dependencies: makeerror "1.0.x" +wcwidth@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" + integrity sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g= + dependencies: + defaults "^1.0.3" + webidl-conversions@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" From cc23cd41f66b24d9373ba941124d55b343020c6e Mon Sep 17 00:00:00 2001 From: Olzhas Alexandrov Date: Wed, 18 Nov 2020 23:10:41 -0600 Subject: [PATCH 2/2] wip removal of circular references --- src/PseudoPromise.ts | 4 +- src/ZodDef.ts | 56 ++++++++++++ src/ZodError.ts | 3 +- src/__tests__/map.tests.ts | 3 +- src/codegen.ts | 7 +- src/defaultErrorMap.ts | 3 +- src/helpers/maskUtil.ts | 2 +- src/helpers/objectUtil.ts | 10 ++- src/helpers/partialUtil.ts | 31 ++++--- src/index.ts | 178 +++++++++++++++---------------------- src/internal.ts | 46 ++++++++++ src/isScalar.ts | 7 +- src/parser.ts | 82 +++++++++-------- src/switcher.ts | 61 +++++++------ src/types/any.ts | 13 ++- src/types/array.ts | 28 +++--- src/types/base.ts | 13 +-- src/types/bigint.ts | 13 ++- src/types/boolean.ts | 13 ++- src/types/date.ts | 13 ++- src/types/enum.ts | 21 +++-- src/types/function.ts | 31 ++++--- src/types/intersection.ts | 23 +++-- src/types/lazy.ts | 28 +++--- src/types/literal.ts | 14 ++- src/types/map.ts | 22 ++--- src/types/nativeEnum.ts | 14 +-- src/types/never.ts | 10 +-- src/types/null.ts | 12 ++- src/types/nullable.ts | 24 +++-- src/types/number.ts | 21 ++--- src/types/object.ts | 79 ++++++++-------- src/types/optional.ts | 2 +- src/types/promise.ts | 17 ++-- src/types/record.ts | 19 ++-- src/types/string.ts | 22 ++--- src/types/transformer.ts | 29 +++--- src/types/tuple.ts | 34 +++---- src/types/undefined.ts | 10 +-- src/types/union.ts | 24 ++--- src/types/unknown.ts | 10 +-- src/types/void.ts | 10 +-- 42 files changed, 550 insertions(+), 512 deletions(-) create mode 100644 src/ZodDef.ts create mode 100644 src/internal.ts diff --git a/src/PseudoPromise.ts b/src/PseudoPromise.ts index 1c3df6667..cadcec260 100644 --- a/src/PseudoPromise.ts +++ b/src/PseudoPromise.ts @@ -1,6 +1,4 @@ -import { INVALID } from './helpers/util'; -import { ZodError } from './ZodError'; -// import { INVALID } from './util'; +import { INVALID, ZodError } from './internal'; type Func = (arg: any, ctx: { async: boolean }) => any; type FuncItem = { type: 'function'; function: Func }; diff --git a/src/ZodDef.ts b/src/ZodDef.ts new file mode 100644 index 000000000..ccbd2614f --- /dev/null +++ b/src/ZodDef.ts @@ -0,0 +1,56 @@ +import { ZodStringDef } from './types/string'; +import { ZodNumberDef } from './types/number'; +import { ZodBigIntDef } from './types/bigint'; +import { ZodBooleanDef } from './types/boolean'; +import { ZodDateDef } from './types/date'; +import { ZodUndefinedDef } from './types/undefined'; +import { ZodNullDef } from './types/null'; +import { ZodAnyDef } from './types/any'; +import { ZodUnknownDef } from './types/unknown'; +import { ZodNeverDef } from './types/never'; +import { ZodVoidDef } from './types/void'; +import { ZodArrayDef } from './types/array'; +import { ZodObjectDef } from './types/object'; +import { ZodUnionDef } from './types/union'; +import { ZodIntersectionDef } from './types/intersection'; +import { ZodTupleDef } from './types/tuple'; +import { ZodRecordDef } from './types/record'; +import { ZodMapDef } from './types/map'; +import { ZodFunctionDef } from './types/function'; +import { ZodLazyDef } from './types/lazy'; +import { ZodLiteralDef } from './types/literal'; +import { ZodEnumDef } from './types/enum'; +import { ZodNativeEnumDef } from './types/nativeEnum'; +import { ZodPromiseDef } from './types/promise'; +import { ZodTransformerDef } from './types/transformer'; +import { ZodOptionalDef } from './types/optional'; +import { ZodNullableDef } from './types/nullable'; + +export type ZodDef = + | ZodStringDef + | ZodNumberDef + | ZodBigIntDef + | ZodBooleanDef + | ZodDateDef + | ZodUndefinedDef + | ZodNullDef + | ZodAnyDef + | ZodUnknownDef + | ZodNeverDef + | ZodVoidDef + | ZodArrayDef + | ZodObjectDef + | ZodUnionDef + | ZodIntersectionDef + | ZodTupleDef + | ZodRecordDef + | ZodMapDef + | ZodFunctionDef + | ZodLazyDef + | ZodLiteralDef + | ZodEnumDef + | ZodTransformerDef + | ZodNativeEnumDef + | ZodOptionalDef + | ZodNullableDef + | ZodPromiseDef; diff --git a/src/ZodError.ts b/src/ZodError.ts index e92217968..6a0b8b9d6 100644 --- a/src/ZodError.ts +++ b/src/ZodError.ts @@ -1,5 +1,4 @@ -import { util } from './helpers/util'; -import { ZodParsedType } from './parser'; +import { util, ZodParsedType } from './internal'; export const ZodIssueCode = util.arrayToEnum([ 'invalid_type', diff --git a/src/__tests__/map.tests.ts b/src/__tests__/map.tests.ts index 15a09897d..4b4351a86 100644 --- a/src/__tests__/map.tests.ts +++ b/src/__tests__/map.tests.ts @@ -1,6 +1,5 @@ import * as z from '../index'; -import { util } from '../helpers/util'; -import { ZodIssueCode } from '../index'; +import { util, ZodIssueCode } from '../internal'; const stringMap = z.map(z.string(), z.string()); type stringMap = z.infer; diff --git a/src/codegen.ts b/src/codegen.ts index 8679e9557..824b032e4 100644 --- a/src/codegen.ts +++ b/src/codegen.ts @@ -1,12 +1,9 @@ -// import * as z from './index'; -import { ZodDef } from '.'; -import { util } from './helpers/util'; -import { ZodType, ZodTypes } from './types/base'; +import { ZodDef, util, ZodType, ZodTypes } from './internal'; type TypeResult = { schema: any; id: string; type: string }; const isOptional = (schema: ZodType): boolean => { - // const def: z.ZodDef = schema._def; + // const def: ZodDef = schema._def; // if (def.t === ZodTypes.undefined) return true; // else if (def.t === ZodTypes.intersection) { // return isOptional(def.right) && isOptional(def.left); diff --git a/src/defaultErrorMap.ts b/src/defaultErrorMap.ts index b2a1ebea9..2754d5cca 100644 --- a/src/defaultErrorMap.ts +++ b/src/defaultErrorMap.ts @@ -1,5 +1,4 @@ -import { ZodIssueCode, ZodIssueOptionalMessage } from './ZodError'; -import { util } from './helpers/util'; +import { ZodIssueCode, ZodIssueOptionalMessage, util } from './internal'; type ErrorMapCtx = { // path: (string | number)[]; diff --git a/src/helpers/maskUtil.ts b/src/helpers/maskUtil.ts index 49bd09b78..43c08ff57 100644 --- a/src/helpers/maskUtil.ts +++ b/src/helpers/maskUtil.ts @@ -1,4 +1,4 @@ -import { Primitive } from './primitive'; +import { Primitive } from '../internal'; type AnyObject = { [k: string]: any }; type IsAny = any extends T ? (T extends any ? true : false) : false; diff --git a/src/helpers/objectUtil.ts b/src/helpers/objectUtil.ts index a6175be94..f69e2a70a 100644 --- a/src/helpers/objectUtil.ts +++ b/src/helpers/objectUtil.ts @@ -1,6 +1,10 @@ -import { ZodRawShape, ZodTypes } from '../types/base'; -import { ZodIntersection } from '../types/intersection'; -import { ZodObject, AnyZodObject } from '../types/object'; +import { + ZodRawShape, + ZodTypes, + ZodIntersection, + ZodObject, + AnyZodObject, +} from '../internal'; export namespace objectUtil { // export interface ZodObjectParams { diff --git a/src/helpers/partialUtil.ts b/src/helpers/partialUtil.ts index 45934b4ec..7b85b91ba 100644 --- a/src/helpers/partialUtil.ts +++ b/src/helpers/partialUtil.ts @@ -1,28 +1,27 @@ -import * as z from '../index'; -import { AnyZodObject } from '../types/object'; +import { AnyZodObject, ZodTypeAny, ZodObject, ZodOptional } from '../internal'; export namespace partialUtil { - export type RootDeepPartial = { - // optional: T extends z.ZodOptional ? T : z.ZodOptional; - // array: T extends z.ZodArray ? z.ZodArray> : never; + export type RootDeepPartial = { + // optional: T extends ZodOptional ? T : ZodOptional; + // array: T extends ZodArray ? ZodArray> : never; object: T extends AnyZodObject - ? z.ZodObject< + ? ZodObject< { [k in keyof T['_shape']]: DeepPartial }, T['_unknownKeys'], T['_catchall'] > : never; - rest: ReturnType; // z.ZodOptional; + rest: ReturnType; // ZodOptional; }[T extends AnyZodObject - ? 'object' // T extends z.ZodOptional // ? 'optional' // : + ? 'object' // T extends ZodOptional // ? 'optional' // : : 'rest']; - export type DeepPartial = { - // optional: T extends z.ZodOptional ? T : z.ZodOptional; - // array: T extends z.ZodArray ? z.ZodArray> : never; - object: T extends z.ZodObject - ? z.ZodOptional< - z.ZodObject< + export type DeepPartial = { + // optional: T extends ZodOptional ? T : ZodOptional; + // array: T extends ZodArray ? ZodArray> : never; + object: T extends ZodObject + ? ZodOptional< + ZodObject< { [k in keyof Shape]: DeepPartial }, Params, Catchall @@ -30,7 +29,7 @@ export namespace partialUtil { > : never; rest: ReturnType; - }[T extends z.ZodObject - ? 'object' // T extends z.ZodOptional // ? 'optional' // : + }[T extends ZodObject + ? 'object' // T extends ZodOptional // ? 'optional' // : : 'rest']; } diff --git a/src/index.ts b/src/index.ts index 10192d4ce..113b3f9aa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,49 +1,80 @@ /* ZOD */ - -import { ZodString, ZodStringDef } from './types/string'; -import { ZodNumber, ZodNumberDef } from './types/number'; -import { ZodBigInt, ZodBigIntDef } from './types/bigint'; -import { ZodBoolean, ZodBooleanDef } from './types/boolean'; -import { ZodDate, ZodDateDef } from './types/date'; -import { ZodUndefined, ZodUndefinedDef } from './types/undefined'; -import { ZodNull, ZodNullDef } from './types/null'; -import { ZodAny, ZodAnyDef } from './types/any'; -import { ZodUnknown, ZodUnknownDef } from './types/unknown'; -import { ZodNever, ZodNeverDef } from './types/never'; -import { ZodVoid, ZodVoidDef } from './types/void'; -import { ZodArray, ZodArrayDef } from './types/array'; -import { ZodObject, ZodObjectDef } from './types/object'; -import { ZodUnion, ZodUnionDef } from './types/union'; -import { ZodIntersection, ZodIntersectionDef } from './types/intersection'; -import { ZodTuple, ZodTupleDef } from './types/tuple'; -import { ZodRecord, ZodRecordDef } from './types/record'; -import { ZodMap, ZodMapDef } from './types/map'; -import { ZodFunction, ZodFunctionDef } from './types/function'; -import { ZodLazy, ZodLazyDef } from './types/lazy'; -import { ZodLiteral, ZodLiteralDef } from './types/literal'; -import { ZodEnum, ZodEnumDef } from './types/enum'; -import { ZodNativeEnum, ZodNativeEnumDef } from './types/nativeEnum'; -import { ZodPromise, ZodPromiseDef } from './types/promise'; -import { ZodTransformer, ZodTransformerDef } from './types/transformer'; -import { ZodOptional, ZodOptionalDef } from './types/optional'; -import { ZodNullable, ZodNullableDef } from './types/nullable'; import { + ZodString, + ZodNumber, + ZodBigInt, + ZodBoolean, + ZodDate, + ZodUndefined, + ZodNull, + ZodAny, + ZodUnknown, + ZodNever, + ZodVoid, + ZodArray, + ZodObject, + ZodUnion, + ZodIntersection, + ZodTuple, + ZodRecord, + ZodMap, + ZodFunction, + ZodLazy, + ZodLiteral, + ZodEnum, + ZodNativeEnum, + ZodPromise, + ZodTransformer, + ZodOptional, + ZodNullable, + ZodCodeGenerator, + ZodTypeAny, + ZodType, +} from './internal'; + +export * from './ZodError'; +export { TypeOf, + TypeOf as infer, input, output, - ZodType, - ZodTypeAny, + ZodDef, ZodTypeDef, ZodTypes, -} from './types/base'; - -// export { ZodIssueCode } from './ZodError'; - -import { ZodParsedType } from './parser'; -import { ZodErrorMap } from './defaultErrorMap'; -import { ZodCodeGenerator } from './codegen'; - -export { ZodTypeDef, ZodTypes }; + ZodString, + ZodNumber, + ZodBigInt, + ZodBoolean, + ZodDate, + ZodUndefined, + ZodNull, + ZodAny, + ZodUnknown, + ZodNever, + ZodVoid, + ZodArray, + ZodObject, + ZodUnion, + ZodIntersection, + ZodTuple, + ZodRecord, + ZodFunction, + ZodLazy, + ZodLiteral, + ZodEnum, + ZodNativeEnum, + ZodPromise, + ZodTransformer, + ZodOptional, + ZodNullable, + ZodType, + ZodType as Schema, + ZodType as ZodSchema, + ZodTypeAny, + ZodErrorMap, + ZodParsedType, + ZodCodeGenerator, +} from './internal'; const stringType = ZodString.create; const numberType = ZodNumber.create; @@ -131,72 +162,3 @@ export { export const late = { object: ZodObject.lazycreate, }; - -export { - ZodString, - ZodNumber, - ZodBigInt, - ZodBoolean, - ZodDate, - ZodUndefined, - ZodNull, - ZodAny, - ZodUnknown, - ZodNever, - ZodVoid, - ZodArray, - ZodObject, - ZodUnion, - ZodIntersection, - ZodTuple, - ZodRecord, - ZodFunction, - ZodLazy, - ZodLiteral, - ZodEnum, - ZodNativeEnum, - ZodPromise, - ZodTransformer, - ZodOptional, - ZodNullable, - ZodType, - ZodType as Schema, - ZodType as ZodSchema, - ZodTypeAny, - ZodErrorMap, - ZodParsedType, - ZodCodeGenerator, -}; - -export { TypeOf, TypeOf as infer, input, output }; - -export * from './ZodError'; - -export type ZodDef = - | ZodStringDef - | ZodNumberDef - | ZodBigIntDef - | ZodBooleanDef - | ZodDateDef - | ZodUndefinedDef - | ZodNullDef - | ZodAnyDef - | ZodUnknownDef - | ZodNeverDef - | ZodVoidDef - | ZodArrayDef - | ZodObjectDef - | ZodUnionDef - | ZodIntersectionDef - | ZodTupleDef - | ZodRecordDef - | ZodMapDef - | ZodFunctionDef - | ZodLazyDef - | ZodLiteralDef - | ZodEnumDef - | ZodTransformerDef - | ZodNativeEnumDef - | ZodOptionalDef - | ZodNullableDef - | ZodPromiseDef; diff --git a/src/internal.ts b/src/internal.ts new file mode 100644 index 000000000..df6ca8f8b --- /dev/null +++ b/src/internal.ts @@ -0,0 +1,46 @@ +/** + * Internal pattern to get rid of circular dependencies + * @see https://medium.com/p/a04c987cf0de + */ +export * from './ZodError'; +export * from './helpers/util'; +export * from './types/string'; +export * from './types/number'; +export * from './types/bigint'; +export * from './types/boolean'; +export * from './types/date'; +export * from './types/undefined'; +export * from './types/null'; +export * from './types/any'; +export * from './types/unknown'; +export * from './types/never'; +export * from './types/void'; +export * from './types/array'; +export * from './types/object'; +export * from './types/union'; +export * from './types/intersection'; +export * from './types/tuple'; +export * from './types/record'; +export * from './types/map'; +export * from './types/function'; +export * from './types/lazy'; +export * from './types/literal'; +export * from './types/enum'; +export * from './types/nativeEnum'; +export * from './types/promise'; +export * from './types/transformer'; +export * from './types/optional'; +export * from './types/nullable'; +export * from './types/base'; +export * from './helpers/errorUtil'; +export * from './helpers/maskUtil'; +export * from './helpers/Mocker'; +export * from './helpers/objectUtil'; +export * from './helpers/partialUtil'; +export * from './helpers/primitive'; +export * from './parser'; +export * from './PseudoPromise'; +export * from './isScalar'; +export * from './defaultErrorMap'; +export * from './codegen'; +export * from './ZodDef'; diff --git a/src/isScalar.ts b/src/isScalar.ts index 5b44464e3..02222ab08 100644 --- a/src/isScalar.ts +++ b/src/isScalar.ts @@ -1,6 +1,7 @@ -import { ZodDef } from '.'; -import { util } from './helpers/util'; -import { ZodType, ZodTypes } from './types/base'; +import { ZodDef, util, ZodType, ZodTypes } from './internal'; +// import { ZodDef } from './ZodDef'; +// import { util } from './helpers/util'; +// import { ZodType, ZodTypes } from './types/base'; export const isScalar = ( schema: ZodType, diff --git a/src/parser.ts b/src/parser.ts index c1cc0288f..7a8e2776e 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -1,15 +1,19 @@ -import * as z from './types/base'; - import { ZodError, ZodIssueCode, ZodIssue, ZodIssueOptionalMessage, -} from './ZodError'; -import { INVALID, util } from './helpers/util'; -import { ZodErrorMap, defaultErrorMap } from './defaultErrorMap'; -import { PseudoPromise } from './PseudoPromise'; -import { ZodDef } from './index'; + INVALID, + util, + ZodErrorMap, + defaultErrorMap, + PseudoPromise, + ZodDef, + ZodType, + ZodTypes, + inputSchema, + RefinementCtx, +} from './internal'; export const getParsedType = (data: any): ZodParsedType => { if (typeof data === 'string') return 'string'; @@ -80,7 +84,7 @@ export type MakeErrorData = stripPath & { export type ParseParams = { seen?: { - schema: z.ZodType; + schema: ZodType; objects: { input: any; error?: ZodError; output: any }[]; }[]; path?: (string | number)[]; @@ -89,7 +93,7 @@ export type ParseParams = { runAsyncValidationsInSeries?: boolean; }; -export const ZodParser = (schema: z.ZodType) => ( +export const ZodParser = (schema: ZodType) => ( data: any, baseParams: ParseParams = { seen: [], errorMap: defaultErrorMap, path: [] }, ) => { @@ -186,7 +190,7 @@ export const ZodParser = (schema: z.ZodType) => ( // ); // console.log(JSON.stringify(data, null, 2)); switch (def.t) { - case z.ZodTypes.string: + case ZodTypes.string: if (parsedType !== ZodParsedType.string) { ERROR.addIssue( makeError({ @@ -201,7 +205,7 @@ export const ZodParser = (schema: z.ZodType) => ( PROMISE = PseudoPromise.resolve(data); break; - case z.ZodTypes.number: + case ZodTypes.number: if (parsedType !== ZodParsedType.number) { ERROR.addIssue( makeError({ @@ -226,7 +230,7 @@ export const ZodParser = (schema: z.ZodType) => ( } PROMISE = PseudoPromise.resolve(data); break; - case z.ZodTypes.bigint: + case ZodTypes.bigint: if (parsedType !== ZodParsedType.bigint) { ERROR.addIssue( makeError({ @@ -240,7 +244,7 @@ export const ZodParser = (schema: z.ZodType) => ( } PROMISE = PseudoPromise.resolve(data); break; - case z.ZodTypes.boolean: + case ZodTypes.boolean: if (parsedType !== ZodParsedType.boolean) { ERROR.addIssue( makeError({ @@ -254,7 +258,7 @@ export const ZodParser = (schema: z.ZodType) => ( } PROMISE = PseudoPromise.resolve(data); break; - case z.ZodTypes.undefined: + case ZodTypes.undefined: if (parsedType !== ZodParsedType.undefined) { ERROR.addIssue( makeError({ @@ -268,7 +272,7 @@ export const ZodParser = (schema: z.ZodType) => ( } PROMISE = PseudoPromise.resolve(data); break; - case z.ZodTypes.null: + case ZodTypes.null: if (parsedType !== ZodParsedType.null) { ERROR.addIssue( makeError({ @@ -282,13 +286,13 @@ export const ZodParser = (schema: z.ZodType) => ( } PROMISE = PseudoPromise.resolve(data); break; - case z.ZodTypes.any: + case ZodTypes.any: PROMISE = PseudoPromise.resolve(data); break; - case z.ZodTypes.unknown: + case ZodTypes.unknown: PROMISE = PseudoPromise.resolve(data); break; - case z.ZodTypes.never: + case ZodTypes.never: ERROR.addIssue( makeError({ code: ZodIssueCode.invalid_type, @@ -298,7 +302,7 @@ export const ZodParser = (schema: z.ZodType) => ( ); PROMISE = PseudoPromise.resolve(INVALID); break; - case z.ZodTypes.void: + case ZodTypes.void: if ( parsedType !== ZodParsedType.undefined && parsedType !== ZodParsedType.null @@ -315,7 +319,7 @@ export const ZodParser = (schema: z.ZodType) => ( } PROMISE = PseudoPromise.resolve(data); break; - case z.ZodTypes.array: + case ZodTypes.array: RESULT.output = []; if (parsedType !== ZodParsedType.array) { ERROR.addIssue( @@ -365,7 +369,7 @@ export const ZodParser = (schema: z.ZodType) => ( // THROW(); // } break; - case z.ZodTypes.map: + case ZodTypes.map: if (parsedType !== ZodParsedType.map) { ERROR.addIssue( makeError({ @@ -514,7 +518,7 @@ export const ZodParser = (schema: z.ZodType) => ( return returnedMap; }); break; - case z.ZodTypes.object: + case ZodTypes.object: RESULT.output = {}; if (parsedType !== ZodParsedType.object) { ERROR.addIssue( @@ -636,7 +640,7 @@ export const ZodParser = (schema: z.ZodType) => ( }); break; - case z.ZodTypes.union: + case ZodTypes.union: // let parsedUnion: any; let isValid = false; const unionErrors: ZodError[] = []; @@ -712,7 +716,7 @@ export const ZodParser = (schema: z.ZodType) => ( // } // PROMISE = parsedUnion; break; - case z.ZodTypes.intersection: + case ZodTypes.intersection: // let parsedIntersection:any; // let parsedLeft: any; // let parsedRight: any; @@ -764,7 +768,7 @@ export const ZodParser = (schema: z.ZodType) => ( break; - case z.ZodTypes.optional: + case ZodTypes.optional: if (parsedType === ZodParsedType.undefined) { PROMISE = PseudoPromise.resolve(undefined); break; @@ -782,7 +786,7 @@ export const ZodParser = (schema: z.ZodType) => ( } }); break; - case z.ZodTypes.nullable: + case ZodTypes.nullable: if (parsedType === ZodParsedType.null) { PROMISE = PseudoPromise.resolve(null); break; @@ -800,7 +804,7 @@ export const ZodParser = (schema: z.ZodType) => ( } }); break; - case z.ZodTypes.tuple: + case ZodTypes.tuple: if (parsedType !== ZodParsedType.array) { ERROR.addIssue( makeError({ @@ -872,11 +876,11 @@ export const ZodParser = (schema: z.ZodType) => ( // } // PROMISE = parsedTuple; break; - case z.ZodTypes.lazy: + case ZodTypes.lazy: const lazySchema = def.getter(); PROMISE = PseudoPromise.resolve(lazySchema.parse(data, params)); break; - case z.ZodTypes.literal: + case ZodTypes.literal: if (data !== def.value) { ERROR.addIssue( makeError({ @@ -887,7 +891,7 @@ export const ZodParser = (schema: z.ZodType) => ( } PROMISE = PseudoPromise.resolve(data); break; - case z.ZodTypes.enum: + case ZodTypes.enum: if (def.values.indexOf(data) === -1) { ERROR.addIssue( makeError({ @@ -898,7 +902,7 @@ export const ZodParser = (schema: z.ZodType) => ( } PROMISE = PseudoPromise.resolve(data); break; - case z.ZodTypes.nativeEnum: + case ZodTypes.nativeEnum: if (util.getValidEnumValues(def.values).indexOf(data) === -1) { ERROR.addIssue( makeError({ @@ -909,7 +913,7 @@ export const ZodParser = (schema: z.ZodType) => ( } PROMISE = PseudoPromise.resolve(data); break; - case z.ZodTypes.function: + case ZodTypes.function: if (parsedType !== ZodParsedType.function) { ERROR.addIssue( makeError({ @@ -959,7 +963,7 @@ export const ZodParser = (schema: z.ZodType) => ( PROMISE = PseudoPromise.resolve(validatedFunc); // return validatedFunc; break; - case z.ZodTypes.record: + case ZodTypes.record: if (parsedType !== ZodParsedType.object) { ERROR.addIssue( makeError({ @@ -992,7 +996,7 @@ export const ZodParser = (schema: z.ZodType) => ( PROMISE = PseudoPromise.object(parsedRecordPromises); // PROMISE = parsedRecord; break; - case z.ZodTypes.date: + case ZodTypes.date: if (!(data instanceof Date)) { ERROR.addIssue( makeError({ @@ -1016,7 +1020,7 @@ export const ZodParser = (schema: z.ZodType) => ( PROMISE = PseudoPromise.resolve(data); break; - case z.ZodTypes.promise: + case ZodTypes.promise: if (parsedType !== ZodParsedType.promise && params.async !== true) { ERROR.addIssue( makeError({ @@ -1057,7 +1061,7 @@ export const ZodParser = (schema: z.ZodType) => ( // }), // ); break; - case z.ZodTypes.transformer: + case ZodTypes.transformer: PROMISE = new PseudoPromise() .then(() => { return def.input.parse(data, params); @@ -1069,7 +1073,7 @@ export const ZodParser = (schema: z.ZodType) => ( // console.log(JSON.stringify(inputParseResult, null, 2)); const transformed = def.transformer(inputParseResult); if (transformed instanceof Promise && params.async === false) { - if (z.inputSchema(def.output)._def.t !== z.ZodTypes.promise) { + if (inputSchema(def.output)._def.t !== ZodTypes.promise) { throw new Error( "You can't call .parse on a schema containing async transformations.", ); @@ -1115,7 +1119,7 @@ export const ZodParser = (schema: z.ZodType) => ( const customChecks = def.checks || []; - const checkCtx: z.RefinementCtx = { + const checkCtx: RefinementCtx = { addIssue: (arg: MakeErrorData) => { ERROR.addIssue(makeError(arg)); }, @@ -1128,7 +1132,7 @@ export const ZodParser = (schema: z.ZodType) => ( // "You can't use .parse on a schema containing async refinements or transformations. Use .parseAsync instead."; // if (resolvedValue instanceof Promise) { - // if (def.t !== z.ZodTypes.promise) { + // if (def.t !== ZodTypes.promise) { // throw new Error(SYNC_ERROR); // } // } diff --git a/src/switcher.ts b/src/switcher.ts index ac702713e..e87137368 100644 --- a/src/switcher.ts +++ b/src/switcher.ts @@ -1,62 +1,61 @@ -import * as z from './index'; -import { util } from './helpers/util'; +import { util, ZodType, ZodTypes, ZodDef } from './internal'; -export const visitor = (schema: z.ZodType) => { - const def = schema._def as z.ZodDef; +export const visitor = (schema: ZodType) => { + const def = schema._def as ZodDef; switch (def.t) { - case z.ZodTypes.string: + case ZodTypes.string: break; - case z.ZodTypes.number: + case ZodTypes.number: break; - case z.ZodTypes.bigint: + case ZodTypes.bigint: break; - case z.ZodTypes.boolean: + case ZodTypes.boolean: break; - case z.ZodTypes.undefined: + case ZodTypes.undefined: break; - case z.ZodTypes.null: + case ZodTypes.null: break; - case z.ZodTypes.any: + case ZodTypes.any: break; - case z.ZodTypes.unknown: + case ZodTypes.unknown: break; - case z.ZodTypes.never: + case ZodTypes.never: break; - case z.ZodTypes.void: + case ZodTypes.void: break; - case z.ZodTypes.array: + case ZodTypes.array: break; - case z.ZodTypes.object: + case ZodTypes.object: break; - case z.ZodTypes.union: + case ZodTypes.union: break; - case z.ZodTypes.intersection: + case ZodTypes.intersection: break; - case z.ZodTypes.tuple: + case ZodTypes.tuple: break; - case z.ZodTypes.lazy: + case ZodTypes.lazy: break; - case z.ZodTypes.literal: + case ZodTypes.literal: break; - case z.ZodTypes.enum: + case ZodTypes.enum: break; - case z.ZodTypes.nativeEnum: + case ZodTypes.nativeEnum: break; - case z.ZodTypes.function: + case ZodTypes.function: break; - case z.ZodTypes.record: + case ZodTypes.record: break; - case z.ZodTypes.date: + case ZodTypes.date: break; - case z.ZodTypes.promise: + case ZodTypes.promise: break; - case z.ZodTypes.transformer: + case ZodTypes.transformer: break; - case z.ZodTypes.optional: + case ZodTypes.optional: break; - case z.ZodTypes.nullable: + case ZodTypes.nullable: break; - case z.ZodTypes.map: + case ZodTypes.map: break; default: util.assertNever(def); diff --git a/src/types/any.ts b/src/types/any.ts index c145e9fea..55a25b9eb 100644 --- a/src/types/any.ts +++ b/src/types/any.ts @@ -1,20 +1,17 @@ -import * as z from './base'; -// import { ZodUndefined } from './undefined'; -// import { ZodNull } from './null'; -// import { ZodUnion } from './union'; +import { ZodTypeDef, ZodType, ZodTypes } from '../internal'; -export interface ZodAnyDef extends z.ZodTypeDef { - t: z.ZodTypes.any; +export interface ZodAnyDef extends ZodTypeDef { + t: ZodTypes.any; } -export class ZodAny extends z.ZodType { +export class ZodAny extends ZodType { // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); toJSON = () => this._def; static create = (): ZodAny => { return new ZodAny({ - t: z.ZodTypes.any, + t: ZodTypes.any, }); }; } diff --git a/src/types/array.ts b/src/types/array.ts index 12db0c654..d26aa230b 100644 --- a/src/types/array.ts +++ b/src/types/array.ts @@ -1,17 +1,19 @@ -import * as z from './base'; -// import { ZodUndefined } from './undefined'; -// import { ZodNull } from './null'; -// import { ZodUnion } from './union'; -import { ZodIssueCode } from '../ZodError'; - -export interface ZodArrayDef - extends z.ZodTypeDef { - t: z.ZodTypes.array; +import { + ZodIssueCode, + ZodTypeAny, + ZodTypeDef, + ZodType, + ZodTypes, +} from '../internal'; + +export interface ZodArrayDef + extends ZodTypeDef { + t: ZodTypes.array; type: T; nonempty: boolean; } -export class ZodArray extends z.ZodType< +export class ZodArray extends ZodType< T['_output'][], ZodArrayDef, T['_input'][] @@ -58,16 +60,16 @@ export class ZodArray extends z.ZodType< return new ZodNonEmptyArray({ ...this._def, nonempty: true }); }; - static create = (schema: T): ZodArray => { + static create = (schema: T): ZodArray => { return new ZodArray({ - t: z.ZodTypes.array, + t: ZodTypes.array, type: schema, nonempty: false, }); }; } -export class ZodNonEmptyArray extends z.ZodType< +export class ZodNonEmptyArray extends ZodType< [T['_output'], ...T['_output'][]], ZodArrayDef, [T['_input'], ...T['_input'][]] diff --git a/src/types/base.ts b/src/types/base.ts index a75314459..56a5e18e0 100644 --- a/src/types/base.ts +++ b/src/types/base.ts @@ -1,6 +1,8 @@ -import { util } from '../helpers/util'; -import { ZodParser, ParseParams, MakeErrorData } from '../parser'; import { + util, + ZodParser, + ParseParams, + MakeErrorData, ZodIssueCode, ZodArray, ZodTransformer, @@ -8,10 +10,9 @@ import { ZodOptional, ZodNullable, ZodCustomIssue, -} from '../index'; - -import { ZodOptionalType } from './optional'; -import { ZodNullableType } from './nullable'; + ZodOptionalType, + ZodNullableType, +} from '../internal'; export enum ZodTypes { string = 'string', diff --git a/src/types/bigint.ts b/src/types/bigint.ts index 25cf60c5e..7a41b94d9 100644 --- a/src/types/bigint.ts +++ b/src/types/bigint.ts @@ -1,13 +1,10 @@ -import * as z from './base'; -// import { ZodUndefined } from './undefined'; -// import { ZodNull } from './null'; -// import { ZodUnion } from './union'; +import { ZodTypeDef, ZodType, ZodTypes } from '../internal'; -export interface ZodBigIntDef extends z.ZodTypeDef { - t: z.ZodTypes.bigint; +export interface ZodBigIntDef extends ZodTypeDef { + t: ZodTypes.bigint; } -export class ZodBigInt extends z.ZodType { +export class ZodBigInt extends ZodType { // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); @@ -16,7 +13,7 @@ export class ZodBigInt extends z.ZodType { static create = (): ZodBigInt => { return new ZodBigInt({ - t: z.ZodTypes.bigint, + t: ZodTypes.bigint, }); }; } diff --git a/src/types/boolean.ts b/src/types/boolean.ts index d87e5e3d0..46e2969e2 100644 --- a/src/types/boolean.ts +++ b/src/types/boolean.ts @@ -1,13 +1,10 @@ -import * as z from './base'; -// import { ZodUndefined } from './undefined'; -// import { ZodNull } from './null'; -// import { ZodUnion } from './union'; +import { ZodType, ZodTypes, ZodTypeDef } from '../internal'; -export interface ZodBooleanDef extends z.ZodTypeDef { - t: z.ZodTypes.boolean; +export interface ZodBooleanDef extends ZodTypeDef { + t: ZodTypes.boolean; } -export class ZodBoolean extends z.ZodType { +export class ZodBoolean extends ZodType { // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); @@ -15,7 +12,7 @@ export class ZodBoolean extends z.ZodType { toJSON = () => this._def; static create = (): ZodBoolean => { return new ZodBoolean({ - t: z.ZodTypes.boolean, + t: ZodTypes.boolean, }); }; } diff --git a/src/types/date.ts b/src/types/date.ts index 007720966..a3c489cac 100644 --- a/src/types/date.ts +++ b/src/types/date.ts @@ -1,13 +1,10 @@ -import * as z from './base'; -// import { ZodUndefined } from './undefined'; -// import { ZodNull } from './null'; -// import { ZodUnion } from './union'; +import { ZodType, ZodTypes, ZodTypeDef } from '../internal'; -export interface ZodDateDef extends z.ZodTypeDef { - t: z.ZodTypes.date; +export interface ZodDateDef extends ZodTypeDef { + t: ZodTypes.date; } -export class ZodDate extends z.ZodType { +export class ZodDate extends ZodType { // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); @@ -15,7 +12,7 @@ export class ZodDate extends z.ZodType { toJSON = () => this._def; static create = (): ZodDate => { return new ZodDate({ - t: z.ZodTypes.date, + t: ZodTypes.date, }); }; } diff --git a/src/types/enum.ts b/src/types/enum.ts index be0840cd5..a382c01f7 100644 --- a/src/types/enum.ts +++ b/src/types/enum.ts @@ -1,7 +1,4 @@ -import * as z from './base'; -// import { ZodUndefined } from './undefined'; -// import { ZodNull } from './null'; -// import { ZodUnion } from './union'; +import { ZodType, ZodTypes, ZodTypeDef } from '../internal'; export type ArrayKeys = keyof any[]; export type Indices = Exclude; @@ -12,12 +9,16 @@ type Values = { [k in T[number]]: k; }; -export interface ZodEnumDef extends z.ZodTypeDef { - t: z.ZodTypes.enum; +export interface ZodEnumDef + extends ZodTypeDef { + t: ZodTypes.enum; values: T; } -export class ZodEnum extends z.ZodType> { +export class ZodEnum extends ZodType< + T[number], + ZodEnumDef +> { // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); @@ -52,9 +53,11 @@ export class ZodEnum extends z.ZodType(values: T): ZodEnum => { + static create = ( + values: T, + ): ZodEnum => { return new ZodEnum({ - t: z.ZodTypes.enum, + t: ZodTypes.enum, values: values, }) as any; }; diff --git a/src/types/function.ts b/src/types/function.ts index a788eed44..d87b34f49 100644 --- a/src/types/function.ts +++ b/src/types/function.ts @@ -1,26 +1,31 @@ -import * as z from './base'; -import { ZodTuple } from './tuple'; -import { ZodUnknown } from './unknown'; +import { + ZodType, + ZodTypes, + ZodTypeDef, + ZodTuple, + ZodTypeAny, + ZodUnknown, +} from '../internal'; export interface ZodFunctionDef< Args extends ZodTuple = ZodTuple, - Returns extends z.ZodTypeAny = z.ZodTypeAny -> extends z.ZodTypeDef { - t: z.ZodTypes.function; + Returns extends ZodTypeAny = ZodTypeAny +> extends ZodTypeDef { + t: ZodTypes.function; args: Args; returns: Returns; } export type OuterTypeOfFunction< Args extends ZodTuple, - Returns extends z.ZodTypeAny + Returns extends ZodTypeAny > = Args['_input'] extends Array ? (...args: Args['_input']) => Returns['_output'] : never; export type InnerTypeOfFunction< Args extends ZodTuple, - Returns extends z.ZodTypeAny + Returns extends ZodTypeAny > = Args['_output'] extends Array ? (...args: Args['_output']) => Returns['_input'] : never; @@ -28,8 +33,8 @@ export type InnerTypeOfFunction< // type as df = string extends unknown ? true : false export class ZodFunction< Args extends ZodTuple, - Returns extends z.ZodTypeAny -> extends z.ZodType< + Returns extends ZodTypeAny +> extends ZodType< OuterTypeOfFunction, ZodFunctionDef, InnerTypeOfFunction @@ -46,7 +51,7 @@ export class ZodFunction< }); }; - returns = >( + returns = >( returnType: NewReturnType, ): ZodFunction => { return new ZodFunction({ @@ -64,13 +69,13 @@ export class ZodFunction< static create = < T extends ZodTuple = ZodTuple<[]>, - U extends z.ZodTypeAny = ZodUnknown + U extends ZodTypeAny = ZodUnknown >( args?: T, returns?: U, ): ZodFunction => { return new ZodFunction({ - t: z.ZodTypes.function, + t: ZodTypes.function, args: args || ZodTuple.create([]), returns: returns || ZodUnknown.create(), }); diff --git a/src/types/intersection.ts b/src/types/intersection.ts index f35b12cb3..12d0c6444 100644 --- a/src/types/intersection.ts +++ b/src/types/intersection.ts @@ -1,21 +1,18 @@ -import * as z from './base'; -// import { ZodUndefined } from './undefined'; -// import { ZodNull } from './null'; -// import { ZodUnion } from './union'; +import { ZodType, ZodTypes, ZodTypeDef, ZodTypeAny } from '../internal'; export interface ZodIntersectionDef< - T extends z.ZodTypeAny = z.ZodTypeAny, - U extends z.ZodTypeAny = z.ZodTypeAny -> extends z.ZodTypeDef { - t: z.ZodTypes.intersection; + T extends ZodTypeAny = ZodTypeAny, + U extends ZodTypeAny = ZodTypeAny +> extends ZodTypeDef { + t: ZodTypes.intersection; left: T; right: U; } export class ZodIntersection< - T extends z.ZodTypeAny, - U extends z.ZodTypeAny -> extends z.ZodType< + T extends ZodTypeAny, + U extends ZodTypeAny +> extends ZodType< T['_output'] & U['_output'], ZodIntersectionDef, T['_input'] & U['_input'] @@ -29,12 +26,12 @@ export class ZodIntersection< right: this._def.right.toJSON(), }); - static create = ( + static create = ( left: T, right: U, ): ZodIntersection => { return new ZodIntersection({ - t: z.ZodTypes.intersection, + t: ZodTypes.intersection, left: left, right: right, }); diff --git a/src/types/lazy.ts b/src/types/lazy.ts index 990ea1d0e..e4c74eb40 100644 --- a/src/types/lazy.ts +++ b/src/types/lazy.ts @@ -1,18 +1,22 @@ -import * as z from './base'; -// import { ZodUndefined } from './undefined'; -// import { ZodNull } from './null'; -// import { ZodUnion } from './union'; +import { + ZodType, + ZodTypes, + ZodTypeDef, + ZodTypeAny, + output, + input, +} from '../internal'; -export interface ZodLazyDef - extends z.ZodTypeDef { - t: z.ZodTypes.lazy; +export interface ZodLazyDef + extends ZodTypeDef { + t: ZodTypes.lazy; getter: () => T; } -export class ZodLazy extends z.ZodType< - z.output, +export class ZodLazy extends ZodType< + output, ZodLazyDef, - z.input + input > { get schema(): T { return this._def.getter(); @@ -26,9 +30,9 @@ export class ZodLazy extends z.ZodType< throw new Error("Can't JSONify recursive structure"); }; - static create = (getter: () => T): ZodLazy => { + static create = (getter: () => T): ZodLazy => { return new ZodLazy({ - t: z.ZodTypes.lazy, + t: ZodTypes.lazy, getter: getter, }); }; diff --git a/src/types/literal.ts b/src/types/literal.ts index db2cb1b34..fbe1bbb9a 100644 --- a/src/types/literal.ts +++ b/src/types/literal.ts @@ -1,17 +1,13 @@ -import * as z from './base'; -// import { ZodUndefined } from './undefined'; -// import { ZodNull } from './null'; -// import { ZodUnion } from './union'; -import { Primitive } from '../helpers/primitive'; +import { ZodType, ZodTypes, ZodTypeDef, Primitive } from '../internal'; type LiteralValue = Primitive; -export interface ZodLiteralDef extends z.ZodTypeDef { - t: z.ZodTypes.literal; +export interface ZodLiteralDef extends ZodTypeDef { + t: ZodTypes.literal; value: T; } -export class ZodLiteral extends z.ZodType> { +export class ZodLiteral extends ZodType> { // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); @@ -20,7 +16,7 @@ export class ZodLiteral extends z.ZodType> { static create = (value: T): ZodLiteral => { return new ZodLiteral({ - t: z.ZodTypes.literal, + t: ZodTypes.literal, value: value, }); }; diff --git a/src/types/map.ts b/src/types/map.ts index 1e9e3d7d3..a3e76e3b5 100644 --- a/src/types/map.ts +++ b/src/types/map.ts @@ -1,18 +1,18 @@ -import * as z from './base'; +import { ZodType, ZodTypes, ZodTypeDef, ZodTypeAny } from '../internal'; export interface ZodMapDef< - Key extends z.ZodTypeAny = z.ZodTypeAny, - Value extends z.ZodTypeAny = z.ZodTypeAny -> extends z.ZodTypeDef { - t: z.ZodTypes.map; + Key extends ZodTypeAny = ZodTypeAny, + Value extends ZodTypeAny = ZodTypeAny +> extends ZodTypeDef { + t: ZodTypes.map; valueType: Value; keyType: Key; } export class ZodMap< - Key extends z.ZodTypeAny = z.ZodTypeAny, - Value extends z.ZodTypeAny = z.ZodTypeAny -> extends z.ZodType< + Key extends ZodTypeAny = ZodTypeAny, + Value extends ZodTypeAny = ZodTypeAny +> extends ZodType< Map, ZodMapDef, Map @@ -26,14 +26,14 @@ export class ZodMap< }); static create = < - Key extends z.ZodTypeAny = z.ZodTypeAny, - Value extends z.ZodTypeAny = z.ZodTypeAny + Key extends ZodTypeAny = ZodTypeAny, + Value extends ZodTypeAny = ZodTypeAny >( keyType: Key, valueType: Value, ): ZodMap => { return new ZodMap({ - t: z.ZodTypes.map, + t: ZodTypes.map, valueType, keyType, }); diff --git a/src/types/nativeEnum.ts b/src/types/nativeEnum.ts index 60f17cdb3..b7215ef40 100644 --- a/src/types/nativeEnum.ts +++ b/src/types/nativeEnum.ts @@ -1,17 +1,21 @@ -import * as z from './base'; +import { ZodType, ZodTypes, ZodTypeDef } from '../internal'; -export interface ZodNativeEnumDef extends z.ZodTypeDef { - t: z.ZodTypes.nativeEnum; +export interface ZodNativeEnumDef + extends ZodTypeDef { + t: ZodTypes.nativeEnum; values: T; } type EnumLike = { [k: string]: string | number; [nu: number]: string }; -export class ZodNativeEnum extends z.ZodType> { +export class ZodNativeEnum extends ZodType< + T[keyof T], + ZodNativeEnumDef +> { toJSON = () => this._def; static create = (values: T): ZodNativeEnum => { return new ZodNativeEnum({ - t: z.ZodTypes.nativeEnum, + t: ZodTypes.nativeEnum, values: values, }); }; diff --git a/src/types/never.ts b/src/types/never.ts index f5cf173e3..3c0b6eae8 100644 --- a/src/types/never.ts +++ b/src/types/never.ts @@ -1,15 +1,15 @@ -import * as z from './base'; +import { ZodType, ZodTypes, ZodTypeDef } from '../internal'; -export interface ZodNeverDef extends z.ZodTypeDef { - t: z.ZodTypes.never; +export interface ZodNeverDef extends ZodTypeDef { + t: ZodTypes.never; } -export class ZodNever extends z.ZodType { +export class ZodNever extends ZodType { toJSON = () => this._def; static create = (): ZodNever => { return new ZodNever({ - t: z.ZodTypes.never, + t: ZodTypes.never, }); }; } diff --git a/src/types/null.ts b/src/types/null.ts index e3f863186..60869f925 100644 --- a/src/types/null.ts +++ b/src/types/null.ts @@ -1,12 +1,10 @@ -import * as z from './base'; -// import { ZodUndefined } from './undefined'; -// import { ZodUnion } from './union'; +import { ZodType, ZodTypes, ZodTypeDef } from '../internal'; -export interface ZodNullDef extends z.ZodTypeDef { - t: z.ZodTypes.null; +export interface ZodNullDef extends ZodTypeDef { + t: ZodTypes.null; } -export class ZodNull extends z.ZodType { +export class ZodNull extends ZodType { // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); @@ -14,7 +12,7 @@ export class ZodNull extends z.ZodType { toJSON = () => this._def; static create = (): ZodNull => { return new ZodNull({ - t: z.ZodTypes.null, + t: ZodTypes.null, }); }; } diff --git a/src/types/nullable.ts b/src/types/nullable.ts index 1101baa40..6e7f09562 100644 --- a/src/types/nullable.ts +++ b/src/types/nullable.ts @@ -1,27 +1,23 @@ -import * as z from './base'; +import { ZodType, ZodTypes, ZodTypeDef, ZodTypeAny } from '../internal'; -export interface ZodNullableDef - extends z.ZodTypeDef { - t: z.ZodTypes.nullable; +export interface ZodNullableDef + extends ZodTypeDef { + t: ZodTypes.nullable; innerType: T; } // This type allows for nullable flattening -export type ZodNullableType = T extends ZodNullable< - z.ZodTypeAny +export type ZodNullableType = T extends ZodNullable< + ZodTypeAny > ? T : ZodNullable; export class ZodNullable< - T extends z.ZodTypeAny + T extends ZodTypeAny // Output extends T['_output'] | null = T['_output'] | null, // Input extends T['_input'] | null = T['_input'] | null -> extends z.ZodType< - T['_output'] | null, - ZodNullableDef, - T['_input'] | null -> { +> extends ZodType, T['_input'] | null> { // An nullable nullable is the original nullable // nullable: () => ZodNullableType = () => this as ZodNullableType; toJSON = () => ({ @@ -29,10 +25,10 @@ export class ZodNullable< innerType: this._def.innerType.toJSON(), }); - static create = (type: T): ZodNullableType => { + static create = (type: T): ZodNullableType => { if (type instanceof ZodNullable) return type as ZodNullableType; return new ZodNullable({ - t: z.ZodTypes.nullable, + t: ZodTypes.nullable, innerType: type, }) as ZodNullableType; }; diff --git a/src/types/number.ts b/src/types/number.ts index 96b0b48c5..8a39d5149 100644 --- a/src/types/number.ts +++ b/src/types/number.ts @@ -1,15 +1,16 @@ -import * as z from './base'; -// import { ZodUndefined } from './undefined'; -// import { ZodNull } from './null'; -// import { ZodUnion } from './union'; -import { ZodIssueCode } from '../ZodError'; -import { errorUtil } from '../helpers/errorUtil'; +import { + ZodType, + ZodTypes, + ZodTypeDef, + ZodIssueCode, + errorUtil, +} from '../internal'; -export interface ZodNumberDef extends z.ZodTypeDef { - t: z.ZodTypes.number; +export interface ZodNumberDef extends ZodTypeDef { + t: ZodTypes.number; } -export class ZodNumber extends z.ZodType { +export class ZodNumber extends ZodType { // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); @@ -17,7 +18,7 @@ export class ZodNumber extends z.ZodType { toJSON = () => this._def; static create = (): ZodNumber => { return new ZodNumber({ - t: z.ZodTypes.number, + t: ZodTypes.number, }); }; diff --git a/src/types/object.ts b/src/types/object.ts index 48116c8e6..c5833e039 100644 --- a/src/types/object.ts +++ b/src/types/object.ts @@ -1,15 +1,18 @@ -import * as z from './base'; -// import { ZodUndefined } from './undefined'; -// import { ZodNull } from './null'; -// import { ZodUnion } from './union'; -import { objectUtil } from '../helpers/objectUtil'; -import { partialUtil } from '../helpers/partialUtil'; -import { isScalar } from '../isScalar'; -import { ZodNever } from '..'; -import { Scalars } from '../helpers/primitive'; +import { + objectUtil, + partialUtil, + isScalar, + ZodNever, + Scalars, + ZodRawShape, + ZodTypeAny, + ZodTypeDef, + ZodType, + ZodTypes, +} from '../internal'; const AugmentFactory = (def: Def) => < - Augmentation extends z.ZodRawShape + Augmentation extends ZodRawShape >( augmentation: Augmentation, ): ZodObject< @@ -35,12 +38,12 @@ const AugmentFactory = (def: Def) => < type UnknownKeysParam = 'passthrough' | 'strict' | 'strip'; export interface ZodObjectDef< - T extends z.ZodRawShape = z.ZodRawShape, + T extends ZodRawShape = ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, - Catchall extends z.ZodTypeAny = z.ZodTypeAny + Catchall extends ZodTypeAny = ZodTypeAny // Params extends ZodObjectParams = ZodObjectParams -> extends z.ZodTypeDef { - t: z.ZodTypes.object; +> extends ZodTypeDef { + t: ZodTypes.object; shape: () => T; catchall: Catchall; unknownKeys: UnknownKeys; @@ -48,8 +51,8 @@ export interface ZodObjectDef< } export type baseObjectOutputType< - Shape extends z.ZodRawShape - // Catchall extends z.ZodTypeAny + Shape extends ZodRawShape + // Catchall extends ZodTypeAny > = objectUtil.flatten< objectUtil.addQuestionMarks< { @@ -59,17 +62,15 @@ export type baseObjectOutputType< >; export type objectOutputType< - Shape extends z.ZodRawShape, - Catchall extends z.ZodTypeAny -> = z.ZodTypeAny extends Catchall + Shape extends ZodRawShape, + Catchall extends ZodTypeAny +> = ZodTypeAny extends Catchall ? baseObjectOutputType : objectUtil.flatten< baseObjectOutputType & { [k: string]: Catchall['_output'] } >; -export type baseObjectInputType< - Shape extends z.ZodRawShape -> = objectUtil.flatten< +export type baseObjectInputType = objectUtil.flatten< objectUtil.addQuestionMarks< { [k in keyof Shape]: Shape[k]['_input']; @@ -78,9 +79,9 @@ export type baseObjectInputType< >; export type objectInputType< - Shape extends z.ZodRawShape, - Catchall extends z.ZodTypeAny -> = z.ZodTypeAny extends Catchall + Shape extends ZodRawShape, + Catchall extends ZodTypeAny +> = ZodTypeAny extends Catchall ? baseObjectInputType : objectUtil.flatten< baseObjectInputType & { [k: string]: Catchall['_input'] } @@ -116,7 +117,7 @@ const objectDefToJson = (def: ZodObjectDef) => ({ // ? ZodObject }>, P, C> // : never; -// type makeRequired> = T extends ZodUnion +// type makeRequired> = T extends ZodUnion // ? U extends [infer Y, ZodUndefined] // ? Y // : U extends [ZodUndefined, infer Z] @@ -125,7 +126,7 @@ const objectDefToJson = (def: ZodObjectDef) => ({ // : T; // type ZodObjectType< -// T extends z.ZodRawShape, +// T extends ZodRawShape, // Params extends ZodObjectParams // > = Params['strict'] extends true // ? objectUtil.ObjectType @@ -133,19 +134,19 @@ const objectDefToJson = (def: ZodObjectDef) => ({ export type AnyZodObject = ZodObject; // export type AnyZodObject = ZodObject< -// z.ZodRawShape, +// ZodRawShape, // UnknownKeysParam, -// z.ZodTypeAny +// ZodTypeAny // >; export class ZodObject< - T extends z.ZodRawShape, + T extends ZodRawShape, UnknownKeys extends UnknownKeysParam = 'passthrough', - Catchall extends z.ZodTypeAny = z.ZodTypeAny, + Catchall extends ZodTypeAny = ZodTypeAny, // Params extends ZodObjectParams = { strict: true }, // Type extends ZodObjectType = ZodObjectType Output = objectOutputType, Input = objectInputType -> extends z.ZodType< +> extends ZodType< // objectUtil.objectOutputType, Output, ZodObjectDef, @@ -196,7 +197,7 @@ export class ZodObject< augment = AugmentFactory>(this._def); extend = AugmentFactory>(this._def); - setKey = ( + setKey = ( key: Key, schema: Schema, ): ZodObject => { @@ -217,7 +218,7 @@ export class ZodObject< // objectUtil.MergeObjectParams > = objectUtil.mergeObjects(this as any) as any; - catchall = ( + catchall = ( index: Index, ): ZodObject< T, @@ -381,9 +382,9 @@ export class ZodObject< // keyof: ()=>ZodEnum<{[k in T]: k}> - static create = (shape: T): ZodObject => { + static create = (shape: T): ZodObject => { return new ZodObject({ - t: z.ZodTypes.object, + t: ZodTypes.object, shape: () => shape, unknownKeys: 'strip', catchall: ZodNever.create(), @@ -393,11 +394,9 @@ export class ZodObject< }) as any; }; - static lazycreate = ( - shape: () => T, - ): ZodObject => { + static lazycreate = (shape: () => T): ZodObject => { return new ZodObject({ - t: z.ZodTypes.object, + t: ZodTypes.object, shape, unknownKeys: 'strip', catchall: ZodNever.create(), diff --git a/src/types/optional.ts b/src/types/optional.ts index aa5a731f9..722f134b6 100644 --- a/src/types/optional.ts +++ b/src/types/optional.ts @@ -1,4 +1,4 @@ -import { ZodType, ZodTypeAny, ZodTypeDef, ZodTypes } from './base'; +import { ZodType, ZodTypeAny, ZodTypeDef, ZodTypes } from '../internal'; // import * as z from './base'; // type asdf = ZodTypeAny diff --git a/src/types/promise.ts b/src/types/promise.ts index fa97c4d50..1f37b6d3a 100644 --- a/src/types/promise.ts +++ b/src/types/promise.ts @@ -1,15 +1,12 @@ -import * as z from './base'; -// import { ZodUndefined } from './undefined'; -// import { ZodNull } from './null'; -// import { ZodUnion } from './union'; +import { ZodType, ZodTypes, ZodTypeDef, ZodTypeAny } from '../internal'; -export interface ZodPromiseDef - extends z.ZodTypeDef { - t: z.ZodTypes.promise; +export interface ZodPromiseDef + extends ZodTypeDef { + t: ZodTypes.promise; type: T; } -export class ZodPromise extends z.ZodType< +export class ZodPromise extends ZodType< Promise, ZodPromiseDef, Promise @@ -25,9 +22,9 @@ export class ZodPromise extends z.ZodType< // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); - static create = (schema: T): ZodPromise => { + static create = (schema: T): ZodPromise => { return new ZodPromise({ - t: z.ZodTypes.promise, + t: ZodTypes.promise, type: schema, }); }; diff --git a/src/types/record.ts b/src/types/record.ts index 05b0923e7..ba9b6cd90 100644 --- a/src/types/record.ts +++ b/src/types/record.ts @@ -1,17 +1,12 @@ -import * as z from './base'; -// import { ZodUndefined } from './undefined'; -// import { ZodNull } from './null'; -// import { ZodUnion } from './union'; +import { ZodType, ZodTypes, ZodTypeDef, ZodTypeAny } from '../internal'; -export interface ZodRecordDef - extends z.ZodTypeDef { - t: z.ZodTypes.record; +export interface ZodRecordDef + extends ZodTypeDef { + t: ZodTypes.record; valueType: Value; } -export class ZodRecord< - Value extends z.ZodTypeAny = z.ZodTypeAny -> extends z.ZodType< +export class ZodRecord extends ZodType< Record, // { [k in keyof T]: T[k]['_type'] }, ZodRecordDef, Record @@ -27,11 +22,11 @@ export class ZodRecord< // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); - static create = ( + static create = ( valueType: Value, ): ZodRecord => { return new ZodRecord({ - t: z.ZodTypes.record, + t: ZodTypes.record, valueType, }); }; diff --git a/src/types/string.ts b/src/types/string.ts index 945c27d05..c5650bc5d 100644 --- a/src/types/string.ts +++ b/src/types/string.ts @@ -1,12 +1,14 @@ -import * as z from './base'; -// import { ZodUndefined } from './undefined'; -// import { ZodNull } from './null'; -// import { ZodUnion } from './union'; -import { StringValidation, ZodIssueCode } from '../ZodError'; -import { errorUtil } from '../helpers/errorUtil'; +import { + ZodType, + ZodTypes, + ZodTypeDef, + StringValidation, + ZodIssueCode, + errorUtil, +} from '../internal'; -export interface ZodStringDef extends z.ZodTypeDef { - t: z.ZodTypes.string; +export interface ZodStringDef extends ZodTypeDef { + t: ZodTypes.string; validation: { uuid?: true; custom?: ((val: any) => boolean)[]; @@ -16,7 +18,7 @@ export interface ZodStringDef extends z.ZodTypeDef { const emailRegex = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i; const uuidRegex = /([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}){1}/i; -export class ZodString extends z.ZodType { +export class ZodString extends ZodType { inputSchema = this; outputSchema = this; @@ -88,7 +90,7 @@ export class ZodString extends z.ZodType { static create = (): ZodString => { return new ZodString({ - t: z.ZodTypes.string, + t: ZodTypes.string, validation: {}, }); }; diff --git a/src/types/transformer.ts b/src/types/transformer.ts index 6c254586b..f6475c7ae 100644 --- a/src/types/transformer.ts +++ b/src/types/transformer.ts @@ -1,22 +1,19 @@ -import * as z from './base'; -// import { ZodUndefined } from './undefined'; -// import { ZodNull } from './null'; -// import { ZodUnion } from './union'; +import { ZodType, ZodTypes, ZodTypeDef, ZodTypeAny } from '../internal'; export interface ZodTransformerDef< - T extends z.ZodTypeAny = z.ZodTypeAny, - U extends z.ZodTypeAny = z.ZodTypeAny -> extends z.ZodTypeDef { - t: z.ZodTypes.transformer; + T extends ZodTypeAny = ZodTypeAny, + U extends ZodTypeAny = ZodTypeAny +> extends ZodTypeDef { + t: ZodTypes.transformer; input: T; output: U; transformer: (arg: T['_output']) => U['_input']; } export class ZodTransformer< - T extends z.ZodTypeAny, - U extends z.ZodTypeAny -> extends z.ZodType, T['_input']> { + T extends ZodTypeAny, + U extends ZodTypeAny +> extends ZodType, T['_input']> { // readonly _input!: T['_input']; // readonly _output!: U['_output']; // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); @@ -47,7 +44,7 @@ export class ZodTransformer< right: this._def.output.toJSON(), }); - // transformTo: ( + // transformTo: ( // output: Out, // transformer: (arg: U['_type']) => Out['_type'], // ) => ZodTransformer = (output, transformer) => { @@ -58,24 +55,24 @@ export class ZodTransformer< return this._def.output; } - static create = ( + static create = ( input: I, output: O, transformer: (arg: I['_output']) => O['_input'] | Promise, ): ZodTransformer => { return new ZodTransformer({ - t: z.ZodTypes.transformer, + t: ZodTypes.transformer, input, output, transformer, }); }; - static fromSchema = ( + static fromSchema = ( input: I, ): ZodTransformer => { return new ZodTransformer({ - t: z.ZodTypes.transformer, + t: ZodTypes.transformer, input, output: input, transformer: x => x, diff --git a/src/types/tuple.ts b/src/types/tuple.ts index 999d899d3..700a7b951 100644 --- a/src/types/tuple.ts +++ b/src/types/tuple.ts @@ -1,4 +1,4 @@ -import * as z from './base'; +import { ZodType, ZodTypes, ZodTypeDef, ZodTypeAny } from '../internal'; // import { objectUtil } from '../helpers/objectUtil'; // import { ZodUnion } from './union'; // import { ZodUndefined } from './undefined'; @@ -32,34 +32,24 @@ import * as z from './base'; // const x:t4 = ['asdf']; // type t5 = string & unknown; -export type OutputTypeOfTuple< - T extends [z.ZodTypeAny, ...z.ZodTypeAny[]] | [] -> = { - [k in keyof T]: T[k] extends z.ZodType ? T[k]['_output'] : never; +export type OutputTypeOfTuple = { + [k in keyof T]: T[k] extends ZodType ? T[k]['_output'] : never; }; -export type InputTypeOfTuple< - T extends [z.ZodTypeAny, ...z.ZodTypeAny[]] | [] -> = { - [k in keyof T]: T[k] extends z.ZodType ? T[k]['_input'] : never; +export type InputTypeOfTuple = { + [k in keyof T]: T[k] extends ZodType ? T[k]['_input'] : never; }; export interface ZodTupleDef< - T extends [z.ZodTypeAny, ...z.ZodTypeAny[]] | [] = [ - z.ZodTypeAny, - ...z.ZodTypeAny[], - ] -> extends z.ZodTypeDef { - t: z.ZodTypes.tuple; + T extends [ZodTypeAny, ...ZodTypeAny[]] | [] = [ZodTypeAny, ...ZodTypeAny[]] +> extends ZodTypeDef { + t: ZodTypes.tuple; items: T; } export class ZodTuple< - T extends [z.ZodTypeAny, ...z.ZodTypeAny[]] | [] = [ - z.ZodTypeAny, - ...z.ZodTypeAny[], - ] -> extends z.ZodType, ZodTupleDef, InputTypeOfTuple> { + T extends [ZodTypeAny, ...ZodTypeAny[]] | [] = [ZodTypeAny, ...ZodTypeAny[]] +> extends ZodType, ZodTupleDef, InputTypeOfTuple> { toJSON = () => ({ t: this._def.t, items: (this._def.items as any[]).map(item => item.toJSON()), @@ -73,11 +63,11 @@ export class ZodTuple< // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); - static create = ( + static create = ( schemas: T, ): ZodTuple => { return new ZodTuple({ - t: z.ZodTypes.tuple, + t: ZodTypes.tuple, items: schemas, }); }; diff --git a/src/types/undefined.ts b/src/types/undefined.ts index 45e2ce67a..a55f5b31c 100644 --- a/src/types/undefined.ts +++ b/src/types/undefined.ts @@ -1,12 +1,12 @@ -import * as z from './base'; +import { ZodType, ZodTypes, ZodTypeDef } from '../internal'; // import { ZodUnion } from './union'; // import { ZodNull } from './null'; -export interface ZodUndefinedDef extends z.ZodTypeDef { - t: z.ZodTypes.undefined; +export interface ZodUndefinedDef extends ZodTypeDef { + t: ZodTypes.undefined; } -export class ZodUndefined extends z.ZodType { +export class ZodUndefined extends ZodType { toJSON = () => this._def; // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); @@ -15,7 +15,7 @@ export class ZodUndefined extends z.ZodType { static create = (): ZodUndefined => { return new ZodUndefined({ - t: z.ZodTypes.undefined, + t: ZodTypes.undefined, }); }; } diff --git a/src/types/union.ts b/src/types/union.ts index e776685e5..2a54f94b4 100644 --- a/src/types/union.ts +++ b/src/types/union.ts @@ -1,21 +1,21 @@ -import * as z from './base'; +import { ZodType, ZodTypes, ZodTypeDef, ZodTypeAny } from '../internal'; // import { ZodUndefined } from './undefined'; // import { ZodNull } from './null'; export interface ZodUnionDef< - T extends [z.ZodTypeAny, z.ZodTypeAny, ...z.ZodTypeAny[]] = [ - z.ZodTypeAny, - z.ZodTypeAny, - ...z.ZodTypeAny[], + T extends [ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]] = [ + ZodTypeAny, + ZodTypeAny, + ...ZodTypeAny[], ] -> extends z.ZodTypeDef { - t: z.ZodTypes.union; +> extends ZodTypeDef { + t: ZodTypes.union; options: T; } export class ZodUnion< - T extends [z.ZodTypeAny, z.ZodTypeAny, ...z.ZodTypeAny[]] -> extends z.ZodType, T[number]['_input']> { + T extends [ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]] +> extends ZodType, T[number]['_input']> { // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); @@ -29,15 +29,15 @@ export class ZodUnion< return this._def.options; } - // distribute = z.ZodTypeAny>(f: F): ZodUnion<{ [k in keyof T]: ReturnType }> => { + // distribute = ZodTypeAny>(f: F): ZodUnion<{ [k in keyof T]: ReturnType }> => { // return ZodUnion.create(this._def.options.map(f) as any); // }; - static create = ( + static create = ( types: T, ): ZodUnion => { return new ZodUnion({ - t: z.ZodTypes.union, + t: ZodTypes.union, options: types, }); }; diff --git a/src/types/unknown.ts b/src/types/unknown.ts index f3e672d25..d1fb9d306 100644 --- a/src/types/unknown.ts +++ b/src/types/unknown.ts @@ -1,20 +1,20 @@ -import * as z from './base'; +import { ZodType, ZodTypes, ZodTypeDef } from '../internal'; // import { ZodUndefined } from './undefined'; // import { ZodNull } from './null'; // import { ZodUnion } from './union'; -export interface ZodUnknownDef extends z.ZodTypeDef { - t: z.ZodTypes.unknown; +export interface ZodUnknownDef extends ZodTypeDef { + t: ZodTypes.unknown; } -export class ZodUnknown extends z.ZodType { +export class ZodUnknown extends ZodType { // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); toJSON = () => this._def; static create = (): ZodUnknown => { return new ZodUnknown({ - t: z.ZodTypes.unknown, + t: ZodTypes.unknown, }); }; } diff --git a/src/types/void.ts b/src/types/void.ts index e9bff337c..6b402bb51 100644 --- a/src/types/void.ts +++ b/src/types/void.ts @@ -1,20 +1,20 @@ -import * as z from './base'; +import { ZodType, ZodTypes, ZodTypeDef } from '../internal'; // import { ZodUndefined } from './undefined'; // import { ZodNull } from './null'; // import { ZodUnion } from './union'; -export interface ZodVoidDef extends z.ZodTypeDef { - t: z.ZodTypes.void; +export interface ZodVoidDef extends ZodTypeDef { + t: ZodTypes.void; } -export class ZodVoid extends z.ZodType { +export class ZodVoid extends ZodType { // opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]); // null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]); toJSON = () => this._def; static create = (): ZodVoid => { return new ZodVoid({ - t: z.ZodTypes.void, + t: ZodTypes.void, }); }; }