From 4d917db2f181d81738835e35b112d905ce8923a2 Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Sat, 23 Sep 2023 23:17:25 +0200 Subject: [PATCH 1/5] chore(deps): add eslint unicorn --- .eslintrc.js | 59 +++++++++++++++ package.json | 1 + pnpm-lock.yaml | 200 ++++++++++++++++++++++++++++++++----------------- 3 files changed, 191 insertions(+), 69 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 2da31cb76ff..2e9045ae093 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -18,6 +18,7 @@ module.exports = defineConfig({ 'plugin:@typescript-eslint/recommended', 'plugin:@typescript-eslint/recommended-type-checked', 'plugin:prettier/recommended', + 'plugin:unicorn/recommended', ], parser: '@typescript-eslint/parser', parserOptions: { @@ -36,6 +37,64 @@ module.exports = defineConfig({ 'deprecation/deprecation': 'error', + 'unicorn/no-array-reduce': 'off', + 'unicorn/no-nested-ternary': 'off', + 'unicorn/no-null': 'off', + 'unicorn/no-useless-switch-case': 'off', + 'unicorn/number-literal-case': 'off', + // TODO @Shinigami92 2023-09-23: prefer-at should be turned on when we drop support for Node 14 + 'unicorn/prefer-at': 'off', + // TODO @Shinigami92 2023-09-23: prefer-string-replace-all should be turned on when we drop support for Node 14 + 'unicorn/prefer-string-replace-all': 'off', + + // TODO @Shinigami92 2023-09-23: All following unicorn rules are turned on by default through the unicorn/recommended set + // they should be turned on individually, removed or potentially configured to our needs + // But read https://github.com/faker-js/faker/pull/2417 for more + 'unicorn/better-regex': 'off', + 'unicorn/catch-error-name': 'off', + 'unicorn/consistent-destructuring': 'off', + 'unicorn/consistent-function-scoping': 'off', + 'unicorn/escape-case': 'off', + 'unicorn/explicit-length-check': 'off', + 'unicorn/filename-case': 'off', + 'unicorn/import-style': 'off', + 'unicorn/no-array-callback-reference': 'off', + 'unicorn/no-array-for-each': 'off', + 'unicorn/no-array-push-push': 'off', + 'unicorn/no-await-expression-member': 'off', + 'unicorn/no-console-spaces': 'off', + 'unicorn/no-for-loop': 'off', + 'unicorn/no-hex-escape': 'off', + 'unicorn/no-instanceof-array': 'off', + 'unicorn/no-negated-condition': 'off', + 'unicorn/no-new-array': 'off', + 'unicorn/no-object-as-default-parameter': 'off', + 'unicorn/no-process-exit': 'off', + 'unicorn/no-zero-fractions': 'off', + 'unicorn/numeric-separators-style': 'off', + 'unicorn/prefer-array-flat-map': 'off', + 'unicorn/prefer-array-some': 'off', + 'unicorn/prefer-code-point': 'off', + 'unicorn/prefer-date-now': 'off', + 'unicorn/prefer-export-from': 'off', + 'unicorn/prefer-includes': 'off', + 'unicorn/prefer-module': 'off', + 'unicorn/prefer-native-coercion-functions': 'off', + 'unicorn/prefer-negative-index': 'off', + 'unicorn/prefer-node-protocol': 'off', + 'unicorn/prefer-number-properties': 'off', + 'unicorn/prefer-object-from-entries': 'off', + 'unicorn/prefer-optional-catch-binding': 'off', + 'unicorn/prefer-spread': 'off', + 'unicorn/prefer-string-slice': 'off', + 'unicorn/prefer-string-starts-ends-with': 'off', + 'unicorn/prefer-ternary': 'off', + 'unicorn/prefer-top-level-await': 'off', + 'unicorn/prevent-abbreviations': 'off', + 'unicorn/require-array-join-separator': 'off', + 'unicorn/switch-case-braces': 'off', + 'unicorn/text-encoding-identifier-case': 'off', + '@typescript-eslint/array-type': [ 'error', { default: 'array-simple', readonly: 'generic' }, diff --git a/package.json b/package.json index dc40e453b8f..c4a8ffa6569 100644 --- a/package.json +++ b/package.json @@ -109,6 +109,7 @@ "eslint-plugin-deprecation": "~2.0.0", "eslint-plugin-jsdoc": "~46.8.1", "eslint-plugin-prettier": "~5.0.0", + "eslint-plugin-unicorn": "~48.0.1", "eslint-plugin-vitest": "~0.3.1", "glob": "~10.3.4", "npm-run-all": "~4.1.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c9b91a33e61..a97811354b5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,7 +12,7 @@ devDependencies: version: 13.0.1 '@types/node': specifier: ~20.6.2 - version: 20.6.2 + version: 20.6.4 '@types/sanitize-html': specifier: ~2.9.0 version: 2.9.0 @@ -30,10 +30,10 @@ devDependencies: version: 6.7.2(eslint@8.49.0)(typescript@4.9.5) '@vitest/coverage-v8': specifier: ~0.34.4 - version: 0.34.4(vitest@0.34.4) + version: 0.34.5(vitest@0.34.5) '@vitest/ui': specifier: ~0.34.4 - version: 0.34.4(vitest@0.34.4) + version: 0.34.5(vitest@0.34.5) '@vueuse/core': specifier: ~10.4.1 version: 10.4.1(vue@3.3.4) @@ -63,16 +63,19 @@ devDependencies: version: 2.0.0(eslint@8.49.0)(typescript@4.9.5) eslint-plugin-jsdoc: specifier: ~46.8.1 - version: 46.8.1(eslint@8.49.0) + version: 46.8.2(eslint@8.49.0) eslint-plugin-prettier: specifier: ~5.0.0 version: 5.0.0(eslint-config-prettier@9.0.0)(eslint@8.49.0)(prettier@3.0.3) + eslint-plugin-unicorn: + specifier: ~48.0.1 + version: 48.0.1(eslint@8.49.0) eslint-plugin-vitest: specifier: ~0.3.1 - version: 0.3.1(@typescript-eslint/eslint-plugin@6.7.2)(eslint@8.49.0)(vitest@0.34.4) + version: 0.3.1(@typescript-eslint/eslint-plugin@6.7.2)(eslint@8.49.0)(vitest@0.34.5) glob: specifier: ~10.3.4 - version: 10.3.4 + version: 10.3.6 npm-run-all: specifier: ~4.1.5 version: 4.1.5 @@ -108,13 +111,13 @@ devDependencies: version: 13.11.0 vite: specifier: ~4.4.9 - version: 4.4.9(@types/node@20.6.2) + version: 4.4.9(@types/node@20.6.4) vitepress: specifier: 1.0.0-beta.7 - version: 1.0.0-beta.7(@algolia/client-search@4.19.1)(@types/node@20.6.2)(search-insights@2.8.2) + version: 1.0.0-beta.7(@algolia/client-search@4.19.1)(@types/node@20.6.4)(search-insights@2.8.2) vitest: specifier: ~0.34.4 - version: 0.34.4(@vitest/ui@0.34.4) + version: 0.34.5(@vitest/ui@0.34.5) vue: specifier: ~3.3.4 version: 3.3.4 @@ -464,7 +467,7 @@ packages: resolution: {integrity: sha512-NfsJX4PdzhwSkfJukczyUiZGc7zNNWZcEAyqeISpDnn0PTfzMJR1aR8xAIPskBejIxBJbIgCCMzbaYa9SXepIg==} dependencies: '@esbuild-kit/core-utils': 3.3.2 - get-tsconfig: 4.7.0 + get-tsconfig: 4.7.2 dev: true /@esbuild-kit/core-utils@3.3.2: @@ -478,7 +481,7 @@ packages: resolution: {integrity: sha512-FxEMIkJKnodyA1OaCUoEvbYRkoZlLZ4d/eXFu9Fh8CbBBgP5EmZxrfTRyN0qpXZ4vOvqnE5YdRdcrmUUXuU+dA==} dependencies: '@esbuild-kit/core-utils': 3.3.2 - get-tsconfig: 4.7.0 + get-tsconfig: 4.7.2 dev: true /@esbuild/android-arm64@0.18.20: @@ -899,7 +902,7 @@ packages: ajv: 6.12.6 debug: 4.3.4(supports-color@8.1.1) espree: 9.6.1 - globals: 13.21.0 + globals: 13.22.0 ignore: 5.2.4 import-fresh: 3.3.0 js-yaml: 4.1.0 @@ -1171,12 +1174,12 @@ packages: resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} dev: true - /@types/node@18.17.17: - resolution: {integrity: sha512-cOxcXsQ2sxiwkykdJqvyFS+MLQPLvIdwh5l6gNg8qF6s+C7XSkEWOZjK+XhUZd+mYvHV/180g2cnCcIl4l06Pw==} + /@types/node@18.17.19: + resolution: {integrity: sha512-+pMhShR3Or5GR0/sp4Da7FnhVmTalWm81M6MkEldbwjETSaPalw138Z4KdpQaistvqQxLB7Cy4xwYdxpbSOs9Q==} dev: true - /@types/node@20.6.2: - resolution: {integrity: sha512-Y+/1vGBHV/cYk6OI1Na/LHzwnlNCAfU3ZNGrc1LdRe/LAIbdDPTTv/HU3M7yXN448aTVDq3eKRm2cg7iKLb8gw==} + /@types/node@20.6.4: + resolution: {integrity: sha512-nU6d9MPY0NBUMiE/nXd2IIoC4OLvsLpwAjheoAeuzgvDZA1Cb10QYg+91AF6zQiKWRN5i1m07x6sMe0niBznoQ==} dev: true /@types/normalize-package-data@2.4.1: @@ -1213,7 +1216,7 @@ packages: resolution: {integrity: sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==} requiresBuild: true dependencies: - '@types/node': 20.6.2 + '@types/node': 20.6.4 dev: true optional: true @@ -1395,12 +1398,12 @@ packages: vite: ^4.0.0 vue: ^3.2.25 dependencies: - vite: 4.4.9(@types/node@20.6.2) + vite: 4.4.9(@types/node@20.6.4) vue: 3.3.4 dev: true - /@vitest/coverage-v8@0.34.4(vitest@0.34.4): - resolution: {integrity: sha512-TZ5ghzhmg3COQqfBShL+zRQEInHmV9TSwghTdfkHpCTyTOr+rxo6x41vCNcVfWysWULtqtBVpY6YFNovxnESfA==} + /@vitest/coverage-v8@0.34.5(vitest@0.34.5): + resolution: {integrity: sha512-97xjhRTSdmeeHCm2nNHhT3hLsMYkAhHXm/rwj6SZ3voka8xiCJrwgtfIjoZIFEL4OO0KezGmVuHWQXcMunULIA==} peerDependencies: vitest: '>=0.32.0 <1' dependencies: @@ -1415,58 +1418,58 @@ packages: std-env: 3.4.3 test-exclude: 6.0.0 v8-to-istanbul: 9.1.0 - vitest: 0.34.4(@vitest/ui@0.34.4) + vitest: 0.34.5(@vitest/ui@0.34.5) transitivePeerDependencies: - supports-color dev: true - /@vitest/expect@0.34.4: - resolution: {integrity: sha512-XlMKX8HyYUqB8dsY8Xxrc64J2Qs9pKMt2Z8vFTL4mBWXJsg4yoALHzJfDWi8h5nkO4Zua4zjqtapQ/IluVkSnA==} + /@vitest/expect@0.34.5: + resolution: {integrity: sha512-/3RBIV9XEH+nRpRMqDJBufKIOQaYUH2X6bt0rKSCW0MfKhXFLYsR5ivHifeajRSTsln0FwJbitxLKHSQz/Xwkw==} dependencies: - '@vitest/spy': 0.34.4 - '@vitest/utils': 0.34.4 + '@vitest/spy': 0.34.5 + '@vitest/utils': 0.34.5 chai: 4.3.8 dev: true - /@vitest/runner@0.34.4: - resolution: {integrity: sha512-hwwdB1StERqUls8oV8YcpmTIpVeJMe4WgYuDongVzixl5hlYLT2G8afhcdADeDeqCaAmZcSgLTLtqkjPQF7x+w==} + /@vitest/runner@0.34.5: + resolution: {integrity: sha512-RDEE3ViVvl7jFSCbnBRyYuu23XxmvRTSZWW6W4M7eC5dOsK75d5LIf6uhE5Fqf809DQ1+9ICZZNxhIolWHU4og==} dependencies: - '@vitest/utils': 0.34.4 + '@vitest/utils': 0.34.5 p-limit: 4.0.0 pathe: 1.1.1 dev: true - /@vitest/snapshot@0.34.4: - resolution: {integrity: sha512-GCsh4coc3YUSL/o+BPUo7lHQbzpdttTxL6f4q0jRx2qVGoYz/cyTRDJHbnwks6TILi6560bVWoBpYC10PuTLHw==} + /@vitest/snapshot@0.34.5: + resolution: {integrity: sha512-+ikwSbhu6z2yOdtKmk/aeoDZ9QPm2g/ZO5rXT58RR9Vmu/kB2MamyDSx77dctqdZfP3Diqv4mbc/yw2kPT8rmA==} dependencies: magic-string: 0.30.3 pathe: 1.1.1 pretty-format: 29.7.0 dev: true - /@vitest/spy@0.34.4: - resolution: {integrity: sha512-PNU+fd7DUPgA3Ya924b1qKuQkonAW6hL7YUjkON3wmBwSTIlhOSpy04SJ0NrRsEbrXgMMj6Morh04BMf8k+w0g==} + /@vitest/spy@0.34.5: + resolution: {integrity: sha512-epsicsfhvBjRjCMOC/3k00mP/TBGQy8/P0DxOFiWyLt55gnZ99dqCfCiAsKO17BWVjn4eZRIjKvcqNmSz8gvmg==} dependencies: tinyspy: 2.1.1 dev: true - /@vitest/ui@0.34.4(vitest@0.34.4): - resolution: {integrity: sha512-gz0m0r9ErFG32r+DRdwuLJpUDpbi+jrMcw9nJZAau48Fs4LDIBg561PvczvGqyYxzbyFU7vgkSnSlSDfK0d53w==} + /@vitest/ui@0.34.5(vitest@0.34.5): + resolution: {integrity: sha512-nK3Ny7fQgoTJMCGXLzYL0oo1ePtruRM9eYT1Y8esQx8fHj05davqVgqWv4Kd+Yy8PfzyrduTx1EYBdSMIbQh8A==} peerDependencies: vitest: '>=0.30.1 <1' dependencies: - '@vitest/utils': 0.34.4 + '@vitest/utils': 0.34.5 fast-glob: 3.3.1 fflate: 0.8.1 flatted: 3.2.9 pathe: 1.1.1 picocolors: 1.0.0 sirv: 2.0.3 - vitest: 0.34.4(@vitest/ui@0.34.4) + vitest: 0.34.5(@vitest/ui@0.34.5) dev: true - /@vitest/utils@0.34.4: - resolution: {integrity: sha512-yR2+5CHhp/K4ySY0Qtd+CAL9f5Yh1aXrKfAT42bq6CtlGPh92jIDDDSg7ydlRow1CP+dys4TrOrbELOyNInHSg==} + /@vitest/utils@0.34.5: + resolution: {integrity: sha512-ur6CmmYQoeHMwmGb0v+qwkwN3yopZuZyf4xt1DBBSGBed8Hf9Gmbm/5dEWqgpLPdRx6Av6jcWXrjcKfkTzg/pw==} dependencies: diff-sequences: 29.6.3 loupe: 2.3.6 @@ -2028,6 +2031,13 @@ packages: engines: {node: '>=8'} dev: true + /clean-regexp@1.0.0: + resolution: {integrity: sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==} + engines: {node: '>=4'} + dependencies: + escape-string-regexp: 1.0.5 + dev: true + /clean-stack@2.2.0: resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} engines: {node: '>=6'} @@ -2471,7 +2481,7 @@ packages: dependencies: '@cypress/request': 3.0.1 '@cypress/xvfb': 1.2.4(supports-color@8.1.1) - '@types/node': 18.17.17 + '@types/node': 18.17.19 '@types/sinonjs__fake-timers': 8.1.1 '@types/sizzle': 2.3.3 arch: 2.2.0 @@ -2945,8 +2955,8 @@ packages: - supports-color dev: true - /eslint-plugin-jsdoc@46.8.1(eslint@8.49.0): - resolution: {integrity: sha512-uTce7IBluPKXIQMWJkIwFsI1gv7sZRmLjctca2K5DIxPi8fSBj9f4iru42XmGwuiMyH2f3nfc60sFmnSGv4Z/A==} + /eslint-plugin-jsdoc@46.8.2(eslint@8.49.0): + resolution: {integrity: sha512-5TSnD018f3tUJNne4s4gDWQflbsgOycIKEUBoCLn6XtBMgNHxQFmV8vVxUtiPxAQq8lrX85OaSG/2gnctxw9uQ==} engines: {node: '>=16'} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -2986,7 +2996,31 @@ packages: synckit: 0.8.5 dev: true - /eslint-plugin-vitest@0.3.1(@typescript-eslint/eslint-plugin@6.7.2)(eslint@8.49.0)(vitest@0.34.4): + /eslint-plugin-unicorn@48.0.1(eslint@8.49.0): + resolution: {integrity: sha512-FW+4r20myG/DqFcCSzoumaddKBicIPeFnTrifon2mWIzlfyvzwyqZjqVP7m4Cqr/ZYisS2aiLghkUWaPg6vtCw==} + engines: {node: '>=16'} + peerDependencies: + eslint: '>=8.44.0' + dependencies: + '@babel/helper-validator-identifier': 7.22.20 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.49.0) + ci-info: 3.8.0 + clean-regexp: 1.0.0 + eslint: 8.49.0 + esquery: 1.5.0 + indent-string: 4.0.0 + is-builtin-module: 3.2.1 + jsesc: 3.0.2 + lodash: 4.17.21 + pluralize: 8.0.0 + read-pkg-up: 7.0.1 + regexp-tree: 0.1.27 + regjsparser: 0.10.0 + semver: 7.5.4 + strip-indent: 3.0.0 + dev: true + + /eslint-plugin-vitest@0.3.1(@typescript-eslint/eslint-plugin@6.7.2)(eslint@8.49.0)(vitest@0.34.5): resolution: {integrity: sha512-GeR3zISHmqUGWK2sfW+eyCZivMqiQYzPf9UttHXBiEyMveS/jkKLHCrHUllwr3Hz1+i0zoseANd2xL0cFha8Eg==} engines: {node: 14.x || >= 16} peerDependencies: @@ -3001,7 +3035,7 @@ packages: '@typescript-eslint/utils': 6.7.2(eslint@8.49.0)(typescript@5.2.2) eslint: 8.49.0 typescript: 5.2.2 - vitest: 0.34.4(@vitest/ui@0.34.4) + vitest: 0.34.5(@vitest/ui@0.34.5) transitivePeerDependencies: - supports-color dev: true @@ -3046,7 +3080,7 @@ packages: file-entry-cache: 6.0.1 find-up: 5.0.0 glob-parent: 6.0.2 - globals: 13.21.0 + globals: 13.22.0 graphemer: 1.4.0 ignore: 5.2.4 imurmurhash: 0.1.4 @@ -3418,8 +3452,8 @@ packages: get-intrinsic: 1.2.1 dev: true - /get-tsconfig@4.7.0: - resolution: {integrity: sha512-pmjiZ7xtB8URYm74PlGJozDNyhvsVLUcpBa8DZBG3bWHwaHa9bPiRpiSfovw+fjhwONSCWKRyk+JQHEGZmMrzw==} + /get-tsconfig@4.7.2: + resolution: {integrity: sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==} dependencies: resolve-pkg-maps: 1.0.0 dev: true @@ -3504,8 +3538,8 @@ packages: is-glob: 4.0.3 dev: true - /glob@10.3.4: - resolution: {integrity: sha512-6LFElP3A+i/Q8XQKEvZjkEWEOTgAIALR9AO2rwT8bgPhDd1anmqDJDZ6lLddI4ehxxxR1S5RIqKe1uapMQfYaQ==} + /glob@10.3.6: + resolution: {integrity: sha512-mEfImdc/fiYHEcF6pHFfD2b/KrdFB1qH9mRe5vI5HROF8G51SWxQJ2V56Ezl6ZL9y86gsxQ1Lgo2S746KGUPSQ==} engines: {node: '>=16 || 14 >=14.17'} hasBin: true dependencies: @@ -3534,8 +3568,8 @@ packages: ini: 2.0.0 dev: true - /globals@13.21.0: - resolution: {integrity: sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==} + /globals@13.22.0: + resolution: {integrity: sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==} engines: {node: '>=8'} dependencies: type-fest: 0.20.2 @@ -4046,6 +4080,17 @@ packages: engines: {node: '>=12.0.0'} dev: true + /jsesc@0.5.0: + resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==} + hasBin: true + dev: true + + /jsesc@3.0.2: + resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==} + engines: {node: '>=6'} + hasBin: true + dev: true + /json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} dev: true @@ -4816,6 +4861,11 @@ packages: pathe: 1.1.1 dev: true + /pluralize@8.0.0: + resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} + engines: {node: '>=4'} + dev: true + /postcss@8.4.30: resolution: {integrity: sha512-7ZEao1g4kd68l97aWG/etQKPKq07us0ieSZ2TnFDk11i0ZfDW2AwKHYU8qv4MZKqN2fdBfg+7q0ES06UA73C1g==} engines: {node: ^10 || ^12 || >=14} @@ -5020,6 +5070,11 @@ packages: strip-indent: 3.0.0 dev: true + /regexp-tree@0.1.27: + resolution: {integrity: sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==} + hasBin: true + dev: true + /regexp.prototype.flags@1.5.1: resolution: {integrity: sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==} engines: {node: '>= 0.4'} @@ -5029,6 +5084,13 @@ packages: set-function-name: 2.0.1 dev: true + /regjsparser@0.10.0: + resolution: {integrity: sha512-qx+xQGZVsy55CH0a1hiVwHmqjLryfh7wQyF5HO07XJ9f7dQMY/gPQHhlyDkIzJKC+x2fUCpCcUODUUUFrm7SHA==} + hasBin: true + dependencies: + jsesc: 0.5.0 + dev: true + /request-progress@3.0.0: resolution: {integrity: sha512-MnWzEHHaxHO2iWiQuHrUPBi/1WeBf5PkxQqNyNvLl9VAYSdXkP8tQ3pBSeCPD+yw0v0Aq1zosWLz0BdeXpWwZg==} dependencies: @@ -5091,7 +5153,7 @@ packages: engines: {node: '>=14'} hasBin: true dependencies: - glob: 10.3.4 + glob: 10.3.6 dev: true /rollup@3.29.2: @@ -5925,8 +5987,8 @@ packages: extsprintf: 1.3.0 dev: true - /vite-node@0.34.4(@types/node@20.6.2): - resolution: {integrity: sha512-ho8HtiLc+nsmbwZMw8SlghESEE3KxJNp04F/jPUCLVvaURwt0d+r9LxEqCX5hvrrOQ0GSyxbYr5ZfRYhQ0yVKQ==} + /vite-node@0.34.5(@types/node@20.6.4): + resolution: {integrity: sha512-RNZ+DwbCvDoI5CbCSQSyRyzDTfFvFauvMs6Yq4ObJROKlIKuat1KgSX/Ako5rlDMfVCyMcpMRMTkJBxd6z8YRA==} engines: {node: '>=v14.18.0'} hasBin: true dependencies: @@ -5935,7 +5997,7 @@ packages: mlly: 1.4.2 pathe: 1.1.1 picocolors: 1.0.0 - vite: 4.4.9(@types/node@20.6.2) + vite: 4.4.9(@types/node@20.6.4) transitivePeerDependencies: - '@types/node' - less @@ -5947,7 +6009,7 @@ packages: - terser dev: true - /vite@4.4.9(@types/node@20.6.2): + /vite@4.4.9(@types/node@20.6.4): resolution: {integrity: sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -5975,7 +6037,7 @@ packages: terser: optional: true dependencies: - '@types/node': 20.6.2 + '@types/node': 20.6.4 esbuild: 0.18.20 postcss: 8.4.30 rollup: 3.29.2 @@ -5983,7 +6045,7 @@ packages: fsevents: 2.3.3 dev: true - /vitepress@1.0.0-beta.7(@algolia/client-search@4.19.1)(@types/node@20.6.2)(search-insights@2.8.2): + /vitepress@1.0.0-beta.7(@algolia/client-search@4.19.1)(@types/node@20.6.4)(search-insights@2.8.2): resolution: {integrity: sha512-P9Rw+FXatKIU4fVdtKxqwHl6fby8E/8zE3FIfep6meNgN4BxbWqoKJ6yfuuQQR9IrpQqwnyaBh4LSabyll6tWg==} hasBin: true dependencies: @@ -5998,7 +6060,7 @@ packages: mark.js: 8.11.1 minisearch: 6.1.0 shiki: 0.14.4 - vite: 4.4.9(@types/node@20.6.2) + vite: 4.4.9(@types/node@20.6.4) vue: 3.3.4 transitivePeerDependencies: - '@algolia/client-search' @@ -6027,8 +6089,8 @@ packages: - universal-cookie dev: true - /vitest@0.34.4(@vitest/ui@0.34.4): - resolution: {integrity: sha512-SE/laOsB6995QlbSE6BtkpXDeVNLJc1u2LHRG/OpnN4RsRzM3GQm4nm3PQCK5OBtrsUqnhzLdnT7se3aeNGdlw==} + /vitest@0.34.5(@vitest/ui@0.34.5): + resolution: {integrity: sha512-CPI68mmnr2DThSB3frSuE5RLm9wo5wU4fbDrDwWQQB1CWgq9jQVoQwnQSzYAjdoBOPoH2UtXpOgHVge/uScfZg==} engines: {node: '>=v14.18.0'} hasBin: true peerDependencies: @@ -6060,13 +6122,13 @@ packages: dependencies: '@types/chai': 4.3.6 '@types/chai-subset': 1.3.3 - '@types/node': 20.6.2 - '@vitest/expect': 0.34.4 - '@vitest/runner': 0.34.4 - '@vitest/snapshot': 0.34.4 - '@vitest/spy': 0.34.4 - '@vitest/ui': 0.34.4(vitest@0.34.4) - '@vitest/utils': 0.34.4 + '@types/node': 20.6.4 + '@vitest/expect': 0.34.5 + '@vitest/runner': 0.34.5 + '@vitest/snapshot': 0.34.5 + '@vitest/spy': 0.34.5 + '@vitest/ui': 0.34.5(vitest@0.34.5) + '@vitest/utils': 0.34.5 acorn: 8.10.0 acorn-walk: 8.2.0 cac: 6.7.14 @@ -6080,8 +6142,8 @@ packages: strip-literal: 1.3.0 tinybench: 2.5.1 tinypool: 0.7.0 - vite: 4.4.9(@types/node@20.6.2) - vite-node: 0.34.4(@types/node@20.6.2) + vite: 4.4.9(@types/node@20.6.4) + vite-node: 0.34.5(@types/node@20.6.4) why-is-node-running: 2.2.2 transitivePeerDependencies: - less From 8b0b1f8b62f608e57b2181f632201103d1dbc4ee Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Sat, 23 Sep 2023 23:48:38 +0200 Subject: [PATCH 2/5] infra(unicorn): prefer-spread --- .eslintrc.js | 1 - src/internal/merge.ts | 2 +- src/modules/color/index.ts | 4 +++- src/modules/company/index.ts | 2 +- src/modules/finance/index.ts | 6 +++--- src/modules/helpers/index.ts | 6 +++--- src/modules/internet/index.ts | 7 +++---- src/modules/string/index.ts | 18 +++++++----------- src/modules/system/index.ts | 4 ++-- test/modules/datatype.spec.ts | 24 ++++++++++++------------ test/modules/helpers.spec.ts | 16 ++++++++-------- test/modules/number.spec.ts | 16 ++++++++-------- test/modules/random.spec.ts | 17 +++++++++-------- test/modules/string.spec.ts | 20 ++++++++++---------- test/modules/system.spec.ts | 2 +- test/support/seededRuns.ts | 2 +- 16 files changed, 72 insertions(+), 75 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 2e9045ae093..04d32a7210c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -85,7 +85,6 @@ module.exports = defineConfig({ 'unicorn/prefer-number-properties': 'off', 'unicorn/prefer-object-from-entries': 'off', 'unicorn/prefer-optional-catch-binding': 'off', - 'unicorn/prefer-spread': 'off', 'unicorn/prefer-string-slice': 'off', 'unicorn/prefer-string-starts-ends-with': 'off', 'unicorn/prefer-ternary': 'off', diff --git a/src/internal/merge.ts b/src/internal/merge.ts index 88204e29cea..2bb4c035191 100644 --- a/src/internal/merge.ts +++ b/src/internal/merge.ts @@ -8,5 +8,5 @@ * @param args The arrays to merge. */ export function mergeArrays(...args: T[][]): T[] { - return Array.from(new Set(args.flat())).sort(); + return [...new Set(args.flat())].sort(); } diff --git a/src/modules/color/index.ts b/src/modules/color/index.ts index 790a6925e1a..57debf8edf7 100644 --- a/src/modules/color/index.ts +++ b/src/modules/color/index.ts @@ -86,7 +86,9 @@ function toBinary(values: number[]): string { const buffer = new ArrayBuffer(4); new DataView(buffer).setFloat32(0, value); const bytes = new Uint8Array(buffer); - return toBinary(Array.from(bytes)).split(' ').join(''); + return toBinary([...bytes]) + .split(' ') + .join(''); } return (value >>> 0).toString(2).padStart(8, '0'); diff --git a/src/modules/company/index.ts b/src/modules/company/index.ts index c24ea7f3b6b..361449618c0 100644 --- a/src/modules/company/index.ts +++ b/src/modules/company/index.ts @@ -42,7 +42,7 @@ export class CompanyModule { }); // Don't want the source array exposed to modification, so return a copy // eslint-disable-next-line deprecation/deprecation - return this.faker.definitions.company.suffix.slice(0); + return [...this.faker.definitions.company.suffix]; } /** diff --git a/src/modules/finance/index.ts b/src/modules/finance/index.ts index 43cd16a1c5e..ce4b2889edf 100644 --- a/src/modules/finance/index.ts +++ b/src/modules/finance/index.ts @@ -722,9 +722,9 @@ export class FinanceModule { let address = this.faker.helpers.arrayElement(['L', 'M', '3']); for (let i = 0; i < addressLength - 1; i++) - address += this.faker.helpers.arrayElement( - '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'.split('') - ); + address += this.faker.helpers.arrayElement([ + ...'123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ', + ]); return address; } diff --git a/src/modules/helpers/index.ts b/src/modules/helpers/index.ts index 3889c572a22..39d5ed07cdf 100644 --- a/src/modules/helpers/index.ts +++ b/src/modules/helpers/index.ts @@ -697,7 +697,7 @@ export class SimpleHelpersModule { uniqueArray(source: ReadonlyArray | (() => T), length: number): T[] { if (Array.isArray(source)) { const set = new Set(source); - const array = Array.from(set); + const array = [...set]; return this.shuffle(array).splice(0, length); } @@ -715,7 +715,7 @@ export class SimpleHelpersModule { // Ignore } - return Array.from(set); + return [...set]; } /** @@ -996,7 +996,7 @@ export class SimpleHelpersModule { return []; } - const arrayCopy = array.slice(0); + const arrayCopy = [...array]; let i = array.length; const min = i - numElements; let temp: T; diff --git a/src/modules/internet/index.ts b/src/modules/internet/index.ts index 842ab1538af..144be86414f 100644 --- a/src/modules/internet/index.ts +++ b/src/modules/internet/index.ts @@ -271,8 +271,8 @@ export class InternetModule { // We limit to 50 chars to be more realistic localPart = localPart.substring(0, 50); if (allowSpecialCharacters) { - const usernameChars: string[] = '._-'.split(''); - const specialChars: string[] = ".!#$%&'*+-/=?^_`{|}~".split(''); + const usernameChars: string[] = [...'._-']; + const specialChars: string[] = [...".!#$%&'*+-/=?^_`{|}~"]; localPart = localPart.replace( this.faker.helpers.arrayElement(usernameChars), this.faker.helpers.arrayElement(specialChars) @@ -638,8 +638,7 @@ export class InternetModule { .normalize('NFKD') //for example è decomposes to as e + ̀ .replace(/[\u0300-\u036f]/g, ''); // removes combining marks - result = result - .split('') + result = [...result] .map((char) => { // If we have a mapping for this character, (for Cyrillic, Greek etc) use it if (charMapping[char]) { diff --git a/src/modules/string/index.ts b/src/modules/string/index.ts index 8167ebeafb7..a370c386c11 100644 --- a/src/modules/string/index.ts +++ b/src/modules/string/index.ts @@ -5,13 +5,9 @@ import type { LiteralUnion } from '../../utils/types'; export type Casing = 'upper' | 'lower' | 'mixed'; -const UPPER_CHARS: ReadonlyArray = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split( - '' -); -const LOWER_CHARS: ReadonlyArray = 'abcdefghijklmnopqrstuvwxyz'.split( - '' -); -const DIGIT_CHARS: ReadonlyArray = '0123456789'.split(''); +const UPPER_CHARS: ReadonlyArray = [...'ABCDEFGHIJKLMNOPQRSTUVWXYZ']; +const LOWER_CHARS: ReadonlyArray = [...'abcdefghijklmnopqrstuvwxyz']; +const DIGIT_CHARS: ReadonlyArray = [...'0123456789']; export type LowerAlphaChar = | 'a' @@ -145,7 +141,7 @@ export class StringModule { } if (typeof characters === 'string') { - characters = characters.split(''); + characters = [...characters]; } if (characters.length === 0) { @@ -229,7 +225,7 @@ export class StringModule { let { exclude = [] } = options; if (typeof exclude === 'string') { - exclude = exclude.split(''); + exclude = [...exclude]; } let charsArray: string[]; @@ -319,7 +315,7 @@ export class StringModule { let { exclude = [] } = options; if (typeof exclude === 'string') { - exclude = exclude.split(''); + exclude = [...exclude]; } let charsArray = [...DIGIT_CHARS]; @@ -596,7 +592,7 @@ export class StringModule { let { exclude = [] } = options; if (typeof exclude === 'string') { - exclude = exclude.split(''); + exclude = [...exclude]; } const allowedDigits = DIGIT_CHARS.filter( diff --git a/src/modules/system/index.ts b/src/modules/system/index.ts index 4e5b5574e8c..7119807d6b8 100644 --- a/src/modules/system/index.ts +++ b/src/modules/system/index.ts @@ -163,7 +163,7 @@ export class SystemModule { typeSet.add(type); }); - const types = Array.from(typeSet); + const types = [...typeSet]; return this.faker.helpers.arrayElement(types); } @@ -195,7 +195,7 @@ export class SystemModule { } }); - const extensions = Array.from(extensionSet); + const extensions = [...extensionSet]; return this.faker.helpers.arrayElement(extensions); } diff --git a/test/modules/datatype.spec.ts b/test/modules/datatype.spec.ts index e3e052ef994..964636bc995 100644 --- a/test/modules/datatype.spec.ts +++ b/test/modules/datatype.spec.ts @@ -164,8 +164,8 @@ describe('datatype', () => { }); it('provides numbers with a given precision of 0.5 steps', () => { - const results = Array.from( - new Set( + const results = [ + ...new Set( Array.from({ length: 50 }, () => faker.datatype.float({ min: 0, @@ -173,16 +173,16 @@ describe('datatype', () => { precision: 0.5, }) ) - ) - ).sort(); + ), + ].sort(); expect(results).toEqual([0, 0.5, 1, 1.5]); }); // TODO @Shinigami92 2022-11-24: https://github.com/faker-js/faker/issues/1595 it.todo('provides numbers with a given precision of 0.4 steps', () => { - const results = Array.from( - new Set( + const results = [ + ...new Set( Array.from({ length: 50 }, () => faker.datatype.float({ min: 0, @@ -190,8 +190,8 @@ describe('datatype', () => { precision: 0.4, }) ) - ) - ).sort(); + ), + ].sort(); expect(results).toEqual([0, 0.4, 0.8, 1.2, 1.6]); }); @@ -279,11 +279,11 @@ describe('datatype', () => { it('provides numbers with a given precision', () => { const options = { min: 0, max: 1.5, precision: 0.5 }; - const results = Array.from( - new Set( + const results = [ + ...new Set( Array.from({ length: 50 }, () => faker.datatype.float(options)) - ) - ).sort(); + ), + ].sort(); expect(results).toEqual([0, 0.5, 1, 1.5]); }); diff --git a/test/modules/helpers.spec.ts b/test/modules/helpers.spec.ts index 7b709373f24..4b1f9abfc61 100644 --- a/test/modules/helpers.spec.ts +++ b/test/modules/helpers.spec.ts @@ -71,7 +71,7 @@ describe('helpers', () => { }); t.describe('arrayElement', (t) => { - t.it('with array', 'Hello World!'.split('')); + t.it('with array', [...'Hello World!']); }); t.describe('enumValue', (t) => { @@ -120,26 +120,26 @@ describe('helpers', () => { }); t.describe('arrayElements', (t) => { - t.it('with array', 'Hello World!'.split('')) - .it('with array and count', 'Hello World!'.split(''), 3) - .it('with array and count range', 'Hello World!'.split(''), { + t.it('with array', [...'Hello World!']) + .it('with array and count', [...'Hello World!'], 3) + .it('with array and count range', [...'Hello World!'], { min: 1, max: 5, }); }); t.describe('shuffle', (t) => { - t.it('with array', 'Hello World!'.split('')) - .it('with array and inplace true', 'Hello World!'.split(''), { + t.it('with array', [...'Hello World!']) + .it('with array and inplace true', [...'Hello World!'], { inplace: true, }) - .it('with array and inplace false', 'Hello World!'.split(''), { + .it('with array and inplace false', [...'Hello World!'], { inplace: false, }); }); t.describe('uniqueArray', (t) => { - t.it('with array', 'Hello World!'.split(''), 3); + t.it('with array', [...'Hello World!'], 3); }); t.describe('maybe', (t) => { diff --git a/test/modules/number.spec.ts b/test/modules/number.spec.ts index 19bd8f393d2..79b14261e31 100644 --- a/test/modules/number.spec.ts +++ b/test/modules/number.spec.ts @@ -227,8 +227,8 @@ describe('number', () => { }); it('provides numbers with a given precision of 0.5 steps', () => { - const results = Array.from( - new Set( + const results = [ + ...new Set( Array.from({ length: 50 }, () => faker.number.float({ min: 0, @@ -236,15 +236,15 @@ describe('number', () => { precision: 0.5, }) ) - ) - ).sort(); + ), + ].sort(); expect(results).toEqual([0, 0.5, 1, 1.5]); }); it('provides numbers with a given precision of 0.4 steps', () => { - const results = Array.from( - new Set( + const results = [ + ...new Set( Array.from({ length: 50 }, () => faker.number.float({ min: 0, @@ -252,8 +252,8 @@ describe('number', () => { precision: 0.4, }) ) - ) - ).sort(); + ), + ].sort(); expect(results).toEqual([0, 0.4, 0.8, 1.2, 1.6]); }); diff --git a/test/modules/random.spec.ts b/test/modules/random.spec.ts index 21200c3a8f1..80fa10aa703 100644 --- a/test/modules/random.spec.ts +++ b/test/modules/random.spec.ts @@ -194,8 +194,9 @@ describe('random', () => { }); it('should throw if all possible characters being banned', () => { - const bannedChars = - 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); + const bannedChars = [ + ...'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', + ]; expect(() => faker.random.alpha({ count: 5, @@ -256,7 +257,7 @@ describe('random', () => { ); it('should be able to ban all alphabetic characters', () => { - const bannedChars = 'abcdefghijklmnopqrstuvwxyz'.split(''); + const bannedChars = [...'abcdefghijklmnopqrstuvwxyz']; const alphaText = faker.random.alphaNumeric(5, { bannedChars, }); @@ -280,7 +281,7 @@ describe('random', () => { }); it('should be able to ban all numeric characters', () => { - const bannedChars = '0123456789'.split(''); + const bannedChars = [...'0123456789']; const alphaText = faker.random.alphaNumeric(5, { bannedChars, }); @@ -314,7 +315,7 @@ describe('random', () => { }); it('should throw if all possible characters being banned', () => { - const bannedChars = 'abcdefghijklmnopqrstuvwxyz0123456789'.split(''); + const bannedChars = [...'abcdefghijklmnopqrstuvwxyz0123456789']; expect(() => faker.random.alphaNumeric(5, { bannedChars, @@ -396,7 +397,7 @@ describe('random', () => { it('should allow leading zeros via option and all other digits banned', () => { const actual = faker.random.numeric(4, { allowLeadingZeros: true, - bannedDigits: '123456789'.split(''), + bannedDigits: [...'123456789'], }); expect(actual).toBe('0000'); @@ -415,7 +416,7 @@ describe('random', () => { expect(() => faker.random.numeric(4, { allowLeadingZeros: false, - bannedDigits: '123456789'.split(''), + bannedDigits: [...'123456789'], }) ).toThrow( new FakerError( @@ -439,7 +440,7 @@ describe('random', () => { it('should ban all digits passed via bannedDigits', () => { const actual = faker.random.numeric(1000, { - bannedDigits: 'c84U1'.split(''), + bannedDigits: [...'c84U1'], }); expect(actual).toHaveLength(1000); diff --git a/test/modules/string.spec.ts b/test/modules/string.spec.ts index 4b885a3ab5d..9d2debba257 100644 --- a/test/modules/string.spec.ts +++ b/test/modules/string.spec.ts @@ -9,14 +9,14 @@ describe('string', () => { seededTests(faker, 'string', (t) => { t.describe('fromCharacters', (t) => { t.it('with string characters', 'foobar') - .it('with string[] characters', 'foobar'.split('')) + .it('with string[] characters', [...'foobar']) .it('with string characters and length', 'foobar', 5) - .it('with string[] characters and length', 'foobar'.split(''), 5) + .it('with string[] characters and length', [...'foobar'], 5) .it('with string characters and length range', 'foobar', { min: 10, max: 20, }) - .it('with string[] characters and length range', 'foobar'.split(''), { + .it('with string[] characters and length range', [...'foobar'], { min: 10, max: 20, }); @@ -283,7 +283,7 @@ describe('string', () => { }); it('should throw if all possible characters being excluded (string[])', () => { - const exclude = 'abcdefghijklmnopqrstuvwxyz'.split(''); + const exclude = [...'abcdefghijklmnopqrstuvwxyz']; expect(() => faker.string.alpha({ length: 5, @@ -357,7 +357,7 @@ describe('string', () => { }); it('should be able to ban all alphabetic characters', () => { - const exclude = 'abcdefghijklmnopqrstuvwxyz'.split(''); + const exclude = [...'abcdefghijklmnopqrstuvwxyz']; const alphaText = faker.string.alphanumeric({ length: 5, casing: 'lower', @@ -385,7 +385,7 @@ describe('string', () => { }); it('should be able to ban all numeric characters', () => { - const exclude = '0123456789'.split(''); + const exclude = [...'0123456789']; const alphaText = faker.string.alphanumeric({ length: 5, exclude, @@ -437,7 +437,7 @@ describe('string', () => { }); it('should throw if all possible characters being excluded (string[])', () => { - const exclude = 'abcdefghijklmnopqrstuvwxyz0123456789'.split(''); + const exclude = [...'abcdefghijklmnopqrstuvwxyz0123456789']; expect(() => faker.string.alphanumeric({ length: 5, @@ -645,7 +645,7 @@ describe('string', () => { const actual = faker.string.numeric({ length: 4, allowLeadingZeros: true, - exclude: '123456789'.split(''), + exclude: [...'123456789'], }); expect(actual).toBe('0000'); @@ -666,7 +666,7 @@ describe('string', () => { faker.string.numeric({ length: 4, allowLeadingZeros: false, - exclude: '123456789'.split(''), + exclude: [...'123456789'], }) ).toThrow( new FakerError( @@ -692,7 +692,7 @@ describe('string', () => { it('should ban all digits passed via exclude', () => { const actual = faker.string.numeric({ length: 1000, - exclude: 'c84U1'.split(''), + exclude: [...'c84U1'], }); expect(actual).toHaveLength(1000); diff --git a/test/modules/system.spec.ts b/test/modules/system.spec.ts index c75e09f55ee..12983ad86b0 100644 --- a/test/modules/system.spec.ts +++ b/test/modules/system.spec.ts @@ -405,7 +405,7 @@ describe('system', () => { ); it('should be able to return non-standard cron expressions', () => { - const validResults = [...'0123456789'.split(''), '*', '@']; + const validResults = [...'0123456789', '*', '@']; expect( faker.system.cron({ includeNonStandard: true })[0], 'generated cron, string should contain standard or non-standard cron labels' diff --git a/test/support/seededRuns.ts b/test/support/seededRuns.ts index eaf4520acab..4b014cb6d03 100644 --- a/test/support/seededRuns.ts +++ b/test/support/seededRuns.ts @@ -289,7 +289,7 @@ class TestGenerator< * This method will be called automatically at the end of each run. */ expectAllMethodsToBeTested(): void { - const actual = Array.from(this.tested).sort(); + const actual = [...this.tested].sort(); const expected = Object.entries(this.module) .filter(([, value]) => typeof value === 'function') .map(([key]) => key) From 77e121f473216a0f94acfdfa3f32d867bda4842f Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Sat, 7 Oct 2023 15:17:09 +0200 Subject: [PATCH 3/5] chore: fix merge conflicts --- pnpm-lock.yaml | 224 ++----------------------------------------------- 1 file changed, 7 insertions(+), 217 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8ba90ce4f9a..15fb0ef8cc6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,13 +11,8 @@ devDependencies: specifier: ~13.0.2 version: 13.0.2 '@types/node': -<<<<<<< HEAD - specifier: ~20.6.2 - version: 20.6.4 -======= specifier: ~20.8.0 version: 20.8.0 ->>>>>>> next '@types/sanitize-html': specifier: ~2.9.1 version: 2.9.1 @@ -34,19 +29,11 @@ devDependencies: specifier: ~6.7.3 version: 6.7.3(eslint@8.50.0)(typescript@4.9.5) '@vitest/coverage-v8': -<<<<<<< HEAD - specifier: ~0.34.4 - version: 0.34.5(vitest@0.34.5) - '@vitest/ui': - specifier: ~0.34.4 - version: 0.34.5(vitest@0.34.5) -======= specifier: ~0.34.6 version: 0.34.6(vitest@0.34.6) '@vitest/ui': specifier: ~0.34.7 version: 0.34.7(vitest@0.34.6) ->>>>>>> next '@vueuse/core': specifier: ~10.4.1 version: 10.4.1(vue@3.3.4) @@ -75,22 +62,6 @@ devDependencies: specifier: ~2.0.0 version: 2.0.0(eslint@8.50.0)(typescript@4.9.5) eslint-plugin-jsdoc: -<<<<<<< HEAD - specifier: ~46.8.1 - version: 46.8.2(eslint@8.49.0) - eslint-plugin-prettier: - specifier: ~5.0.0 - version: 5.0.0(eslint-config-prettier@9.0.0)(eslint@8.49.0)(prettier@3.0.3) - eslint-plugin-unicorn: - specifier: ~48.0.1 - version: 48.0.1(eslint@8.49.0) - eslint-plugin-vitest: - specifier: ~0.3.1 - version: 0.3.1(@typescript-eslint/eslint-plugin@6.7.2)(eslint@8.49.0)(vitest@0.34.5) - glob: - specifier: ~10.3.4 - version: 10.3.6 -======= specifier: ~46.8.2 version: 46.8.2(eslint@8.50.0) eslint-plugin-prettier: @@ -105,7 +76,6 @@ devDependencies: glob: specifier: ~10.3.10 version: 10.3.10 ->>>>>>> next npm-run-all: specifier: ~4.1.5 version: 4.1.5 @@ -141,15 +111,6 @@ devDependencies: version: 13.11.0 vite: specifier: ~4.4.9 -<<<<<<< HEAD - version: 4.4.9(@types/node@20.6.4) - vitepress: - specifier: 1.0.0-beta.7 - version: 1.0.0-beta.7(@algolia/client-search@4.19.1)(@types/node@20.6.4)(search-insights@2.8.2) - vitest: - specifier: ~0.34.4 - version: 0.34.5(@vitest/ui@0.34.5) -======= version: 4.4.9(@types/node@20.8.0) vitepress: specifier: 1.0.0-beta.7 @@ -157,7 +118,6 @@ devDependencies: vitest: specifier: ~0.34.6 version: 0.34.6(@vitest/ui@0.34.7) ->>>>>>> next vue: specifier: ~3.3.4 version: 3.3.4 @@ -503,30 +463,6 @@ packages: jsdoc-type-pratt-parser: 4.0.0 dev: true -<<<<<<< HEAD - /@esbuild-kit/cjs-loader@2.4.4: - resolution: {integrity: sha512-NfsJX4PdzhwSkfJukczyUiZGc7zNNWZcEAyqeISpDnn0PTfzMJR1aR8xAIPskBejIxBJbIgCCMzbaYa9SXepIg==} - dependencies: - '@esbuild-kit/core-utils': 3.3.2 - get-tsconfig: 4.7.2 - dev: true - - /@esbuild-kit/core-utils@3.3.2: - resolution: {integrity: sha512-sPRAnw9CdSsRmEtnsl2WXWdyquogVpB3yZ3dgwJfe8zrOzTsV7cJvmwrKVa+0ma5BoiGJ+BoqkMvawbayKUsqQ==} - dependencies: - esbuild: 0.18.20 - source-map-support: 0.5.21 - dev: true - - /@esbuild-kit/esm-loader@2.6.5: - resolution: {integrity: sha512-FxEMIkJKnodyA1OaCUoEvbYRkoZlLZ4d/eXFu9Fh8CbBBgP5EmZxrfTRyN0qpXZ4vOvqnE5YdRdcrmUUXuU+dA==} - dependencies: - '@esbuild-kit/core-utils': 3.3.2 - get-tsconfig: 4.7.2 - dev: true - -======= ->>>>>>> next /@esbuild/android-arm64@0.18.20: resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} engines: {node: '>=12'} @@ -945,7 +881,7 @@ packages: ajv: 6.12.6 debug: 4.3.4(supports-color@8.1.1) espree: 9.6.1 - globals: 13.22.0 + globals: 13.21.0 ignore: 5.2.4 import-fresh: 3.3.0 js-yaml: 4.1.0 @@ -1217,17 +1153,12 @@ packages: resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} dev: true - /@types/node@18.17.19: - resolution: {integrity: sha512-+pMhShR3Or5GR0/sp4Da7FnhVmTalWm81M6MkEldbwjETSaPalw138Z4KdpQaistvqQxLB7Cy4xwYdxpbSOs9Q==} + /@types/node@18.17.17: + resolution: {integrity: sha512-cOxcXsQ2sxiwkykdJqvyFS+MLQPLvIdwh5l6gNg8qF6s+C7XSkEWOZjK+XhUZd+mYvHV/180g2cnCcIl4l06Pw==} dev: true -<<<<<<< HEAD - /@types/node@20.6.4: - resolution: {integrity: sha512-nU6d9MPY0NBUMiE/nXd2IIoC4OLvsLpwAjheoAeuzgvDZA1Cb10QYg+91AF6zQiKWRN5i1m07x6sMe0niBznoQ==} -======= /@types/node@20.8.0: resolution: {integrity: sha512-LzcWltT83s1bthcvjBmiBvGJiiUe84NWRHkw+ZV6Fr41z2FbIzvc815dk2nQ3RAKMuN2fkenM/z3Xv2QzEpYxQ==} ->>>>>>> next dev: true /@types/normalize-package-data@2.4.1: @@ -1264,11 +1195,7 @@ packages: resolution: {integrity: sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==} requiresBuild: true dependencies: -<<<<<<< HEAD - '@types/node': 20.6.4 -======= '@types/node': 20.8.0 ->>>>>>> next dev: true optional: true @@ -1511,21 +1438,12 @@ packages: vite: ^4.0.0 vue: ^3.2.25 dependencies: -<<<<<<< HEAD - vite: 4.4.9(@types/node@20.6.4) - vue: 3.3.4 - dev: true - - /@vitest/coverage-v8@0.34.5(vitest@0.34.5): - resolution: {integrity: sha512-97xjhRTSdmeeHCm2nNHhT3hLsMYkAhHXm/rwj6SZ3voka8xiCJrwgtfIjoZIFEL4OO0KezGmVuHWQXcMunULIA==} -======= vite: 4.4.9(@types/node@20.8.0) vue: 3.3.4 dev: true /@vitest/coverage-v8@0.34.6(vitest@0.34.6): resolution: {integrity: sha512-fivy/OK2d/EsJFoEoxHFEnNGTg+MmdZBAVK9Ka4qhXR2K3J0DS08vcGVwzDtXSuUMabLv4KtPcpSKkcMXFDViw==} ->>>>>>> next peerDependencies: vitest: '>=0.32.0 <1' dependencies: @@ -1540,29 +1458,11 @@ packages: std-env: 3.4.3 test-exclude: 6.0.0 v8-to-istanbul: 9.1.0 -<<<<<<< HEAD - vitest: 0.34.5(@vitest/ui@0.34.5) -======= vitest: 0.34.6(@vitest/ui@0.34.7) ->>>>>>> next transitivePeerDependencies: - supports-color dev: true -<<<<<<< HEAD - /@vitest/expect@0.34.5: - resolution: {integrity: sha512-/3RBIV9XEH+nRpRMqDJBufKIOQaYUH2X6bt0rKSCW0MfKhXFLYsR5ivHifeajRSTsln0FwJbitxLKHSQz/Xwkw==} - dependencies: - '@vitest/spy': 0.34.5 - '@vitest/utils': 0.34.5 - chai: 4.3.8 - dev: true - - /@vitest/runner@0.34.5: - resolution: {integrity: sha512-RDEE3ViVvl7jFSCbnBRyYuu23XxmvRTSZWW6W4M7eC5dOsK75d5LIf6uhE5Fqf809DQ1+9ICZZNxhIolWHU4og==} - dependencies: - '@vitest/utils': 0.34.5 -======= /@vitest/expect@0.34.6: resolution: {integrity: sha512-QUzKpUQRc1qC7qdGo7rMK3AkETI7w18gTCUrsNnyjjJKYiuUB9+TQK3QnR1unhCnWRC0AbKv2omLGQDF/mIjOw==} dependencies: @@ -1575,63 +1475,36 @@ packages: resolution: {integrity: sha512-1CUQgtJSLF47NnhN+F9X2ycxUP0kLHQ/JWvNHbeBfwW8CzEGgeskzNnHDyv1ieKTltuR6sdIHV+nmR6kPxQqzQ==} dependencies: '@vitest/utils': 0.34.6 ->>>>>>> next p-limit: 4.0.0 pathe: 1.1.1 dev: true -<<<<<<< HEAD - /@vitest/snapshot@0.34.5: - resolution: {integrity: sha512-+ikwSbhu6z2yOdtKmk/aeoDZ9QPm2g/ZO5rXT58RR9Vmu/kB2MamyDSx77dctqdZfP3Diqv4mbc/yw2kPT8rmA==} -======= /@vitest/snapshot@0.34.6: resolution: {integrity: sha512-B3OZqYn6k4VaN011D+ve+AA4whM4QkcwcrwaKwAbyyvS/NB1hCWjFIBQxAQQSQir9/RtyAAGuq+4RJmbn2dH4w==} ->>>>>>> next dependencies: magic-string: 0.30.3 pathe: 1.1.1 pretty-format: 29.7.0 dev: true -<<<<<<< HEAD - /@vitest/spy@0.34.5: - resolution: {integrity: sha512-epsicsfhvBjRjCMOC/3k00mP/TBGQy8/P0DxOFiWyLt55gnZ99dqCfCiAsKO17BWVjn4eZRIjKvcqNmSz8gvmg==} -======= /@vitest/spy@0.34.6: resolution: {integrity: sha512-xaCvneSaeBw/cz8ySmF7ZwGvL0lBjfvqc1LpQ/vcdHEvpLn3Ff1vAvjw+CoGn0802l++5L/pxb7whwcWAw+DUQ==} ->>>>>>> next dependencies: tinyspy: 2.1.1 dev: true -<<<<<<< HEAD - /@vitest/ui@0.34.5(vitest@0.34.5): - resolution: {integrity: sha512-nK3Ny7fQgoTJMCGXLzYL0oo1ePtruRM9eYT1Y8esQx8fHj05davqVgqWv4Kd+Yy8PfzyrduTx1EYBdSMIbQh8A==} - peerDependencies: - vitest: '>=0.30.1 <1' - dependencies: - '@vitest/utils': 0.34.5 -======= /@vitest/ui@0.34.7(vitest@0.34.6): resolution: {integrity: sha512-iizUu9R5Rsvsq8FtdJ0suMqEfIsIIzziqnasMHe4VH8vG+FnZSA3UAtCHx6rLeRupIFVAVg7bptMmuvMcsn8WQ==} peerDependencies: vitest: '>=0.30.1 <1' dependencies: '@vitest/utils': 0.34.7 ->>>>>>> next fast-glob: 3.3.1 fflate: 0.8.1 flatted: 3.2.9 pathe: 1.1.1 picocolors: 1.0.0 sirv: 2.0.3 -<<<<<<< HEAD - vitest: 0.34.5(@vitest/ui@0.34.5) - dev: true - - /@vitest/utils@0.34.5: - resolution: {integrity: sha512-ur6CmmYQoeHMwmGb0v+qwkwN3yopZuZyf4xt1DBBSGBed8Hf9Gmbm/5dEWqgpLPdRx6Av6jcWXrjcKfkTzg/pw==} -======= vitest: 0.34.6(@vitest/ui@0.34.7) dev: true @@ -1645,7 +1518,6 @@ packages: /@vitest/utils@0.34.7: resolution: {integrity: sha512-ziAavQLpCYS9sLOorGrFFKmy2gnfiNU0ZJ15TsMz/K92NAPS/rp9K4z6AJQQk5Y8adCy4Iwpxy7pQumQ/psnRg==} ->>>>>>> next dependencies: diff-sequences: 29.6.3 loupe: 2.3.6 @@ -2659,7 +2531,7 @@ packages: dependencies: '@cypress/request': 3.0.1 '@cypress/xvfb': 1.2.4(supports-color@8.1.1) - '@types/node': 18.17.19 + '@types/node': 18.17.17 '@types/sinonjs__fake-timers': 8.1.1 '@types/sizzle': 2.3.3 arch: 2.2.0 @@ -3133,11 +3005,7 @@ packages: - supports-color dev: true -<<<<<<< HEAD - /eslint-plugin-jsdoc@46.8.2(eslint@8.49.0): -======= /eslint-plugin-jsdoc@46.8.2(eslint@8.50.0): ->>>>>>> next resolution: {integrity: sha512-5TSnD018f3tUJNne4s4gDWQflbsgOycIKEUBoCLn6XtBMgNHxQFmV8vVxUtiPxAQq8lrX85OaSG/2gnctxw9uQ==} engines: {node: '>=16'} peerDependencies: @@ -3178,28 +3046,17 @@ packages: synckit: 0.8.5 dev: true -<<<<<<< HEAD - /eslint-plugin-unicorn@48.0.1(eslint@8.49.0): -======= /eslint-plugin-unicorn@48.0.1(eslint@8.50.0): ->>>>>>> next resolution: {integrity: sha512-FW+4r20myG/DqFcCSzoumaddKBicIPeFnTrifon2mWIzlfyvzwyqZjqVP7m4Cqr/ZYisS2aiLghkUWaPg6vtCw==} engines: {node: '>=16'} peerDependencies: eslint: '>=8.44.0' dependencies: '@babel/helper-validator-identifier': 7.22.20 -<<<<<<< HEAD - '@eslint-community/eslint-utils': 4.4.0(eslint@8.49.0) - ci-info: 3.8.0 - clean-regexp: 1.0.0 - eslint: 8.49.0 -======= '@eslint-community/eslint-utils': 4.4.0(eslint@8.50.0) ci-info: 3.8.0 clean-regexp: 1.0.0 eslint: 8.50.0 ->>>>>>> next esquery: 1.5.0 indent-string: 4.0.0 is-builtin-module: 3.2.1 @@ -3213,11 +3070,7 @@ packages: strip-indent: 3.0.0 dev: true -<<<<<<< HEAD - /eslint-plugin-vitest@0.3.1(@typescript-eslint/eslint-plugin@6.7.2)(eslint@8.49.0)(vitest@0.34.5): -======= /eslint-plugin-vitest@0.3.1(@typescript-eslint/eslint-plugin@6.7.3)(eslint@8.50.0)(vitest@0.34.6): ->>>>>>> next resolution: {integrity: sha512-GeR3zISHmqUGWK2sfW+eyCZivMqiQYzPf9UttHXBiEyMveS/jkKLHCrHUllwr3Hz1+i0zoseANd2xL0cFha8Eg==} engines: {node: 14.x || >= 16} peerDependencies: @@ -3232,11 +3085,7 @@ packages: '@typescript-eslint/utils': 6.7.2(eslint@8.50.0)(typescript@5.2.2) eslint: 8.50.0 typescript: 5.2.2 -<<<<<<< HEAD - vitest: 0.34.5(@vitest/ui@0.34.5) -======= vitest: 0.34.6(@vitest/ui@0.34.7) ->>>>>>> next transitivePeerDependencies: - supports-color dev: true @@ -3281,7 +3130,7 @@ packages: file-entry-cache: 6.0.1 find-up: 5.0.0 glob-parent: 6.0.2 - globals: 13.22.0 + globals: 13.21.0 graphemer: 1.4.0 ignore: 5.2.4 imurmurhash: 0.1.4 @@ -3739,13 +3588,8 @@ packages: is-glob: 4.0.3 dev: true -<<<<<<< HEAD - /glob@10.3.6: - resolution: {integrity: sha512-mEfImdc/fiYHEcF6pHFfD2b/KrdFB1qH9mRe5vI5HROF8G51SWxQJ2V56Ezl6ZL9y86gsxQ1Lgo2S746KGUPSQ==} -======= /glob@10.3.10: resolution: {integrity: sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==} ->>>>>>> next engines: {node: '>=16 || 14 >=14.17'} hasBin: true dependencies: @@ -3774,8 +3618,8 @@ packages: ini: 2.0.0 dev: true - /globals@13.22.0: - resolution: {integrity: sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==} + /globals@13.21.0: + resolution: {integrity: sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==} engines: {node: '>=8'} dependencies: type-fest: 0.20.2 @@ -5072,13 +4916,8 @@ packages: engines: {node: '>=4'} dev: true -<<<<<<< HEAD - /postcss@8.4.30: - resolution: {integrity: sha512-7ZEao1g4kd68l97aWG/etQKPKq07us0ieSZ2TnFDk11i0ZfDW2AwKHYU8qv4MZKqN2fdBfg+7q0ES06UA73C1g==} -======= /postcss@8.4.31: resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} ->>>>>>> next engines: {node: ^10 || ^12 || >=14} dependencies: nanoid: 3.3.6 @@ -5364,11 +5203,7 @@ packages: engines: {node: '>=14'} hasBin: true dependencies: -<<<<<<< HEAD - glob: 10.3.6 -======= glob: 10.3.10 ->>>>>>> next dev: true /rollup@3.29.2: @@ -6202,13 +6037,8 @@ packages: extsprintf: 1.3.0 dev: true -<<<<<<< HEAD - /vite-node@0.34.5(@types/node@20.6.4): - resolution: {integrity: sha512-RNZ+DwbCvDoI5CbCSQSyRyzDTfFvFauvMs6Yq4ObJROKlIKuat1KgSX/Ako5rlDMfVCyMcpMRMTkJBxd6z8YRA==} -======= /vite-node@0.34.6(@types/node@20.8.0): resolution: {integrity: sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==} ->>>>>>> next engines: {node: '>=v14.18.0'} hasBin: true dependencies: @@ -6217,11 +6047,7 @@ packages: mlly: 1.4.2 pathe: 1.1.1 picocolors: 1.0.0 -<<<<<<< HEAD - vite: 4.4.9(@types/node@20.6.4) -======= vite: 4.4.9(@types/node@20.8.0) ->>>>>>> next transitivePeerDependencies: - '@types/node' - less @@ -6233,11 +6059,7 @@ packages: - terser dev: true -<<<<<<< HEAD - /vite@4.4.9(@types/node@20.6.4): -======= /vite@4.4.9(@types/node@20.8.0): ->>>>>>> next resolution: {integrity: sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -6265,11 +6087,7 @@ packages: terser: optional: true dependencies: -<<<<<<< HEAD - '@types/node': 20.6.4 -======= '@types/node': 20.8.0 ->>>>>>> next esbuild: 0.18.20 postcss: 8.4.31 rollup: 3.29.2 @@ -6277,11 +6095,7 @@ packages: fsevents: 2.3.3 dev: true -<<<<<<< HEAD - /vitepress@1.0.0-beta.7(@algolia/client-search@4.19.1)(@types/node@20.6.4)(search-insights@2.8.2): -======= /vitepress@1.0.0-beta.7(@algolia/client-search@4.19.1)(@types/node@20.8.0)(search-insights@2.8.2): ->>>>>>> next resolution: {integrity: sha512-P9Rw+FXatKIU4fVdtKxqwHl6fby8E/8zE3FIfep6meNgN4BxbWqoKJ6yfuuQQR9IrpQqwnyaBh4LSabyll6tWg==} hasBin: true dependencies: @@ -6296,11 +6110,7 @@ packages: mark.js: 8.11.1 minisearch: 6.1.0 shiki: 0.14.4 -<<<<<<< HEAD - vite: 4.4.9(@types/node@20.6.4) -======= vite: 4.4.9(@types/node@20.8.0) ->>>>>>> next vue: 3.3.4 transitivePeerDependencies: - '@algolia/client-search' @@ -6329,13 +6139,8 @@ packages: - universal-cookie dev: true -<<<<<<< HEAD - /vitest@0.34.5(@vitest/ui@0.34.5): - resolution: {integrity: sha512-CPI68mmnr2DThSB3frSuE5RLm9wo5wU4fbDrDwWQQB1CWgq9jQVoQwnQSzYAjdoBOPoH2UtXpOgHVge/uScfZg==} -======= /vitest@0.34.6(@vitest/ui@0.34.7): resolution: {integrity: sha512-+5CALsOvbNKnS+ZHMXtuUC7nL8/7F1F2DnHGjSsszX8zCjWSSviphCb/NuS9Nzf4Q03KyyDRBAXhF/8lffME4Q==} ->>>>>>> next engines: {node: '>=v14.18.0'} hasBin: true peerDependencies: @@ -6367,15 +6172,6 @@ packages: dependencies: '@types/chai': 4.3.6 '@types/chai-subset': 1.3.3 -<<<<<<< HEAD - '@types/node': 20.6.4 - '@vitest/expect': 0.34.5 - '@vitest/runner': 0.34.5 - '@vitest/snapshot': 0.34.5 - '@vitest/spy': 0.34.5 - '@vitest/ui': 0.34.5(vitest@0.34.5) - '@vitest/utils': 0.34.5 -======= '@types/node': 20.8.0 '@vitest/expect': 0.34.6 '@vitest/runner': 0.34.6 @@ -6383,7 +6179,6 @@ packages: '@vitest/spy': 0.34.6 '@vitest/ui': 0.34.7(vitest@0.34.6) '@vitest/utils': 0.34.6 ->>>>>>> next acorn: 8.10.0 acorn-walk: 8.2.0 cac: 6.7.14 @@ -6397,13 +6192,8 @@ packages: strip-literal: 1.3.0 tinybench: 2.5.1 tinypool: 0.7.0 -<<<<<<< HEAD - vite: 4.4.9(@types/node@20.6.4) - vite-node: 0.34.5(@types/node@20.6.4) -======= vite: 4.4.9(@types/node@20.8.0) vite-node: 0.34.6(@types/node@20.8.0) ->>>>>>> next why-is-node-running: 2.2.2 transitivePeerDependencies: - less From 422895bda4481b373e63d1a83c1cd8e4f33c659c Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Sun, 8 Oct 2023 00:42:11 +0200 Subject: [PATCH 4/5] test: simplify system.cron test --- test/modules/system.spec.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/modules/system.spec.ts b/test/modules/system.spec.ts index 12983ad86b0..b2203dd3155 100644 --- a/test/modules/system.spec.ts +++ b/test/modules/system.spec.ts @@ -405,13 +405,11 @@ describe('system', () => { ); it('should be able to return non-standard cron expressions', () => { - const validResults = [...'0123456789', '*', '@']; + const validResults = new Set('0123456789*@'); expect( faker.system.cron({ includeNonStandard: true })[0], 'generated cron, string should contain standard or non-standard cron labels' - ).toSatisfy( - (value) => !!validResults.find((result) => value === result) - ); + ).toSatisfy((value: string) => validResults.has(value)); }); }); } From 9491a1183332a8b4b2d40d9c74a31742d1397880 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Sun, 8 Oct 2023 00:48:50 +0200 Subject: [PATCH 5/5] chore: simplify color.toBinary --- src/modules/color/index.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/modules/color/index.ts b/src/modules/color/index.ts index 57debf8edf7..5855cd862e3 100644 --- a/src/modules/color/index.ts +++ b/src/modules/color/index.ts @@ -86,9 +86,7 @@ function toBinary(values: number[]): string { const buffer = new ArrayBuffer(4); new DataView(buffer).setFloat32(0, value); const bytes = new Uint8Array(buffer); - return toBinary([...bytes]) - .split(' ') - .join(''); + return toBinary([...bytes]).replace(/ /g, ''); } return (value >>> 0).toString(2).padStart(8, '0');