From 5efa88fc93a43bc866315605e0e8870a93826ea4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 12:12:06 -0400 Subject: [PATCH 1/4] chore(deps): update typescript-eslint to ~6.7.5 (#2481) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 4 +- pnpm-lock.yaml | 109 +++++++++++-------------------------------------- 2 files changed, 26 insertions(+), 87 deletions(-) diff --git a/package.json b/package.json index 9428c6699d9..c4d0f695be4 100644 --- a/package.json +++ b/package.json @@ -94,8 +94,8 @@ "@types/sanitize-html": "~2.9.1", "@types/semver": "~7.5.3", "@types/validator": "~13.11.2", - "@typescript-eslint/eslint-plugin": "~6.7.4", - "@typescript-eslint/parser": "~6.7.4", + "@typescript-eslint/eslint-plugin": "~6.7.5", + "@typescript-eslint/parser": "~6.7.5", "@vitest/coverage-v8": "~0.34.6", "@vitest/ui": "~0.34.7", "@vueuse/core": "~10.5.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8b3ab030644..2b608ccfcfb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,11 +23,11 @@ devDependencies: specifier: ~13.11.2 version: 13.11.2 '@typescript-eslint/eslint-plugin': - specifier: ~6.7.4 - version: 6.7.4(@typescript-eslint/parser@6.7.4)(eslint@8.51.0)(typescript@4.9.5) + specifier: ~6.7.5 + version: 6.7.5(@typescript-eslint/parser@6.7.5)(eslint@8.51.0)(typescript@4.9.5) '@typescript-eslint/parser': - specifier: ~6.7.4 - version: 6.7.4(eslint@8.51.0)(typescript@4.9.5) + specifier: ~6.7.5 + version: 6.7.5(eslint@8.51.0)(typescript@4.9.5) '@vitest/coverage-v8': specifier: ~0.34.6 version: 0.34.6(vitest@0.34.6) @@ -72,7 +72,7 @@ devDependencies: version: 48.0.1(eslint@8.51.0) eslint-plugin-vitest: specifier: ~0.3.2 - version: 0.3.2(@typescript-eslint/eslint-plugin@6.7.4)(eslint@8.51.0)(typescript@4.9.5)(vitest@0.34.6) + version: 0.3.2(@typescript-eslint/eslint-plugin@6.7.5)(eslint@8.51.0)(typescript@4.9.5)(vitest@0.34.6) glob: specifier: ~10.3.10 version: 10.3.10 @@ -1205,8 +1205,8 @@ packages: dev: true optional: true - /@typescript-eslint/eslint-plugin@6.7.4(@typescript-eslint/parser@6.7.4)(eslint@8.51.0)(typescript@4.9.5): - resolution: {integrity: sha512-DAbgDXwtX+pDkAHwiGhqP3zWUGpW49B7eqmgpPtg+BKJXwdct79ut9+ifqOFPJGClGKSHXn2PTBatCnldJRUoA==} + /@typescript-eslint/eslint-plugin@6.7.5(@typescript-eslint/parser@6.7.5)(eslint@8.51.0)(typescript@4.9.5): + resolution: {integrity: sha512-JhtAwTRhOUcP96D0Y6KYnwig/MRQbOoLGXTON2+LlyB/N35SP9j1boai2zzwXb7ypKELXMx3DVk9UTaEq1vHEw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha @@ -1217,11 +1217,11 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.9.1 - '@typescript-eslint/parser': 6.7.4(eslint@8.51.0)(typescript@4.9.5) - '@typescript-eslint/scope-manager': 6.7.4 - '@typescript-eslint/type-utils': 6.7.4(eslint@8.51.0)(typescript@4.9.5) - '@typescript-eslint/utils': 6.7.4(eslint@8.51.0)(typescript@4.9.5) - '@typescript-eslint/visitor-keys': 6.7.4 + '@typescript-eslint/parser': 6.7.5(eslint@8.51.0)(typescript@4.9.5) + '@typescript-eslint/scope-manager': 6.7.5 + '@typescript-eslint/type-utils': 6.7.5(eslint@8.51.0)(typescript@4.9.5) + '@typescript-eslint/utils': 6.7.5(eslint@8.51.0)(typescript@4.9.5) + '@typescript-eslint/visitor-keys': 6.7.5 debug: 4.3.4(supports-color@8.1.1) eslint: 8.51.0 graphemer: 1.4.0 @@ -1234,8 +1234,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@6.7.4(eslint@8.51.0)(typescript@4.9.5): - resolution: {integrity: sha512-I5zVZFY+cw4IMZUeNCU7Sh2PO5O57F7Lr0uyhgCJmhN/BuTlnc55KxPonR4+EM3GBdfiCyGZye6DgMjtubQkmA==} + /@typescript-eslint/parser@6.7.5(eslint@8.51.0)(typescript@4.9.5): + resolution: {integrity: sha512-bIZVSGx2UME/lmhLcjdVc7ePBwn7CLqKarUBL4me1C5feOd663liTGjMBGVcGr+BhnSLeP4SgwdvNnnkbIdkCw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -1244,10 +1244,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 6.7.4 - '@typescript-eslint/types': 6.7.4 - '@typescript-eslint/typescript-estree': 6.7.4(typescript@4.9.5) - '@typescript-eslint/visitor-keys': 6.7.4 + '@typescript-eslint/scope-manager': 6.7.5 + '@typescript-eslint/types': 6.7.5 + '@typescript-eslint/typescript-estree': 6.7.5(typescript@4.9.5) + '@typescript-eslint/visitor-keys': 6.7.5 debug: 4.3.4(supports-color@8.1.1) eslint: 8.51.0 typescript: 4.9.5 @@ -1255,14 +1255,6 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager@6.7.4: - resolution: {integrity: sha512-SdGqSLUPTXAXi7c3Ob7peAGVnmMoGzZ361VswK2Mqf8UOYcODiYvs8rs5ILqEdfvX1lE7wEZbLyELCW+Yrql1A==} - engines: {node: ^16.0.0 || >=18.0.0} - dependencies: - '@typescript-eslint/types': 6.7.4 - '@typescript-eslint/visitor-keys': 6.7.4 - dev: true - /@typescript-eslint/scope-manager@6.7.5: resolution: {integrity: sha512-GAlk3eQIwWOJeb9F7MKQ6Jbah/vx1zETSDw8likab/eFcqkjSD7BI75SDAeC5N2L0MmConMoPvTsmkrg71+B1A==} engines: {node: ^16.0.0 || >=18.0.0} @@ -1271,8 +1263,8 @@ packages: '@typescript-eslint/visitor-keys': 6.7.5 dev: true - /@typescript-eslint/type-utils@6.7.4(eslint@8.51.0)(typescript@4.9.5): - resolution: {integrity: sha512-n+g3zi1QzpcAdHFP9KQF+rEFxMb2KxtnJGID3teA/nxKHOVi3ylKovaqEzGBbVY2pBttU6z85gp0D00ufLzViQ==} + /@typescript-eslint/type-utils@6.7.5(eslint@8.51.0)(typescript@4.9.5): + resolution: {integrity: sha512-Gs0qos5wqxnQrvpYv+pf3XfcRXW6jiAn9zE/K+DlmYf6FcpxeNYN0AIETaPR7rHO4K2UY+D0CIbDP9Ut0U4m1g==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -1281,8 +1273,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.7.4(typescript@4.9.5) - '@typescript-eslint/utils': 6.7.4(eslint@8.51.0)(typescript@4.9.5) + '@typescript-eslint/typescript-estree': 6.7.5(typescript@4.9.5) + '@typescript-eslint/utils': 6.7.5(eslint@8.51.0)(typescript@4.9.5) debug: 4.3.4(supports-color@8.1.1) eslint: 8.51.0 ts-api-utils: 1.0.3(typescript@4.9.5) @@ -1291,37 +1283,11 @@ packages: - supports-color dev: true - /@typescript-eslint/types@6.7.4: - resolution: {integrity: sha512-o9XWK2FLW6eSS/0r/tgjAGsYasLAnOWg7hvZ/dGYSSNjCh+49k5ocPN8OmG5aZcSJ8pclSOyVKP2x03Sj+RrCA==} - engines: {node: ^16.0.0 || >=18.0.0} - dev: true - /@typescript-eslint/types@6.7.5: resolution: {integrity: sha512-WboQBlOXtdj1tDFPyIthpKrUb+kZf2VroLZhxKa/VlwLlLyqv/PwUNgL30BlTVZV1Wu4Asu2mMYPqarSO4L5ZQ==} engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/typescript-estree@6.7.4(typescript@4.9.5): - resolution: {integrity: sha512-ty8b5qHKatlNYd9vmpHooQz3Vki3gG+3PchmtsA4TgrZBKWHNjWfkQid7K7xQogBqqc7/BhGazxMD5vr6Ha+iQ==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 6.7.4 - '@typescript-eslint/visitor-keys': 6.7.4 - debug: 4.3.4(supports-color@8.1.1) - globby: 11.1.0 - is-glob: 4.0.3 - semver: 7.5.4 - ts-api-utils: 1.0.3(typescript@4.9.5) - typescript: 4.9.5 - transitivePeerDependencies: - - supports-color - dev: true - /@typescript-eslint/typescript-estree@6.7.5(typescript@4.9.5): resolution: {integrity: sha512-NhJiJ4KdtwBIxrKl0BqG1Ur+uw7FiOnOThcYx9DpOGJ/Abc9z2xNzLeirCG02Ig3vkvrc2qFLmYSSsaITbKjlg==} engines: {node: ^16.0.0 || >=18.0.0} @@ -1343,25 +1309,6 @@ packages: - supports-color dev: true - /@typescript-eslint/utils@6.7.4(eslint@8.51.0)(typescript@4.9.5): - resolution: {integrity: sha512-PRQAs+HUn85Qdk+khAxsVV+oULy3VkbH3hQ8hxLRJXWBEd7iI+GbQxH5SEUSH7kbEoTp6oT1bOwyga24ELALTA==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.51.0) - '@types/json-schema': 7.0.13 - '@types/semver': 7.5.3 - '@typescript-eslint/scope-manager': 6.7.4 - '@typescript-eslint/types': 6.7.4 - '@typescript-eslint/typescript-estree': 6.7.4(typescript@4.9.5) - eslint: 8.51.0 - semver: 7.5.4 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - /@typescript-eslint/utils@6.7.5(eslint@8.51.0)(typescript@4.9.5): resolution: {integrity: sha512-pfRRrH20thJbzPPlPc4j0UNGvH1PjPlhlCMq4Yx7EGjV7lvEeGX0U6MJYe8+SyFutWgSHsdbJ3BXzZccYggezA==} engines: {node: ^16.0.0 || >=18.0.0} @@ -1381,14 +1328,6 @@ packages: - typescript dev: true - /@typescript-eslint/visitor-keys@6.7.4: - resolution: {integrity: sha512-pOW37DUhlTZbvph50x5zZCkFn3xzwkGtNoJHzIM3svpiSkJzwOYr/kVBaXmf+RAQiUDs1AHEZVNPg6UJCJpwRA==} - engines: {node: ^16.0.0 || >=18.0.0} - dependencies: - '@typescript-eslint/types': 6.7.4 - eslint-visitor-keys: 3.4.3 - dev: true - /@typescript-eslint/visitor-keys@6.7.5: resolution: {integrity: sha512-3MaWdDZtLlsexZzDSdQWsFQ9l9nL8B80Z4fImSpyllFC/KLqWQRdEcB+gGGO+N3Q2uL40EsG66wZLsohPxNXvg==} engines: {node: ^16.0.0 || >=18.0.0} @@ -3036,7 +2975,7 @@ packages: strip-indent: 3.0.0 dev: true - /eslint-plugin-vitest@0.3.2(@typescript-eslint/eslint-plugin@6.7.4)(eslint@8.51.0)(typescript@4.9.5)(vitest@0.34.6): + /eslint-plugin-vitest@0.3.2(@typescript-eslint/eslint-plugin@6.7.5)(eslint@8.51.0)(typescript@4.9.5)(vitest@0.34.6): resolution: {integrity: sha512-A1P0qJVkqHyfDolwm09h8/gu7SbGFOKbacJSeyZ9IRb8uyddgqLcqv4VrqgQfLA7QmGI9lwj1iV90NyZ1cHp8Q==} engines: {node: 14.x || >= 16} peerDependencies: @@ -3047,7 +2986,7 @@ packages: '@typescript-eslint/eslint-plugin': optional: true dependencies: - '@typescript-eslint/eslint-plugin': 6.7.4(@typescript-eslint/parser@6.7.4)(eslint@8.51.0)(typescript@4.9.5) + '@typescript-eslint/eslint-plugin': 6.7.5(@typescript-eslint/parser@6.7.5)(eslint@8.51.0)(typescript@4.9.5) '@typescript-eslint/utils': 6.7.5(eslint@8.51.0)(typescript@4.9.5) eslint: 8.51.0 vitest: 0.34.6(@vitest/ui@0.34.7) From cd37154b00d9a9dc937f930b4a01d68644be6b12 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 12:23:27 -0400 Subject: [PATCH 2/4] chore(deps): update devdependencies (#2480) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 10 +++---- pnpm-lock.yaml | 74 +++++++++++++++++++++++++++----------------------- 2 files changed, 45 insertions(+), 39 deletions(-) diff --git a/package.json b/package.json index c4d0f695be4..cba7aeb63b3 100644 --- a/package.json +++ b/package.json @@ -90,17 +90,17 @@ "@actions/github": "~5.1.1", "@algolia/client-search": "~4.19.1", "@types/markdown-it": "~13.0.2", - "@types/node": "~20.8.3", - "@types/sanitize-html": "~2.9.1", + "@types/node": "~20.8.6", + "@types/sanitize-html": "~2.9.2", "@types/semver": "~7.5.3", - "@types/validator": "~13.11.2", + "@types/validator": "~13.11.3", "@typescript-eslint/eslint-plugin": "~6.7.5", "@typescript-eslint/parser": "~6.7.5", "@vitest/coverage-v8": "~0.34.6", "@vitest/ui": "~0.34.7", "@vueuse/core": "~10.5.0", "conventional-changelog-cli": "~4.1.0", - "cypress": "~13.3.0", + "cypress": "~13.3.1", "esbuild": "~0.19.4", "eslint": "~8.51.0", "eslint-config-prettier": "~9.0.0", @@ -108,7 +108,7 @@ "eslint-gitignore": "~0.1.0", "eslint-plugin-deprecation": "~2.0.0", "eslint-plugin-jsdoc": "~46.8.2", - "eslint-plugin-prettier": "~5.0.0", + "eslint-plugin-prettier": "~5.0.1", "eslint-plugin-unicorn": "~48.0.1", "eslint-plugin-vitest": "~0.3.2", "glob": "~10.3.10", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2b608ccfcfb..5083c40f337 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,17 +11,17 @@ devDependencies: specifier: ~13.0.2 version: 13.0.2 '@types/node': - specifier: ~20.8.3 - version: 20.8.3 + specifier: ~20.8.6 + version: 20.8.6 '@types/sanitize-html': - specifier: ~2.9.1 - version: 2.9.1 + specifier: ~2.9.2 + version: 2.9.2 '@types/semver': specifier: ~7.5.3 version: 7.5.3 '@types/validator': - specifier: ~13.11.2 - version: 13.11.2 + specifier: ~13.11.3 + version: 13.11.3 '@typescript-eslint/eslint-plugin': specifier: ~6.7.5 version: 6.7.5(@typescript-eslint/parser@6.7.5)(eslint@8.51.0)(typescript@4.9.5) @@ -41,8 +41,8 @@ devDependencies: specifier: ~4.1.0 version: 4.1.0 cypress: - specifier: ~13.3.0 - version: 13.3.0 + specifier: ~13.3.1 + version: 13.3.1 esbuild: specifier: ~0.19.4 version: 0.19.4 @@ -65,8 +65,8 @@ devDependencies: specifier: ~46.8.2 version: 46.8.2(eslint@8.51.0) eslint-plugin-prettier: - specifier: ~5.0.0 - version: 5.0.0(eslint-config-prettier@9.0.0)(eslint@8.51.0)(prettier@3.0.3) + specifier: ~5.0.1 + version: 5.0.1(eslint-config-prettier@9.0.0)(eslint@8.51.0)(prettier@3.0.3) eslint-plugin-unicorn: specifier: ~48.0.1 version: 48.0.1(eslint@8.51.0) @@ -111,10 +111,10 @@ devDependencies: version: 13.11.0 vite: specifier: ~4.4.11 - version: 4.4.11(@types/node@20.8.3) + version: 4.4.11(@types/node@20.8.6) vitepress: specifier: 1.0.0-beta.7 - version: 1.0.0-beta.7(@algolia/client-search@4.19.1)(@types/node@20.8.3)(search-insights@2.9.0) + version: 1.0.0-beta.7(@algolia/client-search@4.19.1)(@types/node@20.8.6)(search-insights@2.9.0) vitest: specifier: ~0.34.6 version: 0.34.6(@vitest/ui@0.34.7) @@ -1163,16 +1163,18 @@ packages: resolution: {integrity: sha512-4slmbtwV59ZxitY4ixUZdy1uRLf9eSIvBWPQxNjhHYWEtn0FryfKpyS2cvADYXTayWdKEIsJengncrVvkI4I6A==} dev: true - /@types/node@20.8.3: - resolution: {integrity: sha512-jxiZQFpb+NlH5kjW49vXxvxTjeeqlbsnTAdBTKpzEdPs9itay7MscYXz3Fo9VYFEsfQ6LJFitHad3faerLAjCw==} + /@types/node@20.8.6: + resolution: {integrity: sha512-eWO4K2Ji70QzKUqRy6oyJWUeB7+g2cRagT3T/nxYibYcT4y2BDL8lqolRXjTHmkZCdJfIPaY73KbJAZmcryxTQ==} + dependencies: + undici-types: 5.25.3 dev: true /@types/normalize-package-data@2.4.2: resolution: {integrity: sha512-lqa4UEhhv/2sjjIQgjX8B+RBjj47eo0mzGasklVJ78UKGQY1r0VpB9XHDaZZO9qzEFDdy4MrXLuEaSmPrPSe/A==} dev: true - /@types/sanitize-html@2.9.1: - resolution: {integrity: sha512-XSLD0a9P8c+rKUM09KIi5Nd8mOHLHNgXb1G04rpXWa/GqQVpM+knrS9KR9ptj1CeC3gXWGZn75ApH3H6qNbhYA==} + /@types/sanitize-html@2.9.2: + resolution: {integrity: sha512-7TAQFoXdwjSvebOl0oKh5QXGrI+uyTc8Here+WcR9vpLEE7wxpoK6Vuvw++dsmL+Yw8K91x76tLoWchD5pqpRg==} dependencies: htmlparser2: 8.0.2 dev: true @@ -1189,8 +1191,8 @@ packages: resolution: {integrity: sha512-jA2llq2zNkg8HrALI7DtWzhALcVH0l7i89yhY3iBdOz6cBPeACoFq+fkQrjHA39t1hnSFOboZ7A/AY5MMZSlag==} dev: true - /@types/validator@13.11.2: - resolution: {integrity: sha512-nIKVVQKT6kGKysnNt+xLobr+pFJNssJRi2s034wgWeFBUx01fI8BeHTW2TcRp7VcFu9QCYG8IlChTuovcm0oKQ==} + /@types/validator@13.11.3: + resolution: {integrity: sha512-jxjhh33aTYDHnrV1vZ3AvWQHfrGx2f5UxKjaP13l5q04fG+/hCKKm0MfodIoCqxevhbcfBb6ZjynyHuQ/jueGQ==} dev: true /@types/web-bluetooth@0.0.18: @@ -1201,7 +1203,7 @@ packages: resolution: {integrity: sha512-CHzgNU3qYBnp/O4S3yv2tXPlvMTq0YWSTVg2/JYLqWZGHwwgJGAwd00poay/11asPq8wLFwHzubyInqHIFmmiw==} requiresBuild: true dependencies: - '@types/node': 20.8.3 + '@types/node': 20.8.6 dev: true optional: true @@ -1343,7 +1345,7 @@ packages: vite: ^4.0.0 vue: ^3.2.25 dependencies: - vite: 4.4.11(@types/node@20.8.3) + vite: 4.4.11(@types/node@20.8.6) vue: 3.3.4 dev: true @@ -2428,8 +2430,8 @@ packages: resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} dev: true - /cypress@13.3.0: - resolution: {integrity: sha512-mpI8qcTwLGiA4zEQvTC/U1xGUezVV4V8HQCOYjlEOrVmU1etVvxOjkCXHGwrlYdZU/EPmUiWfsO3yt1o+Q2bgw==} + /cypress@13.3.1: + resolution: {integrity: sha512-g4mJLZxYN+UAF2LMy3Znd4LBnUmS59Vynd81VES59RdW48Yt+QtR2cush3melOoVNz0PPbADpWr8DcUx6mif8Q==} engines: {node: ^16.0.0 || ^18.0.0 || >=20.0.0} hasBin: true requiresBuild: true @@ -2930,8 +2932,8 @@ packages: - supports-color dev: true - /eslint-plugin-prettier@5.0.0(eslint-config-prettier@9.0.0)(eslint@8.51.0)(prettier@3.0.3): - resolution: {integrity: sha512-AgaZCVuYDXHUGxj/ZGu1u8H8CYgDY3iG6w5kUFw4AzMVXzB7VvbKgYR4nATIN+OvUrghMbiDLeimVjVY5ilq3w==} + /eslint-plugin-prettier@5.0.1(eslint-config-prettier@9.0.0)(eslint@8.51.0)(prettier@3.0.3): + resolution: {integrity: sha512-m3u5RnR56asrwV/lDC4GHorlW75DsFfmUcjfCYylTUs85dBRnB7VM6xG8eCMJdeDRnppzmxZVf1GEPJvl1JmNg==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: '@types/eslint': '>=8.0.0' @@ -5854,6 +5856,10 @@ packages: which-boxed-primitive: 1.0.2 dev: true + /undici-types@5.25.3: + resolution: {integrity: sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==} + dev: true + /undici@5.26.3: resolution: {integrity: sha512-H7n2zmKEWgOllKkIUkLvFmsJQj062lSm3uA4EYApG8gLuiOM0/go9bIoC3HVaSnfg4xunowDE2i9p8drkXuvDw==} engines: {node: '>=14.0'} @@ -5924,7 +5930,7 @@ packages: dev: true /verror@1.10.0: - resolution: {integrity: sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=} + resolution: {integrity: sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==} engines: {'0': node >=0.6.0} dependencies: assert-plus: 1.0.0 @@ -5932,7 +5938,7 @@ packages: extsprintf: 1.3.0 dev: true - /vite-node@0.34.6(@types/node@20.8.3): + /vite-node@0.34.6(@types/node@20.8.6): resolution: {integrity: sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==} engines: {node: '>=v14.18.0'} hasBin: true @@ -5942,7 +5948,7 @@ packages: mlly: 1.4.2 pathe: 1.1.1 picocolors: 1.0.0 - vite: 4.4.11(@types/node@20.8.3) + vite: 4.4.11(@types/node@20.8.6) transitivePeerDependencies: - '@types/node' - less @@ -5954,7 +5960,7 @@ packages: - terser dev: true - /vite@4.4.11(@types/node@20.8.3): + /vite@4.4.11(@types/node@20.8.6): resolution: {integrity: sha512-ksNZJlkcU9b0lBwAGZGGaZHCMqHsc8OpgtoYhsQ4/I2v5cnpmmmqe5pM4nv/4Hn6G/2GhTdj0DhZh2e+Er1q5A==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -5982,7 +5988,7 @@ packages: terser: optional: true dependencies: - '@types/node': 20.8.3 + '@types/node': 20.8.6 esbuild: 0.18.20 postcss: 8.4.31 rollup: 3.29.4 @@ -5990,7 +5996,7 @@ packages: fsevents: 2.3.3 dev: true - /vitepress@1.0.0-beta.7(@algolia/client-search@4.19.1)(@types/node@20.8.3)(search-insights@2.9.0): + /vitepress@1.0.0-beta.7(@algolia/client-search@4.19.1)(@types/node@20.8.6)(search-insights@2.9.0): resolution: {integrity: sha512-P9Rw+FXatKIU4fVdtKxqwHl6fby8E/8zE3FIfep6meNgN4BxbWqoKJ6yfuuQQR9IrpQqwnyaBh4LSabyll6tWg==} hasBin: true dependencies: @@ -6005,7 +6011,7 @@ packages: mark.js: 8.11.1 minisearch: 6.1.0 shiki: 0.14.5 - vite: 4.4.11(@types/node@20.8.3) + vite: 4.4.11(@types/node@20.8.6) vue: 3.3.4 transitivePeerDependencies: - '@algolia/client-search' @@ -6067,7 +6073,7 @@ packages: dependencies: '@types/chai': 4.3.8 '@types/chai-subset': 1.3.3 - '@types/node': 20.8.3 + '@types/node': 20.8.6 '@vitest/expect': 0.34.6 '@vitest/runner': 0.34.6 '@vitest/snapshot': 0.34.6 @@ -6087,8 +6093,8 @@ packages: strip-literal: 1.3.0 tinybench: 2.5.1 tinypool: 0.7.0 - vite: 4.4.11(@types/node@20.8.3) - vite-node: 0.34.6(@types/node@20.8.3) + vite: 4.4.11(@types/node@20.8.6) + vite-node: 0.34.6(@types/node@20.8.6) why-is-node-running: 2.2.2 transitivePeerDependencies: - less From f3de0f61dc517a4548150fd40498a9df6d4b97e6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 17 Oct 2023 00:16:42 +0200 Subject: [PATCH 3/4] chore(deps): update dependency @actions/github to v6 (#2482) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 139 +++++++++++++++++++------------------------------ 2 files changed, 55 insertions(+), 86 deletions(-) diff --git a/package.json b/package.json index cba7aeb63b3..ce788c37d32 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ "preflight": "pnpm install && run-s generate format lint build test:update-snapshots ts-check" }, "devDependencies": { - "@actions/github": "~5.1.1", + "@actions/github": "~6.0.0", "@algolia/client-search": "~4.19.1", "@types/markdown-it": "~13.0.2", "@types/node": "~20.8.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5083c40f337..e1ed01cc3d2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2,8 +2,8 @@ lockfileVersion: '6.0' devDependencies: '@actions/github': - specifier: ~5.1.1 - version: 5.1.1 + specifier: ~6.0.0 + version: 6.0.0 '@algolia/client-search': specifier: ~4.19.1 version: 4.19.1 @@ -129,15 +129,13 @@ packages: engines: {node: '>=0.10.0'} dev: true - /@actions/github@5.1.1: - resolution: {integrity: sha512-Nk59rMDoJaV+mHCOJPXuvB1zIbomlKS0dmSIqPGxd0enAXBnOfn4VWF+CGtRCwXZG9Epa54tZA7VIRlJDS8A6g==} + /@actions/github@6.0.0: + resolution: {integrity: sha512-alScpSVnYmjNEXboZjarjukQEzgCRmjMv6Xj47fsdnqGS73bjJNDpiiXmp8jr0UZLdUB6d9jW63IcmddUP+l0g==} dependencies: '@actions/http-client': 2.2.0 - '@octokit/core': 3.6.0 - '@octokit/plugin-paginate-rest': 2.21.3(@octokit/core@3.6.0) - '@octokit/plugin-rest-endpoint-methods': 5.16.2(@octokit/core@3.6.0) - transitivePeerDependencies: - - encoding + '@octokit/core': 5.0.1 + '@octokit/plugin-paginate-rest': 9.0.0(@octokit/core@5.0.1) + '@octokit/plugin-rest-endpoint-methods': 10.0.1(@octokit/core@5.0.1) dev: true /@actions/http-client@2.2.0: @@ -1007,92 +1005,90 @@ packages: fastq: 1.15.0 dev: true - /@octokit/auth-token@2.5.0: - resolution: {integrity: sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==} - dependencies: - '@octokit/types': 6.41.0 + /@octokit/auth-token@4.0.0: + resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} + engines: {node: '>= 18'} dev: true - /@octokit/core@3.6.0: - resolution: {integrity: sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==} + /@octokit/core@5.0.1: + resolution: {integrity: sha512-lyeeeZyESFo+ffI801SaBKmCfsvarO+dgV8/0gD8u1d87clbEdWsP5yC+dSj3zLhb2eIf5SJrn6vDz9AheETHw==} + engines: {node: '>= 18'} dependencies: - '@octokit/auth-token': 2.5.0 - '@octokit/graphql': 4.8.0 - '@octokit/request': 5.6.3 - '@octokit/request-error': 2.1.0 - '@octokit/types': 6.41.0 + '@octokit/auth-token': 4.0.0 + '@octokit/graphql': 7.0.2 + '@octokit/request': 8.1.4 + '@octokit/request-error': 5.0.1 + '@octokit/types': 12.0.0 before-after-hook: 2.2.3 universal-user-agent: 6.0.0 - transitivePeerDependencies: - - encoding dev: true - /@octokit/endpoint@6.0.12: - resolution: {integrity: sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==} + /@octokit/endpoint@9.0.1: + resolution: {integrity: sha512-hRlOKAovtINHQPYHZlfyFwaM8OyetxeoC81lAkBy34uLb8exrZB50SQdeW3EROqiY9G9yxQTpp5OHTV54QD+vA==} + engines: {node: '>= 18'} dependencies: - '@octokit/types': 6.41.0 + '@octokit/types': 12.0.0 is-plain-object: 5.0.0 universal-user-agent: 6.0.0 dev: true - /@octokit/graphql@4.8.0: - resolution: {integrity: sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==} + /@octokit/graphql@7.0.2: + resolution: {integrity: sha512-OJ2iGMtj5Tg3s6RaXH22cJcxXRi7Y3EBqbHTBRq+PQAqfaS8f/236fUrWhfSn8P4jovyzqucxme7/vWSSZBX2Q==} + engines: {node: '>= 18'} dependencies: - '@octokit/request': 5.6.3 - '@octokit/types': 6.41.0 + '@octokit/request': 8.1.4 + '@octokit/types': 12.0.0 universal-user-agent: 6.0.0 - transitivePeerDependencies: - - encoding dev: true - /@octokit/openapi-types@12.11.0: - resolution: {integrity: sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ==} + /@octokit/openapi-types@19.0.0: + resolution: {integrity: sha512-PclQ6JGMTE9iUStpzMkwLCISFn/wDeRjkZFIKALpvJQNBGwDoYYi2fFvuHwssoQ1rXI5mfh6jgTgWuddeUzfWw==} dev: true - /@octokit/plugin-paginate-rest@2.21.3(@octokit/core@3.6.0): - resolution: {integrity: sha512-aCZTEf0y2h3OLbrgKkrfFdjRL6eSOo8komneVQJnYecAxIej7Bafor2xhuDJOIFau4pk0i/P28/XgtbyPF0ZHw==} + /@octokit/plugin-paginate-rest@9.0.0(@octokit/core@5.0.1): + resolution: {integrity: sha512-oIJzCpttmBTlEhBmRvb+b9rlnGpmFgDtZ0bB6nq39qIod6A5DP+7RkVLMOixIgRCYSHDTeayWqmiJ2SZ6xgfdw==} + engines: {node: '>= 18'} peerDependencies: - '@octokit/core': '>=2' + '@octokit/core': '>=5' dependencies: - '@octokit/core': 3.6.0 - '@octokit/types': 6.41.0 + '@octokit/core': 5.0.1 + '@octokit/types': 12.0.0 dev: true - /@octokit/plugin-rest-endpoint-methods@5.16.2(@octokit/core@3.6.0): - resolution: {integrity: sha512-8QFz29Fg5jDuTPXVtey05BLm7OB+M8fnvE64RNegzX7U+5NUXcOcnpTIK0YfSHBg8gYd0oxIq3IZTe9SfPZiRw==} + /@octokit/plugin-rest-endpoint-methods@10.0.1(@octokit/core@5.0.1): + resolution: {integrity: sha512-fgS6HPkPvJiz8CCliewLyym9qAx0RZ/LKh3sATaPfM41y/O2wQ4Z9MrdYeGPVh04wYmHFmWiGlKPC7jWVtZXQA==} + engines: {node: '>= 18'} peerDependencies: - '@octokit/core': '>=3' + '@octokit/core': '>=5' dependencies: - '@octokit/core': 3.6.0 - '@octokit/types': 6.41.0 - deprecation: 2.3.1 + '@octokit/core': 5.0.1 + '@octokit/types': 12.0.0 dev: true - /@octokit/request-error@2.1.0: - resolution: {integrity: sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==} + /@octokit/request-error@5.0.1: + resolution: {integrity: sha512-X7pnyTMV7MgtGmiXBwmO6M5kIPrntOXdyKZLigNfQWSEQzVxR4a4vo49vJjTWX70mPndj8KhfT4Dx+2Ng3vnBQ==} + engines: {node: '>= 18'} dependencies: - '@octokit/types': 6.41.0 + '@octokit/types': 12.0.0 deprecation: 2.3.1 once: 1.4.0 dev: true - /@octokit/request@5.6.3: - resolution: {integrity: sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A==} + /@octokit/request@8.1.4: + resolution: {integrity: sha512-M0aaFfpGPEKrg7XoA/gwgRvc9MSXHRO2Ioki1qrPDbl1e9YhjIwVoHE7HIKmv/m3idzldj//xBujcFNqGX6ENA==} + engines: {node: '>= 18'} dependencies: - '@octokit/endpoint': 6.0.12 - '@octokit/request-error': 2.1.0 - '@octokit/types': 6.41.0 + '@octokit/endpoint': 9.0.1 + '@octokit/request-error': 5.0.1 + '@octokit/types': 12.0.0 is-plain-object: 5.0.0 - node-fetch: 2.7.0 universal-user-agent: 6.0.0 - transitivePeerDependencies: - - encoding dev: true - /@octokit/types@6.41.0: - resolution: {integrity: sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==} + /@octokit/types@12.0.0: + resolution: {integrity: sha512-EzD434aHTFifGudYAygnFlS1Tl6KhbTynEWELQXIbTY8Msvb5nEqTZIm7sbPEt4mQYLZwu3zPKVdeIrw0g7ovg==} dependencies: - '@octokit/openapi-types': 12.11.0 + '@octokit/openapi-types': 19.0.0 dev: true /@pkgjs/parseargs@0.11.0: @@ -4452,18 +4448,6 @@ packages: resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} dev: true - /node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - dependencies: - whatwg-url: 5.0.0 - dev: true - /normalize-package-data@2.5.0: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: @@ -5664,10 +5648,6 @@ packages: url-parse: 1.5.10 dev: true - /tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - dev: true - /trim-newlines@3.0.1: resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} engines: {node: '>=8'} @@ -6139,17 +6119,6 @@ packages: '@vue/shared': 3.3.4 dev: true - /webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - dev: true - - /whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - dev: true - /which-boxed-primitive@1.0.2: resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} dependencies: From c0330442be99988db57e9dad12ebdcd3b3a92213 Mon Sep 17 00:00:00 2001 From: Shinigami Date: Tue, 17 Oct 2023 22:03:32 +0200 Subject: [PATCH 4/4] infra(unicorn): prefer-spread (#2421) Co-authored-by: ST-DDT --- .eslintrc.js | 1 - src/internal/merge.ts | 2 +- src/modules/color/index.ts | 2 +- 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 | 6 ++---- 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 | 6 ++---- test/support/seededRuns.ts | 2 +- 16 files changed, 71 insertions(+), 80 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 5f83641a77c..b678af7419c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -70,7 +70,6 @@ module.exports = defineConfig({ 'unicorn/prefer-negative-index': 'off', 'unicorn/prefer-number-properties': 'off', 'unicorn/prefer-optional-catch-binding': 'off', - 'unicorn/prefer-spread': 'off', 'unicorn/prefer-string-slice': 'off', 'unicorn/prefer-ternary': 'off', 'unicorn/prefer-top-level-await': '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..5855cd862e3 100644 --- a/src/modules/color/index.ts +++ b/src/modules/color/index.ts @@ -86,7 +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(Array.from(bytes)).split(' ').join(''); + return toBinary([...bytes]).replace(/ /g, ''); } 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 f4ceaaf4abe..ab0ec5b8b86 100644 --- a/src/modules/helpers/index.ts +++ b/src/modules/helpers/index.ts @@ -704,7 +704,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); } @@ -722,7 +722,7 @@ export class SimpleHelpersModule { // Ignore } - return Array.from(set); + return [...set]; } /** @@ -1003,7 +1003,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 6e8f822f22f..947edfbaab0 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 89fd23f1e82..8a21a39b567 100644 --- a/src/modules/system/index.ts +++ b/src/modules/system/index.ts @@ -159,8 +159,7 @@ export class SystemModule { const typeSet = new Set( Object.keys(mimeTypes).map((key) => key.split('/')[0]) ); - const types = Array.from(typeSet); - return this.faker.helpers.arrayElement(types); + return this.faker.helpers.arrayElement([...typeSet]); } /** @@ -184,8 +183,7 @@ export class SystemModule { const extensionSet = new Set( Object.values(mimeTypes).flatMap(({ extensions }) => extensions) ); - const extensions = Array.from(extensionSet); - return this.faker.helpers.arrayElement(extensions); + return this.faker.helpers.arrayElement([...extensionSet]); } /** 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 be023b152ce..0564a794b08 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 1ce31c3c8dc..b325468d6f8 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'.split(''), '*', '@']; + 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)); }); }); } 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)