From 07b371f6e434001c38249b0a7d914f5475dda6a5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Nov 2022 10:04:47 +0100 Subject: [PATCH 1/6] chore(deps): update doc-dependencies (#1558) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 4 ++-- pnpm-lock.yaml | 30 +++++++++++++++--------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 6f3bdaf0dff..790c2f08c47 100644 --- a/package.json +++ b/package.json @@ -133,12 +133,12 @@ "simple-git-hooks": "~2.8.1", "standard-version": "~9.5.0", "tsx": "~3.11.0", - "typedoc": "~0.23.20", + "typedoc": "~0.23.21", "typedoc-plugin-missing-exports": "~1.0.0", "typescript": "~4.8.4", "validator": "~13.7.0", "vite": "~3.2.3", - "vitepress": "1.0.0-alpha.27", + "vitepress": "1.0.0-alpha.28", "vitest": "~0.25.1", "vue": "~3.2.41" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8bb13bb4074..786b1fdeb85 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -41,12 +41,12 @@ specifiers: simple-git-hooks: ~2.8.1 standard-version: ~9.5.0 tsx: ~3.11.0 - typedoc: ~0.23.20 + typedoc: ~0.23.21 typedoc-plugin-missing-exports: ~1.0.0 typescript: ~4.8.4 validator: ~13.7.0 vite: ~3.2.3 - vitepress: 1.0.0-alpha.27 + vitepress: 1.0.0-alpha.28 vitest: ~0.25.1 vue: ~3.2.41 @@ -91,12 +91,12 @@ devDependencies: simple-git-hooks: 2.8.1 standard-version: 9.5.0 tsx: 3.11.0 - typedoc: 0.23.20_typescript@4.8.4 - typedoc-plugin-missing-exports: 1.0.0_typedoc@0.23.20 + typedoc: 0.23.21_typescript@4.8.4 + typedoc-plugin-missing-exports: 1.0.0_typedoc@0.23.21 typescript: 4.8.4 validator: 13.7.0 vite: 3.2.3_@types+node@18.11.9 - vitepress: 1.0.0-alpha.27_ftj2nf53q7xylmjs4grbzsajkm + vitepress: 1.0.0-alpha.28_ftj2nf53q7xylmjs4grbzsajkm vitest: 0.25.1_@vitest+ui@0.25.1 vue: 3.2.41 @@ -825,8 +825,8 @@ packages: eslint-visitor-keys: 3.3.0 dev: true - /@vitejs/plugin-vue/3.1.2_vite@3.2.3+vue@3.2.41: - resolution: {integrity: sha512-3zxKNlvA3oNaKDYX0NBclgxTQ1xaFdL7PzwF6zj9tGFziKwmBa3Q/6XcJQxudlT81WxDjEhHmevvIC4Orc1LhQ==} + /@vitejs/plugin-vue/3.2.0_vite@3.2.3+vue@3.2.41: + resolution: {integrity: sha512-E0tnaL4fr+qkdCNxJ+Xd0yM31UwMkQje76fsDVBBUCoGOUPexu2VDUYHL8P4CwV+zMvWw6nlRw19OnRKmYAJpw==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: vite: ^3.0.0 @@ -4697,20 +4697,20 @@ packages: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} dev: true - /typedoc-plugin-missing-exports/1.0.0_typedoc@0.23.20: + /typedoc-plugin-missing-exports/1.0.0_typedoc@0.23.21: resolution: {integrity: sha512-7s6znXnuAj1eD9KYPyzVzR1lBF5nwAY8IKccP5sdoO9crG4lpd16RoFpLsh2PccJM+I2NASpr0+/NMka6ThwVA==} peerDependencies: typedoc: 0.22.x || 0.23.x dependencies: - typedoc: 0.23.20_typescript@4.8.4 + typedoc: 0.23.21_typescript@4.8.4 dev: true - /typedoc/0.23.20_typescript@4.8.4: - resolution: {integrity: sha512-nfb4Mx05ZZZXux3zPcLuc7+3TVePDW3jTdEBqXdQzJUyEILxoprgPIiTChbvci9crkqNJG9YESmfCptuh9Gn3g==} + /typedoc/0.23.21_typescript@4.8.4: + resolution: {integrity: sha512-VNE9Jv7BgclvyH9moi2mluneSviD43dCE9pY8RWkO88/DrEgJZk9KpUk7WO468c9WWs/+aG6dOnoH7ccjnErhg==} engines: {node: '>= 14.14'} hasBin: true peerDependencies: - typescript: 4.6.x || 4.7.x || 4.8.x + typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x dependencies: lunr: 2.3.9 marked: 4.1.1 @@ -4841,13 +4841,13 @@ packages: fsevents: 2.3.2 dev: true - /vitepress/1.0.0-alpha.27_ftj2nf53q7xylmjs4grbzsajkm: - resolution: {integrity: sha512-7/PwlIRZANvB2uyi8oi4oMXuH84g2/pAaoymb+ObBCs60m0oVxKMPO28w7R/svqSnnE+bNDOuLzTCXt7gn513g==} + /vitepress/1.0.0-alpha.28_ftj2nf53q7xylmjs4grbzsajkm: + resolution: {integrity: sha512-pvbLssDMgLUN1terajmPlFBxHSDGO4DqwexKbjFyr7LeELerVuwGrG6F2J1hxmwOlbpLd1kHXEDqGm9JX/kTDQ==} hasBin: true dependencies: '@docsearch/css': 3.3.0 '@docsearch/js': 3.3.0_bbqmvyebg44zjqjhzodbnnxkxa - '@vitejs/plugin-vue': 3.1.2_vite@3.2.3+vue@3.2.41 + '@vitejs/plugin-vue': 3.2.0_vite@3.2.3+vue@3.2.41 '@vue/devtools-api': 6.4.5 '@vueuse/core': 9.4.0_vue@3.2.41 body-scroll-lock: 4.0.0-beta.0 From dfac84c94e901f36b877628826adfcf7ae5364d7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Nov 2022 10:29:09 +0100 Subject: [PATCH 2/6] chore(deps): update dependency cypress to v11 (#1562) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 790c2f08c47..b80f2a22a08 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,7 @@ "@vueuse/core": "~9.4.0", "c8": "~7.12.0", "conventional-changelog-cli": "~2.2.2", - "cypress": "~10.11.0", + "cypress": "~11.0.1", "esbuild": "~0.15.13", "eslint": "~8.27.0", "eslint-config-prettier": "~8.5.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 786b1fdeb85..d90fdbed859 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,7 +18,7 @@ specifiers: '@vueuse/core': ~9.4.0 c8: ~7.12.0 conventional-changelog-cli: ~2.2.2 - cypress: ~10.11.0 + cypress: ~11.0.1 esbuild: ~0.15.13 eslint: ~8.27.0 eslint-config-prettier: ~8.5.0 @@ -68,7 +68,7 @@ devDependencies: '@vueuse/core': 9.4.0_vue@3.2.41 c8: 7.12.0 conventional-changelog-cli: 2.2.2 - cypress: 10.11.0 + cypress: 11.0.1 esbuild: 0.15.13 eslint: 8.27.0 eslint-config-prettier: 8.5.0_eslint@8.27.0 @@ -1651,8 +1651,8 @@ packages: resolution: {integrity: sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==} dev: true - /cypress/10.11.0: - resolution: {integrity: sha512-lsaE7dprw5DoXM00skni6W5ElVVLGAdRUUdZjX2dYsGjbY/QnpzWZ95Zom1mkGg0hAaO/QVTZoFVS7Jgr/GUPA==} + /cypress/11.0.1: + resolution: {integrity: sha512-NuEfd0Vim492RJ3m/+bbTZ3OZrqXgfAfuLaZfIQ9D5lKocS3EDr2tyAarZdAhKwLyoh7OJ33jwMeMFIDbzYqog==} engines: {node: '>=12.0.0'} hasBin: true requiresBuild: true From 30f129f3848553492c5c5ac69beed66ce536fc5d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Nov 2022 11:25:06 +0100 Subject: [PATCH 3/6] chore(deps): update typescript-eslint to ~5.42.1 (#1559) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 4 +-- pnpm-lock.yaml | 74 +++++++++++++++++++++++++------------------------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/package.json b/package.json index b80f2a22a08..ba1a15fd3f0 100644 --- a/package.json +++ b/package.json @@ -103,8 +103,8 @@ "@types/sanitize-html": "~2.6.2", "@types/semver": "~7.3.13", "@types/validator": "~13.7.10", - "@typescript-eslint/eslint-plugin": "~5.42.0", - "@typescript-eslint/parser": "~5.42.0", + "@typescript-eslint/eslint-plugin": "~5.42.1", + "@typescript-eslint/parser": "~5.42.1", "@vitest/coverage-c8": "~0.25.1", "@vitest/ui": "~0.25.1", "@vueuse/core": "~9.4.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d90fdbed859..7bf68fb6a20 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,8 +11,8 @@ specifiers: '@types/sanitize-html': ~2.6.2 '@types/semver': ~7.3.13 '@types/validator': ~13.7.10 - '@typescript-eslint/eslint-plugin': ~5.42.0 - '@typescript-eslint/parser': ~5.42.0 + '@typescript-eslint/eslint-plugin': ~5.42.1 + '@typescript-eslint/parser': ~5.42.1 '@vitest/coverage-c8': ~0.25.1 '@vitest/ui': ~0.25.1 '@vueuse/core': ~9.4.0 @@ -61,8 +61,8 @@ devDependencies: '@types/sanitize-html': 2.6.2 '@types/semver': 7.3.13 '@types/validator': 13.7.10 - '@typescript-eslint/eslint-plugin': 5.42.0_ofgjrzjuekeo7s3hdyz2yuzw34 - '@typescript-eslint/parser': 5.42.0_rmayb2veg2btbq6mbmnyivgasy + '@typescript-eslint/eslint-plugin': 5.42.1_2udltptbznfmezdozpdoa2aemq + '@typescript-eslint/parser': 5.42.1_rmayb2veg2btbq6mbmnyivgasy '@vitest/coverage-c8': 0.25.1_@vitest+ui@0.25.1 '@vitest/ui': 0.25.1 '@vueuse/core': 9.4.0_vue@3.2.41 @@ -696,8 +696,8 @@ packages: dev: true optional: true - /@typescript-eslint/eslint-plugin/5.42.0_ofgjrzjuekeo7s3hdyz2yuzw34: - resolution: {integrity: sha512-5TJh2AgL6+wpL8H/GTSjNb4WrjKoR2rqvFxR/DDTqYNk6uXn8BJMEcncLSpMbf/XV1aS0jAjYwn98uvVCiAywQ==} + /@typescript-eslint/eslint-plugin/5.42.1_2udltptbznfmezdozpdoa2aemq: + resolution: {integrity: sha512-LyR6x784JCiJ1j6sH5Y0K6cdExqCCm8DJUTcwG5ThNXJj/G8o5E56u5EdG4SLy+bZAwZBswC+GYn3eGdttBVCg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: '@typescript-eslint/parser': ^5.0.0 @@ -707,10 +707,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.42.0_rmayb2veg2btbq6mbmnyivgasy - '@typescript-eslint/scope-manager': 5.42.0 - '@typescript-eslint/type-utils': 5.42.0_rmayb2veg2btbq6mbmnyivgasy - '@typescript-eslint/utils': 5.42.0_rmayb2veg2btbq6mbmnyivgasy + '@typescript-eslint/parser': 5.42.1_rmayb2veg2btbq6mbmnyivgasy + '@typescript-eslint/scope-manager': 5.42.1 + '@typescript-eslint/type-utils': 5.42.1_rmayb2veg2btbq6mbmnyivgasy + '@typescript-eslint/utils': 5.42.1_rmayb2veg2btbq6mbmnyivgasy debug: 4.3.4 eslint: 8.27.0 ignore: 5.2.0 @@ -723,8 +723,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser/5.42.0_rmayb2veg2btbq6mbmnyivgasy: - resolution: {integrity: sha512-Ixh9qrOTDRctFg3yIwrLkgf33AHyEIn6lhyf5cCfwwiGtkWhNpVKlEZApi3inGQR/barWnY7qY8FbGKBO7p3JA==} + /@typescript-eslint/parser/5.42.1_rmayb2veg2btbq6mbmnyivgasy: + resolution: {integrity: sha512-kAV+NiNBWVQDY9gDJDToTE/NO8BHi4f6b7zTsVAJoTkmB/zlfOpiEVBzHOKtlgTndCKe8vj9F/PuolemZSh50Q==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -733,9 +733,9 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.42.0 - '@typescript-eslint/types': 5.42.0 - '@typescript-eslint/typescript-estree': 5.42.0_typescript@4.8.4 + '@typescript-eslint/scope-manager': 5.42.1 + '@typescript-eslint/types': 5.42.1 + '@typescript-eslint/typescript-estree': 5.42.1_typescript@4.8.4 debug: 4.3.4 eslint: 8.27.0 typescript: 4.8.4 @@ -743,16 +743,16 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager/5.42.0: - resolution: {integrity: sha512-l5/3IBHLH0Bv04y+H+zlcLiEMEMjWGaCX6WyHE5Uk2YkSGAMlgdUPsT/ywTSKgu9D1dmmKMYgYZijObfA39Wow==} + /@typescript-eslint/scope-manager/5.42.1: + resolution: {integrity: sha512-QAZY/CBP1Emx4rzxurgqj3rUinfsh/6mvuKbLNMfJMMKYLRBfweus8brgXF8f64ABkIZ3zdj2/rYYtF8eiuksQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.42.0 - '@typescript-eslint/visitor-keys': 5.42.0 + '@typescript-eslint/types': 5.42.1 + '@typescript-eslint/visitor-keys': 5.42.1 dev: true - /@typescript-eslint/type-utils/5.42.0_rmayb2veg2btbq6mbmnyivgasy: - resolution: {integrity: sha512-HW14TXC45dFVZxnVW8rnUGnvYyRC0E/vxXShFCthcC9VhVTmjqOmtqj6H5rm9Zxv+ORxKA/1aLGD7vmlLsdlOg==} + /@typescript-eslint/type-utils/5.42.1_rmayb2veg2btbq6mbmnyivgasy: + resolution: {integrity: sha512-WWiMChneex5w4xPIX56SSnQQo0tEOy5ZV2dqmj8Z371LJ0E+aymWD25JQ/l4FOuuX+Q49A7pzh/CGIQflxMVXg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '*' @@ -761,8 +761,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.42.0_typescript@4.8.4 - '@typescript-eslint/utils': 5.42.0_rmayb2veg2btbq6mbmnyivgasy + '@typescript-eslint/typescript-estree': 5.42.1_typescript@4.8.4 + '@typescript-eslint/utils': 5.42.1_rmayb2veg2btbq6mbmnyivgasy debug: 4.3.4 eslint: 8.27.0 tsutils: 3.21.0_typescript@4.8.4 @@ -771,13 +771,13 @@ packages: - supports-color dev: true - /@typescript-eslint/types/5.42.0: - resolution: {integrity: sha512-t4lzO9ZOAUcHY6bXQYRuu+3SSYdD9TS8ooApZft4WARt4/f2Cj/YpvbTe8A4GuhT4bNW72goDMOy7SW71mZwGw==} + /@typescript-eslint/types/5.42.1: + resolution: {integrity: sha512-Qrco9dsFF5lhalz+lLFtxs3ui1/YfC6NdXu+RAGBa8uSfn01cjO7ssCsjIsUs484vny9Xm699FSKwpkCcqwWwA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree/5.42.0_typescript@4.8.4: - resolution: {integrity: sha512-2O3vSq794x3kZGtV7i4SCWZWCwjEtkWfVqX4m5fbUBomOsEOyd6OAD1qU2lbvV5S8tgy/luJnOYluNyYVeOTTg==} + /@typescript-eslint/typescript-estree/5.42.1_typescript@4.8.4: + resolution: {integrity: sha512-qElc0bDOuO0B8wDhhW4mYVgi/LZL+igPwXtV87n69/kYC/7NG3MES0jHxJNCr4EP7kY1XVsRy8C/u3DYeTKQmw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: typescript: '*' @@ -785,8 +785,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.42.0 - '@typescript-eslint/visitor-keys': 5.42.0 + '@typescript-eslint/types': 5.42.1 + '@typescript-eslint/visitor-keys': 5.42.1 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -797,17 +797,17 @@ packages: - supports-color dev: true - /@typescript-eslint/utils/5.42.0_rmayb2veg2btbq6mbmnyivgasy: - resolution: {integrity: sha512-JZ++3+h1vbeG1NUECXQZE3hg0kias9kOtcQr3+JVQ3whnjvKuMyktJAAIj6743OeNPnGBmjj7KEmiDL7qsdnCQ==} + /@typescript-eslint/utils/5.42.1_rmayb2veg2btbq6mbmnyivgasy: + resolution: {integrity: sha512-Gxvf12xSp3iYZd/fLqiQRD4uKZjDNR01bQ+j8zvhPjpsZ4HmvEFL/tC4amGNyxN9Rq+iqvpHLhlqx6KTxz9ZyQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: '@types/json-schema': 7.0.11 '@types/semver': 7.3.13 - '@typescript-eslint/scope-manager': 5.42.0 - '@typescript-eslint/types': 5.42.0 - '@typescript-eslint/typescript-estree': 5.42.0_typescript@4.8.4 + '@typescript-eslint/scope-manager': 5.42.1 + '@typescript-eslint/types': 5.42.1 + '@typescript-eslint/typescript-estree': 5.42.1_typescript@4.8.4 eslint: 8.27.0 eslint-scope: 5.1.1 eslint-utils: 3.0.0_eslint@8.27.0 @@ -817,11 +817,11 @@ packages: - typescript dev: true - /@typescript-eslint/visitor-keys/5.42.0: - resolution: {integrity: sha512-QHbu5Hf/2lOEOwy+IUw0GoSCuAzByTAWWrOTKzTzsotiUnWFpuKnXcAhC9YztAf2EElQ0VvIK+pHJUPkM0q7jg==} + /@typescript-eslint/visitor-keys/5.42.1: + resolution: {integrity: sha512-LOQtSF4z+hejmpUvitPlc4hA7ERGoj2BVkesOcG91HCn8edLGUXbTrErmutmPbl8Bo9HjAvOO/zBKQHExXNA2A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.42.0 + '@typescript-eslint/types': 5.42.1 eslint-visitor-keys: 3.3.0 dev: true From fb0dabd5cf181deed0fe03b8e20657e3ad24caf1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Nov 2022 12:14:32 +0100 Subject: [PATCH 4/6] chore(deps): update pnpm to v7.15.0 (#1561) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ba1a15fd3f0..bd5657154a3 100644 --- a/package.json +++ b/package.json @@ -142,7 +142,7 @@ "vitest": "~0.25.1", "vue": "~3.2.41" }, - "packageManager": "pnpm@7.14.2", + "packageManager": "pnpm@7.15.0", "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0", "npm": ">=6.14.13" From 66ccca3e11721647c4c13179eb1e23f13d43ef03 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Nov 2022 07:13:19 -0500 Subject: [PATCH 5/6] chore(deps): update devdependencies (#1560) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 10 +-- pnpm-lock.yaml | 167 +++++++++++++++++++++++++------------------------ 2 files changed, 90 insertions(+), 87 deletions(-) diff --git a/package.json b/package.json index bd5657154a3..6158396e80a 100644 --- a/package.json +++ b/package.json @@ -107,14 +107,14 @@ "@typescript-eslint/parser": "~5.42.1", "@vitest/coverage-c8": "~0.25.1", "@vitest/ui": "~0.25.1", - "@vueuse/core": "~9.4.0", + "@vueuse/core": "~9.5.0", "c8": "~7.12.0", "conventional-changelog-cli": "~2.2.2", "cypress": "~11.0.1", "esbuild": "~0.15.13", "eslint": "~8.27.0", "eslint-config-prettier": "~8.5.0", - "eslint-define-config": "~1.11.0", + "eslint-define-config": "~1.12.0", "eslint-gitignore": "~0.1.0", "eslint-plugin-jsdoc": "~39.6.2", "eslint-plugin-prettier": "~4.2.1", @@ -124,7 +124,7 @@ "npm-run-all": "~4.1.5", "picocolors": "~1.0.0", "prettier": "2.7.1", - "prettier-plugin-organize-imports": "~3.1.1", + "prettier-plugin-organize-imports": "~3.2.0", "react": "~18.2.0", "react-dom": "~18.2.0", "rimraf": "~3.0.2", @@ -132,7 +132,7 @@ "semver": "~7.3.8", "simple-git-hooks": "~2.8.1", "standard-version": "~9.5.0", - "tsx": "~3.11.0", + "tsx": "~3.12.1", "typedoc": "~0.23.21", "typedoc-plugin-missing-exports": "~1.0.0", "typescript": "~4.8.4", @@ -140,7 +140,7 @@ "vite": "~3.2.3", "vitepress": "1.0.0-alpha.28", "vitest": "~0.25.1", - "vue": "~3.2.41" + "vue": "~3.2.45" }, "packageManager": "pnpm@7.15.0", "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7bf68fb6a20..fe5d337ece7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,14 +15,14 @@ specifiers: '@typescript-eslint/parser': ~5.42.1 '@vitest/coverage-c8': ~0.25.1 '@vitest/ui': ~0.25.1 - '@vueuse/core': ~9.4.0 + '@vueuse/core': ~9.5.0 c8: ~7.12.0 conventional-changelog-cli: ~2.2.2 cypress: ~11.0.1 esbuild: ~0.15.13 eslint: ~8.27.0 eslint-config-prettier: ~8.5.0 - eslint-define-config: ~1.11.0 + eslint-define-config: ~1.12.0 eslint-gitignore: ~0.1.0 eslint-plugin-jsdoc: ~39.6.2 eslint-plugin-prettier: ~4.2.1 @@ -32,7 +32,7 @@ specifiers: npm-run-all: ~4.1.5 picocolors: ~1.0.0 prettier: 2.7.1 - prettier-plugin-organize-imports: ~3.1.1 + prettier-plugin-organize-imports: ~3.2.0 react: ~18.2.0 react-dom: ~18.2.0 rimraf: ~3.0.2 @@ -40,7 +40,7 @@ specifiers: semver: ~7.3.8 simple-git-hooks: ~2.8.1 standard-version: ~9.5.0 - tsx: ~3.11.0 + tsx: ~3.12.1 typedoc: ~0.23.21 typedoc-plugin-missing-exports: ~1.0.0 typescript: ~4.8.4 @@ -48,7 +48,7 @@ specifiers: vite: ~3.2.3 vitepress: 1.0.0-alpha.28 vitest: ~0.25.1 - vue: ~3.2.41 + vue: ~3.2.45 devDependencies: '@actions/github': 5.1.1 @@ -65,14 +65,14 @@ devDependencies: '@typescript-eslint/parser': 5.42.1_rmayb2veg2btbq6mbmnyivgasy '@vitest/coverage-c8': 0.25.1_@vitest+ui@0.25.1 '@vitest/ui': 0.25.1 - '@vueuse/core': 9.4.0_vue@3.2.41 + '@vueuse/core': 9.5.0_vue@3.2.45 c8: 7.12.0 conventional-changelog-cli: 2.2.2 cypress: 11.0.1 esbuild: 0.15.13 eslint: 8.27.0 eslint-config-prettier: 8.5.0_eslint@8.27.0 - eslint-define-config: 1.11.0 + eslint-define-config: 1.12.0 eslint-gitignore: 0.1.0_eslint@8.27.0 eslint-plugin-jsdoc: 39.6.2_eslint@8.27.0 eslint-plugin-prettier: 4.2.1_v7o5sx5x3wbs57ifz6wc4f76we @@ -82,7 +82,7 @@ devDependencies: npm-run-all: 4.1.5 picocolors: 1.0.0 prettier: 2.7.1 - prettier-plugin-organize-imports: 3.1.1_dmjzcauo3cshxeipj7bv64ktgm + prettier-plugin-organize-imports: 3.2.0_dmjzcauo3cshxeipj7bv64ktgm react: 18.2.0 react-dom: 18.2.0_react@18.2.0 rimraf: 3.0.2 @@ -90,7 +90,7 @@ devDependencies: semver: 7.3.8 simple-git-hooks: 2.8.1 standard-version: 9.5.0 - tsx: 3.11.0 + tsx: 3.12.1 typedoc: 0.23.21_typescript@4.8.4 typedoc-plugin-missing-exports: 1.0.0_typedoc@0.23.21 typescript: 4.8.4 @@ -98,7 +98,7 @@ devDependencies: vite: 3.2.3_@types+node@18.11.9 vitepress: 1.0.0-alpha.28_ftj2nf53q7xylmjs4grbzsajkm vitest: 0.25.1_@vitest+ui@0.25.1 - vue: 3.2.41 + vue: 3.2.45 packages: @@ -825,7 +825,7 @@ packages: eslint-visitor-keys: 3.3.0 dev: true - /@vitejs/plugin-vue/3.2.0_vite@3.2.3+vue@3.2.41: + /@vitejs/plugin-vue/3.2.0_vite@3.2.3+vue@3.2.45: resolution: {integrity: sha512-E0tnaL4fr+qkdCNxJ+Xd0yM31UwMkQje76fsDVBBUCoGOUPexu2VDUYHL8P4CwV+zMvWw6nlRw19OnRKmYAJpw==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -833,7 +833,7 @@ packages: vue: ^3.2.25 dependencies: vite: 3.2.3_@types+node@18.11.9 - vue: 3.2.41 + vue: 3.2.45 dev: true /@vitest/coverage-c8/0.25.1_@vitest+ui@0.25.1: @@ -861,113 +861,113 @@ packages: sirv: 2.0.2 dev: true - /@vue/compiler-core/3.2.41: - resolution: {integrity: sha512-oA4mH6SA78DT+96/nsi4p9DX97PHcNROxs51lYk7gb9Z4BPKQ3Mh+BLn6CQZBw857Iuhu28BfMSRHAlPvD4vlw==} + /@vue/compiler-core/3.2.45: + resolution: {integrity: sha512-rcMj7H+PYe5wBV3iYeUgbCglC+pbpN8hBLTJvRiK2eKQiWqu+fG9F+8sW99JdL4LQi7Re178UOxn09puSXvn4A==} dependencies: '@babel/parser': 7.19.4 - '@vue/shared': 3.2.41 + '@vue/shared': 3.2.45 estree-walker: 2.0.2 source-map: 0.6.1 dev: true - /@vue/compiler-dom/3.2.41: - resolution: {integrity: sha512-xe5TbbIsonjENxJsYRbDJvthzqxLNk+tb3d/c47zgREDa/PCp6/Y4gC/skM4H6PIuX5DAxm7fFJdbjjUH2QTMw==} + /@vue/compiler-dom/3.2.45: + resolution: {integrity: sha512-tyYeUEuKqqZO137WrZkpwfPCdiiIeXYCcJ8L4gWz9vqaxzIQRccTSwSWZ/Axx5YR2z+LvpUbmPNXxuBU45lyRw==} dependencies: - '@vue/compiler-core': 3.2.41 - '@vue/shared': 3.2.41 + '@vue/compiler-core': 3.2.45 + '@vue/shared': 3.2.45 dev: true - /@vue/compiler-sfc/3.2.41: - resolution: {integrity: sha512-+1P2m5kxOeaxVmJNXnBskAn3BenbTmbxBxWOtBq3mQTCokIreuMULFantBUclP0+KnzNCMOvcnKinqQZmiOF8w==} + /@vue/compiler-sfc/3.2.45: + resolution: {integrity: sha512-1jXDuWah1ggsnSAOGsec8cFjT/K6TMZ0sPL3o3d84Ft2AYZi2jWJgRMjw4iaK0rBfA89L5gw427H4n1RZQBu6Q==} dependencies: '@babel/parser': 7.19.4 - '@vue/compiler-core': 3.2.41 - '@vue/compiler-dom': 3.2.41 - '@vue/compiler-ssr': 3.2.41 - '@vue/reactivity-transform': 3.2.41 - '@vue/shared': 3.2.41 + '@vue/compiler-core': 3.2.45 + '@vue/compiler-dom': 3.2.45 + '@vue/compiler-ssr': 3.2.45 + '@vue/reactivity-transform': 3.2.45 + '@vue/shared': 3.2.45 estree-walker: 2.0.2 magic-string: 0.25.9 postcss: 8.4.18 source-map: 0.6.1 dev: true - /@vue/compiler-ssr/3.2.41: - resolution: {integrity: sha512-Y5wPiNIiaMz/sps8+DmhaKfDm1xgj6GrH99z4gq2LQenfVQcYXmHIOBcs5qPwl7jaW3SUQWjkAPKMfQemEQZwQ==} + /@vue/compiler-ssr/3.2.45: + resolution: {integrity: sha512-6BRaggEGqhWht3lt24CrIbQSRD5O07MTmd+LjAn5fJj568+R9eUD2F7wMQJjX859seSlrYog7sUtrZSd7feqrQ==} dependencies: - '@vue/compiler-dom': 3.2.41 - '@vue/shared': 3.2.41 + '@vue/compiler-dom': 3.2.45 + '@vue/shared': 3.2.45 dev: true /@vue/devtools-api/6.4.5: resolution: {integrity: sha512-JD5fcdIuFxU4fQyXUu3w2KpAJHzTVdN+p4iOX2lMWSHMOoQdMAcpFLZzm9Z/2nmsoZ1a96QEhZ26e50xLBsgOQ==} dev: true - /@vue/reactivity-transform/3.2.41: - resolution: {integrity: sha512-mK5+BNMsL4hHi+IR3Ft/ho6Za+L3FA5j8WvreJ7XzHrqkPq8jtF/SMo7tuc9gHjLDwKZX1nP1JQOKo9IEAn54A==} + /@vue/reactivity-transform/3.2.45: + resolution: {integrity: sha512-BHVmzYAvM7vcU5WmuYqXpwaBHjsS8T63jlKGWVtHxAHIoMIlmaMyurUSEs1Zcg46M4AYT5MtB1U274/2aNzjJQ==} dependencies: '@babel/parser': 7.19.4 - '@vue/compiler-core': 3.2.41 - '@vue/shared': 3.2.41 + '@vue/compiler-core': 3.2.45 + '@vue/shared': 3.2.45 estree-walker: 2.0.2 magic-string: 0.25.9 dev: true - /@vue/reactivity/3.2.41: - resolution: {integrity: sha512-9JvCnlj8uc5xRiQGZ28MKGjuCoPhhTwcoAdv3o31+cfGgonwdPNuvqAXLhlzu4zwqavFEG5tvaoINQEfxz+l6g==} + /@vue/reactivity/3.2.45: + resolution: {integrity: sha512-PRvhCcQcyEVohW0P8iQ7HDcIOXRjZfAsOds3N99X/Dzewy8TVhTCT4uXpAHfoKjVTJRA0O0K+6QNkDIZAxNi3A==} dependencies: - '@vue/shared': 3.2.41 + '@vue/shared': 3.2.45 dev: true - /@vue/runtime-core/3.2.41: - resolution: {integrity: sha512-0LBBRwqnI0p4FgIkO9q2aJBBTKDSjzhnxrxHYengkAF6dMOjeAIZFDADAlcf2h3GDALWnblbeprYYpItiulSVQ==} + /@vue/runtime-core/3.2.45: + resolution: {integrity: sha512-gzJiTA3f74cgARptqzYswmoQx0fIA+gGYBfokYVhF8YSXjWTUA2SngRzZRku2HbGbjzB6LBYSbKGIaK8IW+s0A==} dependencies: - '@vue/reactivity': 3.2.41 - '@vue/shared': 3.2.41 + '@vue/reactivity': 3.2.45 + '@vue/shared': 3.2.45 dev: true - /@vue/runtime-dom/3.2.41: - resolution: {integrity: sha512-U7zYuR1NVIP8BL6jmOqmapRAHovEFp7CSw4pR2FacqewXNGqZaRfHoNLQsqQvVQ8yuZNZtxSZy0FFyC70YXPpA==} + /@vue/runtime-dom/3.2.45: + resolution: {integrity: sha512-cy88YpfP5Ue2bDBbj75Cb4bIEZUMM/mAkDMfqDTpUYVgTf/kuQ2VQ8LebuZ8k6EudgH8pYhsGWHlY0lcxlvTwA==} dependencies: - '@vue/runtime-core': 3.2.41 - '@vue/shared': 3.2.41 + '@vue/runtime-core': 3.2.45 + '@vue/shared': 3.2.45 csstype: 2.6.21 dev: true - /@vue/server-renderer/3.2.41_vue@3.2.41: - resolution: {integrity: sha512-7YHLkfJdTlsZTV0ae5sPwl9Gn/EGr2hrlbcS/8naXm2CDpnKUwC68i1wGlrYAfIgYWL7vUZwk2GkYLQH5CvFig==} + /@vue/server-renderer/3.2.45_vue@3.2.45: + resolution: {integrity: sha512-ebiMq7q24WBU1D6uhPK//2OTR1iRIyxjF5iVq/1a5I1SDMDyDu4Ts6fJaMnjrvD3MqnaiFkKQj+LKAgz5WIK3g==} peerDependencies: - vue: 3.2.41 + vue: 3.2.45 dependencies: - '@vue/compiler-ssr': 3.2.41 - '@vue/shared': 3.2.41 - vue: 3.2.41 + '@vue/compiler-ssr': 3.2.45 + '@vue/shared': 3.2.45 + vue: 3.2.45 dev: true - /@vue/shared/3.2.41: - resolution: {integrity: sha512-W9mfWLHmJhkfAmV+7gDjcHeAWALQtgGT3JErxULl0oz6R6+3ug91I7IErs93eCFhPCZPHBs4QJS7YWEV7A3sxw==} + /@vue/shared/3.2.45: + resolution: {integrity: sha512-Ewzq5Yhimg7pSztDV+RH1UDKBzmtqieXQlpTVm2AwraoRL/Rks96mvd8Vgi7Lj+h+TH8dv7mXD3FRZR3TUvbSg==} dev: true - /@vueuse/core/9.4.0_vue@3.2.41: - resolution: {integrity: sha512-JzgenGj1ZF2BHOen5rsFiAyyI9sXAv7aKhNLlm9b7SwYQeKTcxTWdhudonURCSP3Egl9NQaRBzes2lv/1JUt/Q==} + /@vueuse/core/9.5.0_vue@3.2.45: + resolution: {integrity: sha512-6GsWBsJHEb3sYw15mbLrcbslAVY45pkzjJYTKYKCXv88z7srAF0VEW0q+oXKsl58tCbqooplInahXFg8Yo1m4w==} dependencies: '@types/web-bluetooth': 0.0.16 - '@vueuse/metadata': 9.4.0 - '@vueuse/shared': 9.4.0_vue@3.2.41 - vue-demi: 0.13.11_vue@3.2.41 + '@vueuse/metadata': 9.5.0 + '@vueuse/shared': 9.5.0_vue@3.2.45 + vue-demi: 0.13.11_vue@3.2.45 transitivePeerDependencies: - '@vue/composition-api' - vue dev: true - /@vueuse/metadata/9.4.0: - resolution: {integrity: sha512-7GKMdGAsJyQJl35MYOz/RDpP0FxuiZBRDSN79QIPbdqYx4Sd0sVTnIC68KJ6Oln0t0SouvSUMvRHuno216Ud2Q==} + /@vueuse/metadata/9.5.0: + resolution: {integrity: sha512-4M1AyPZmIv41pym+K5+4wup3bKuYebbH8w8BROY1hmT7rIwcyS4tEL+UsGz0Hiu1FCOxcoBrwtAizc0YmBJjyQ==} dev: true - /@vueuse/shared/9.4.0_vue@3.2.41: - resolution: {integrity: sha512-fTuem51KwMCnqUKkI8B57qAIMcFovtGgsCtAeqxIzH3i6nE9VYge+gVfneNHAAy7lj8twbkNfqQSygOPJTm4tQ==} + /@vueuse/shared/9.5.0_vue@3.2.45: + resolution: {integrity: sha512-HnnCWU1Vg9CVWRCcI8ohDKDRB2Sc4bTgT1XAIaoLSfVHHn+TKbrox6pd3klCSw4UDxkhDfOk8cAdcK+Z5KleCA==} dependencies: - vue-demi: 0.13.11_vue@3.2.41 + vue-demi: 0.13.11_vue@3.2.45 transitivePeerDependencies: - '@vue/composition-api' - vue @@ -2191,8 +2191,8 @@ packages: eslint: 8.27.0 dev: true - /eslint-define-config/1.11.0: - resolution: {integrity: sha512-J5xNmL5EyXJzrRCGuyr8eKia2boFnJl3Lzurrv1tpM3oxtNONlp9/HW+zRFZ6+W3U7BQDCtnLunGmyCCtFHioQ==} + /eslint-define-config/1.12.0: + resolution: {integrity: sha512-Kt9TcMbgsY9VRt7jIuw76KE/2RuD31eWB4Ubv6btXgU8NTSsbT6gZ8qzeiU+rAih/8sOl8Kt89spAZBMElu6qQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0, npm: '>=6.14.13', pnpm: '>= 7.0.0'} dev: true @@ -3894,13 +3894,16 @@ packages: fast-diff: 1.2.0 dev: true - /prettier-plugin-organize-imports/3.1.1_dmjzcauo3cshxeipj7bv64ktgm: - resolution: {integrity: sha512-6bHIQzybqA644h0WGUW3gpWEVbMBvzui5wCMRBi7qA++d5ov2xjjfDk8pxJJ/ardfZrGAwizKMq/fQMFdJ+0Zw==} + /prettier-plugin-organize-imports/3.2.0_dmjzcauo3cshxeipj7bv64ktgm: + resolution: {integrity: sha512-jeZ13YVKgXYCzkuwnoR6saKxJmdRYWMxS2G/su1V3qDWqTo1Q5iSoTblBxsXXAmomXfPqa/uA7YCK0/S86KLOQ==} peerDependencies: - '@volar/vue-typescript': '>=0.40.2' + '@volar/vue-language-plugin-pug': ^1.0.4 + '@volar/vue-typescript': ^1.0.4 prettier: '>=2.0' typescript: '>=2.9' peerDependenciesMeta: + '@volar/vue-language-plugin-pug': + optional: true '@volar/vue-typescript': optional: true dependencies: @@ -4630,8 +4633,8 @@ packages: typescript: 4.8.4 dev: true - /tsx/3.11.0: - resolution: {integrity: sha512-q+q4xxu41+AafVwvAGqtNJ1ekPFd33ZhTMXvgIpHMqv/W89efwDRE9IyjhEAZm5iTHsshKaf1BYWSk789BrNCA==} + /tsx/3.12.1: + resolution: {integrity: sha512-Rcg1x+rNe7qwlP8j7kx4VjP/pJo/V57k+17hlrn6a7FuQLNwkaw5W4JF75tYornNVCxkXdSUnqlIT8JY/ttvIw==} hasBin: true dependencies: '@esbuild-kit/cjs-loader': 2.4.0 @@ -4847,13 +4850,13 @@ packages: dependencies: '@docsearch/css': 3.3.0 '@docsearch/js': 3.3.0_bbqmvyebg44zjqjhzodbnnxkxa - '@vitejs/plugin-vue': 3.2.0_vite@3.2.3+vue@3.2.41 + '@vitejs/plugin-vue': 3.2.0_vite@3.2.3+vue@3.2.45 '@vue/devtools-api': 6.4.5 - '@vueuse/core': 9.4.0_vue@3.2.41 + '@vueuse/core': 9.5.0_vue@3.2.45 body-scroll-lock: 4.0.0-beta.0 shiki: 0.11.1 vite: 3.2.3_@types+node@18.11.9 - vue: 3.2.41 + vue: 3.2.45 transitivePeerDependencies: - '@algolia/client-search' - '@types/node' @@ -4922,7 +4925,7 @@ packages: resolution: {integrity: sha512-gu73tuZfJgu+mvCSy4UZwd2JXykjK9zAZsfmDeut5dx/1a7FeTk0XwJsSuqQn+cuMCGVbIBfl+s53X4T19DnzQ==} dev: true - /vue-demi/0.13.11_vue@3.2.41: + /vue-demi/0.13.11_vue@3.2.45: resolution: {integrity: sha512-IR8HoEEGM65YY3ZJYAjMlKygDQn25D5ajNFNoKh9RSDMQtlzCxtfQjdQgv9jjK+m3377SsJXY8ysq8kLCZL25A==} engines: {node: '>=12'} hasBin: true @@ -4934,17 +4937,17 @@ packages: '@vue/composition-api': optional: true dependencies: - vue: 3.2.41 + vue: 3.2.45 dev: true - /vue/3.2.41: - resolution: {integrity: sha512-uuuvnrDXEeZ9VUPljgHkqB5IaVO8SxhPpqF2eWOukVrBnRBx2THPSGQBnVRt0GrIG1gvCmFXMGbd7FqcT1ixNQ==} + /vue/3.2.45: + resolution: {integrity: sha512-9Nx/Mg2b2xWlXykmCwiTUCWHbWIj53bnkizBxKai1g61f2Xit700A1ljowpTIM11e3uipOeiPcSqnmBg6gyiaA==} dependencies: - '@vue/compiler-dom': 3.2.41 - '@vue/compiler-sfc': 3.2.41 - '@vue/runtime-dom': 3.2.41 - '@vue/server-renderer': 3.2.41_vue@3.2.41 - '@vue/shared': 3.2.41 + '@vue/compiler-dom': 3.2.45 + '@vue/compiler-sfc': 3.2.45 + '@vue/runtime-dom': 3.2.45 + '@vue/server-renderer': 3.2.45_vue@3.2.45 + '@vue/shared': 3.2.45 dev: true /webidl-conversions/3.0.1: From 801e9e0a6afa2bd472652eb7aaee5581ef458342 Mon Sep 17 00:00:00 2001 From: Eric Cheng Date: Mon, 14 Nov 2022 17:56:49 -0500 Subject: [PATCH 6/6] refactor(string): rename params (#1551) --- src/modules/finance/index.ts | 2 +- src/modules/random/index.ts | 10 +- src/modules/string/index.ts | 60 ++++++------ src/modules/vehicle/index.ts | 8 +- test/__snapshots__/string.spec.ts.snap | 48 +++++----- test/random.spec.ts | 8 +- test/string.spec.ts | 124 ++++++++++++------------- 7 files changed, 132 insertions(+), 128 deletions(-) diff --git a/src/modules/finance/index.ts b/src/modules/finance/index.ts index 89b655bdd38..e739d9207f6 100644 --- a/src/modules/finance/index.ts +++ b/src/modules/finance/index.ts @@ -238,7 +238,7 @@ export class FinanceModule { address += this.faker.string.alphanumeric({ length: addressLength, casing: 'mixed', - bannedChars: '0OIl', + exclude: '0OIl', }); return address; diff --git a/src/modules/random/index.ts b/src/modules/random/index.ts index 0505744d401..cb81935b2d4 100644 --- a/src/modules/random/index.ts +++ b/src/modules/random/index.ts @@ -211,7 +211,11 @@ export class RandomModule { if (typeof options === 'number') { return this.faker.string.alpha(options); } - return this.faker.string.alpha({ ...options, length: options.count }); + return this.faker.string.alpha({ + length: options.count, + casing: options.casing, + exclude: options.bannedChars, + }); } /** @@ -248,7 +252,7 @@ export class RandomModule { }); return this.faker.string.alphanumeric({ length: count, - bannedChars: options.bannedChars, + exclude: options.bannedChars, casing: options.casing, }); } @@ -290,7 +294,7 @@ export class RandomModule { return this.faker.string.numeric({ length, allowLeadingZeros: options.allowLeadingZeros, - bannedDigits: options.bannedDigits, + exclude: options.bannedDigits, }); } } diff --git a/src/modules/string/index.ts b/src/modules/string/index.ts index 171c0cf607e..22cb39d5360 100644 --- a/src/modules/string/index.ts +++ b/src/modules/string/index.ts @@ -98,17 +98,17 @@ export class StringModule { /** * Generating a string consisting of letters in the English alphabet. * - * @param options Either the number of characters or an options instance. Defaults to `{ length: 1, casing: 'mixed', bannedChars: [] }`. + * @param options Either the number of characters or an options instance. Defaults to `{ length: 1, casing: 'mixed', exclude: [] }`. * @param options.length The number of characters to generate. Defaults to `1`. * @param options.casing The casing of the characters. Defaults to `'mixed'`. - * @param options.bannedChars An array with characters to exclude. Defaults to `[]`. + * @param options.exclude An array with characters which should be excluded in the generated string. Defaults to `[]`. * * @example * faker.string.alpha() // 'b' * faker.string.alpha(10) // 'fEcAaCVbaR' * faker.string.alpha({ casing: 'lower' }) // 'r' - * faker.string.alpha({ bannedChars: ['W'] }) // 'Z' - * faker.string.alpha({ length: 5, casing: 'upper', bannedChars: ['A'] }) // 'DTCIC' + * faker.string.alpha({ exclude: ['W'] }) // 'Z' + * faker.string.alpha({ length: 5, casing: 'upper', exclude: ['A'] }) // 'DTCIC' * * @since 8.0.0 */ @@ -118,7 +118,7 @@ export class StringModule { | { length?: number; casing?: Casing; - bannedChars?: readonly LiteralUnion[] | string; + exclude?: readonly LiteralUnion[] | string; } = {} ): string { if (typeof options === 'number') { @@ -128,10 +128,10 @@ export class StringModule { } const { length = 1, casing = 'mixed' } = options; - let { bannedChars = [] } = options; + let { exclude = [] } = options; - if (typeof bannedChars === 'string') { - bannedChars = bannedChars.split(''); + if (typeof exclude === 'string') { + exclude = exclude.split(''); } if (length <= 0) { @@ -152,11 +152,11 @@ export class StringModule { break; } - charsArray = charsArray.filter((elem) => !bannedChars.includes(elem)); + charsArray = charsArray.filter((elem) => !exclude.includes(elem)); if (charsArray.length === 0) { throw new FakerError( - 'Unable to generate string, because all possible characters are banned.' + 'Unable to generate string, because all possible characters are excluded.' ); } @@ -168,17 +168,17 @@ export class StringModule { /** * Generating a string consisting of alpha characters and digits. * - * @param options Either the number of characters or an options instance. Defaults to `{ length: 1, casing: 'mixed', bannedChars: [] }`. + * @param options Either the number of characters or an options instance. Defaults to `{ length: 1, casing: 'mixed', exclude: [] }`. * @param options.length The number of characters and digits to generate. Defaults to `1`. * @param options.casing The casing of the characters. Defaults to `'mixed'`. - * @param options.bannedChars An array of characters and digits which should be banned in the generated string. Defaults to `[]`. + * @param options.exclude An array of characters and digits which should be excluded in the generated string. Defaults to `[]`. * * @example * faker.string.alphanumeric() // '2' * faker.string.alphanumeric(5) // '3e5V7' * faker.string.alphanumeric({ casing: 'upper' }) // 'A' - * faker.string.alphanumeric({ bannedChars: ['W'] }) // 'r' - * faker.string.alphanumeric({ length: 5, bannedChars: ["a"] }) // 'x1Z7f' + * faker.string.alphanumeric({ exclude: ['W'] }) // 'r' + * faker.string.alphanumeric({ length: 5, exclude: ["a"] }) // 'x1Z7f' * * @since 8.0.0 */ @@ -188,7 +188,7 @@ export class StringModule { | { length?: number; casing?: Casing; - bannedChars?: readonly LiteralUnion[] | string; + exclude?: readonly LiteralUnion[] | string; } = {} ): string { if (typeof options === 'number') { @@ -203,10 +203,10 @@ export class StringModule { return ''; } - let { bannedChars = [] } = options; + let { exclude = [] } = options; - if (typeof bannedChars === 'string') { - bannedChars = bannedChars.split(''); + if (typeof exclude === 'string') { + exclude = exclude.split(''); } let charsArray = [...DIGIT_CHARS]; @@ -224,11 +224,11 @@ export class StringModule { break; } - charsArray = charsArray.filter((elem) => !bannedChars.includes(elem)); + charsArray = charsArray.filter((elem) => !exclude.includes(elem)); if (charsArray.length === 0) { throw new FakerError( - 'Unable to generate string, because all possible characters are banned.' + 'Unable to generate string, because all possible characters are excluded.' ); } @@ -307,17 +307,17 @@ export class StringModule { /** * Generates a given length string of digits. * - * @param options Either the number of characters or the options to use. Defaults to `{ length: 1, allowLeadingZeros = false, bannedDigits = [] }`. + * @param options Either the number of characters or the options to use. Defaults to `{ length: 1, allowLeadingZeros = false, exclude = [] }`. * @param options.length The number of digits to generate. Defaults to `1`. * @param options.allowLeadingZeros If true, leading zeros will be allowed. Defaults to `false`. - * @param options.bannedDigits An array of digits which should be banned in the generated string. Defaults to `[]`. + * @param options.exclude An array of digits which should be excluded in the generated string. Defaults to `[]`. * * @example * faker.string.numeric() // '2' * faker.string.numeric(5) // '31507' * faker.string.numeric(42) // '56434563150765416546479875435481513188548' * faker.string.numeric({ length: 42, allowLeadingZeros: true }) // '00564846278453876543517840713421451546115' - * faker.string.numeric({ length: 6, bannedDigits: ['0'] }) // '943228' + * faker.string.numeric({ length: 6, exclude: ['0'] }) // '943228' * * @since 8.0.0 */ @@ -327,7 +327,7 @@ export class StringModule { | { length?: number; allowLeadingZeros?: boolean; - bannedDigits?: readonly LiteralUnion[] | string; + exclude?: readonly LiteralUnion[] | string; } = {} ): string { if (typeof options === 'number') { @@ -341,14 +341,14 @@ export class StringModule { return ''; } - let { bannedDigits = [] } = options; + let { exclude = [] } = options; - if (typeof bannedDigits === 'string') { - bannedDigits = bannedDigits.split(''); + if (typeof exclude === 'string') { + exclude = exclude.split(''); } const allowedDigits = DIGIT_CHARS.filter( - (digit) => !bannedDigits.includes(digit) + (digit) => !exclude.includes(digit) ); if ( @@ -358,13 +358,13 @@ export class StringModule { allowedDigits[0] === '0') ) { throw new FakerError( - 'Unable to generate numeric string, because all possible digits are banned.' + 'Unable to generate numeric string, because all possible digits are excluded.' ); } let result = ''; - if (!allowLeadingZeros && !bannedDigits.includes('0')) { + if (!allowLeadingZeros && !exclude.includes('0')) { result += this.faker.helpers.arrayElement( allowedDigits.filter((digit) => digit !== '0') ); diff --git a/src/modules/vehicle/index.ts b/src/modules/vehicle/index.ts index 3ef8f748d32..e6bdaeb3f97 100644 --- a/src/modules/vehicle/index.ts +++ b/src/modules/vehicle/index.ts @@ -87,19 +87,19 @@ export class VehicleModule { * @since 5.0.0 */ vin(): string { - const bannedChars = ['o', 'i', 'q', 'O', 'I', 'Q']; + const exclude = ['o', 'i', 'q', 'O', 'I', 'Q']; return `${this.faker.string.alphanumeric({ length: 10, casing: 'upper', - bannedChars, + exclude, })}${this.faker.string.alpha({ length: 1, casing: 'upper', - bannedChars, + exclude, })}${this.faker.string.alphanumeric({ length: 1, casing: 'upper', - bannedChars, + exclude, })}${this.faker.datatype.number({ min: 10000, max: 99999 })}` // return five digit # .toUpperCase(); } diff --git a/test/__snapshots__/string.spec.ts.snap b/test/__snapshots__/string.spec.ts.snap index f4a607b4888..bcac1178965 100644 --- a/test/__snapshots__/string.spec.ts.snap +++ b/test/__snapshots__/string.spec.ts.snap @@ -2,14 +2,14 @@ exports[`string > 42 > alpha > noArgs 1`] = `"t"`; -exports[`string > 42 > alpha > with bannedChars 1`] = `"A"`; - exports[`string > 42 > alpha > with casing = lower 1`] = `"j"`; exports[`string > 42 > alpha > with casing = mixed 1`] = `"t"`; exports[`string > 42 > alpha > with casing = upper 1`] = `"J"`; +exports[`string > 42 > alpha > with exclude 1`] = `"A"`; + exports[`string > 42 > alpha > with length 1`] = `"tPXjMO"`; exports[`string > 42 > alpha > with length parameter 1`] = `"tPXjM"`; @@ -22,18 +22,18 @@ exports[`string > 42 > alpha > with length parameter 4`] = `"rFhKH"`; exports[`string > 42 > alpha > with length parameter 5`] = `"bcYLR"`; -exports[`string > 42 > alpha > with length, casing and bannedChars 1`] = `"fwzcvwj"`; +exports[`string > 42 > alpha > with length, casing and exclude 1`] = `"fwzcvwj"`; exports[`string > 42 > alphanumeric > noArgs 1`] = `"n"`; -exports[`string > 42 > alphanumeric > with bannedChars 1`] = `"x"`; - exports[`string > 42 > alphanumeric > with casing = lower 1`] = `"d"`; exports[`string > 42 > alphanumeric > with casing = mixed 1`] = `"n"`; exports[`string > 42 > alphanumeric > with casing = upper 1`] = `"D"`; +exports[`string > 42 > alphanumeric > with exclude 1`] = `"x"`; + exports[`string > 42 > alphanumeric > with length 1`] = `"nNWbJM"`; exports[`string > 42 > alphanumeric > with length parameter 1`] = `"nNWbJ"`; @@ -46,7 +46,7 @@ exports[`string > 42 > alphanumeric > with length parameter 4`] = `"kB8HE"`; exports[`string > 42 > alphanumeric > with length parameter 5`] = `"13YIP"`; -exports[`string > 42 > alphanumeric > with length, casing and bannedChars 1`] = `"cvy4kvh"`; +exports[`string > 42 > alphanumeric > with length, casing and exclude 1`] = `"cvy4kvh"`; exports[`string > 42 > hexadecimal > noArgs 1`] = `"0x8"`; @@ -66,7 +66,7 @@ exports[`string > 42 > numeric > noArgs 1`] = `"4"`; exports[`string > 42 > numeric > with allowLeadingZeros 1`] = `"3"`; -exports[`string > 42 > numeric > with bannedDigits 1`] = `"7"`; +exports[`string > 42 > numeric > with exclude 1`] = `"7"`; exports[`string > 42 > numeric > with length 1`] = `"479177"`; @@ -80,7 +80,7 @@ exports[`string > 42 > numeric > with length parameter 4`] = `"46176"`; exports[`string > 42 > numeric > with length parameter 5`] = `"10978"`; -exports[`string > 42 > numeric > with length, allowLeadingZeros and bannedDigits 1`] = `"6890887"`; +exports[`string > 42 > numeric > with length, allowLeadingZeros and exclude 1`] = `"6890887"`; exports[`string > 42 > sample > noArgs 1`] = `"Cky2eiXX/J"`; @@ -106,14 +106,14 @@ exports[`string > 42 > uuid 5`] = `"d95f4984-24c2-410f-ac63-400d3bbbcc91"`; exports[`string > 1211 > alpha > noArgs 1`] = `"W"`; -exports[`string > 1211 > alpha > with bannedChars 1`] = `"X"`; - exports[`string > 1211 > alpha > with casing = lower 1`] = `"y"`; exports[`string > 1211 > alpha > with casing = mixed 1`] = `"W"`; exports[`string > 1211 > alpha > with casing = upper 1`] = `"Y"`; +exports[`string > 1211 > alpha > with exclude 1`] = `"X"`; + exports[`string > 1211 > alpha > with length 1`] = `"WxUOlg"`; exports[`string > 1211 > alpha > with length parameter 1`] = `"WxUOl"`; @@ -126,18 +126,18 @@ exports[`string > 1211 > alpha > with length parameter 4`] = `"iKMQa"`; exports[`string > 1211 > alpha > with length parameter 5`] = `"NIILR"`; -exports[`string > 1211 > alpha > with length, casing and bannedChars 1`] = `"yhywdcz"`; +exports[`string > 1211 > alpha > with length, casing and exclude 1`] = `"yhywdcz"`; exports[`string > 1211 > alphanumeric > noArgs 1`] = `"V"`; -exports[`string > 1211 > alphanumeric > with bannedChars 1`] = `"W"`; - exports[`string > 1211 > alphanumeric > with casing = lower 1`] = `"x"`; exports[`string > 1211 > alphanumeric > with casing = mixed 1`] = `"V"`; exports[`string > 1211 > alphanumeric > with casing = upper 1`] = `"X"`; +exports[`string > 1211 > alphanumeric > with exclude 1`] = `"W"`; + exports[`string > 1211 > alphanumeric > with length 1`] = `"VsTMd8"`; exports[`string > 1211 > alphanumeric > with length parameter 1`] = `"VsTMd"`; @@ -150,7 +150,7 @@ exports[`string > 1211 > alphanumeric > with length parameter 4`] = `"aHKO0"`; exports[`string > 1211 > alphanumeric > with length parameter 5`] = `"LFEJP"`; -exports[`string > 1211 > alphanumeric > with length, casing and bannedChars 1`] = `"yexv53z"`; +exports[`string > 1211 > alphanumeric > with length, casing and exclude 1`] = `"yexv53z"`; exports[`string > 1211 > hexadecimal > noArgs 1`] = `"0xE"`; @@ -170,7 +170,7 @@ exports[`string > 1211 > numeric > noArgs 1`] = `"9"`; exports[`string > 1211 > numeric > with allowLeadingZeros 1`] = `"9"`; -exports[`string > 1211 > numeric > with bannedDigits 1`] = `"9"`; +exports[`string > 1211 > numeric > with exclude 1`] = `"9"`; exports[`string > 1211 > numeric > with length 1`] = `"948721"`; @@ -184,7 +184,7 @@ exports[`string > 1211 > numeric > with length parameter 4`] = `"26780"`; exports[`string > 1211 > numeric > with length parameter 5`] = `"76678"`; -exports[`string > 1211 > numeric > with length, allowLeadingZeros and bannedDigits 1`] = `"9798609"`; +exports[`string > 1211 > numeric > with length, allowLeadingZeros and exclude 1`] = `"9798609"`; exports[`string > 1211 > sample > noArgs 1`] = `"wKti5-}$_/"`; @@ -210,14 +210,14 @@ exports[`string > 1211 > uuid 5`] = `"7b91ce88-effb-4d1d-93bb-ad759e00b86c"`; exports[`string > 1337 > alpha > noArgs 1`] = `"n"`; -exports[`string > 1337 > alpha > with bannedChars 1`] = `"v"`; - exports[`string > 1337 > alpha > with casing = lower 1`] = `"g"`; exports[`string > 1337 > alpha > with casing = mixed 1`] = `"n"`; exports[`string > 1337 > alpha > with casing = upper 1`] = `"G"`; +exports[`string > 1337 > alpha > with exclude 1`] = `"v"`; + exports[`string > 1337 > alpha > with length 1`] = `"nDiloC"`; exports[`string > 1337 > alpha > with length parameter 1`] = `"nDilo"`; @@ -230,18 +230,18 @@ exports[`string > 1337 > alpha > with length parameter 4`] = `"oMpfP"`; exports[`string > 1337 > alpha > with length parameter 5`] = `"ueGsg"`; -exports[`string > 1337 > alpha > with length, casing and bannedChars 1`] = `"eicdeih"`; +exports[`string > 1337 > alpha > with length, casing and exclude 1`] = `"eicdeih"`; exports[`string > 1337 > alphanumeric > noArgs 1`] = `"g"`; -exports[`string > 1337 > alphanumeric > with bannedChars 1`] = `"s"`; - exports[`string > 1337 > alphanumeric > with casing = lower 1`] = `"9"`; exports[`string > 1337 > alphanumeric > with casing = mixed 1`] = `"g"`; exports[`string > 1337 > alphanumeric > with casing = upper 1`] = `"9"`; +exports[`string > 1337 > alphanumeric > with exclude 1`] = `"s"`; + exports[`string > 1337 > alphanumeric > with length 1`] = `"gy9dhx"`; exports[`string > 1337 > alphanumeric > with length parameter 1`] = `"gy9dh"`; @@ -254,7 +254,7 @@ exports[`string > 1337 > alphanumeric > with length parameter 4`] = `"gJj7N"`; exports[`string > 1337 > alphanumeric > with length parameter 5`] = `"n5Cm7"`; -exports[`string > 1337 > alphanumeric > with length, casing and bannedChars 1`] = `"ag45age"`; +exports[`string > 1337 > alphanumeric > with length, casing and exclude 1`] = `"ag45age"`; exports[`string > 1337 > hexadecimal > noArgs 1`] = `"0x5"`; @@ -274,7 +274,7 @@ exports[`string > 1337 > numeric > noArgs 1`] = `"3"`; exports[`string > 1337 > numeric > with allowLeadingZeros 1`] = `"2"`; -exports[`string > 1337 > numeric > with bannedDigits 1`] = `"7"`; +exports[`string > 1337 > numeric > with exclude 1`] = `"7"`; exports[`string > 1337 > numeric > with length 1`] = `"351225"`; @@ -288,7 +288,7 @@ exports[`string > 1337 > numeric > with length parameter 4`] = `"37318"`; exports[`string > 1337 > numeric > with length parameter 5`] = `"40631"`; -exports[`string > 1337 > numeric > with length, allowLeadingZeros and bannedDigits 1`] = `"6706677"`; +exports[`string > 1337 > numeric > with length, allowLeadingZeros and exclude 1`] = `"6706677"`; exports[`string > 1337 > sample > noArgs 1`] = `"9U/4:SK$>6"`; diff --git a/test/random.spec.ts b/test/random.spec.ts index 2cdfd2c033c..2e84a713e15 100644 --- a/test/random.spec.ts +++ b/test/random.spec.ts @@ -197,7 +197,7 @@ describe('random', () => { }) ).toThrowError( new FakerError( - 'Unable to generate string, because all possible characters are banned.' + 'Unable to generate string, because all possible characters are excluded.' ) ); }); @@ -316,7 +316,7 @@ describe('random', () => { }) ).toThrowError( new FakerError( - 'Unable to generate string, because all possible characters are banned.' + 'Unable to generate string, because all possible characters are excluded.' ) ); }); @@ -413,7 +413,7 @@ describe('random', () => { }) ).toThrowError( new FakerError( - 'Unable to generate numeric string, because all possible digits are banned.' + 'Unable to generate numeric string, because all possible digits are excluded.' ) ); }); @@ -426,7 +426,7 @@ describe('random', () => { }) ).toThrowError( new FakerError( - 'Unable to generate numeric string, because all possible digits are banned.' + 'Unable to generate numeric string, because all possible digits are excluded.' ) ); }); diff --git a/test/string.spec.ts b/test/string.spec.ts index 66c6bc59dca..6d34f098653 100644 --- a/test/string.spec.ts +++ b/test/string.spec.ts @@ -14,11 +14,11 @@ describe('string', () => { .it('with casing = lower', { casing: 'lower' }) .it('with casing = upper', { casing: 'upper' }) .it('with casing = mixed', { casing: 'mixed' }) - .it('with bannedChars', { bannedChars: 'abcdefghijk' }) - .it('with length, casing and bannedChars', { + .it('with exclude', { exclude: 'abcdefghijk' }) + .it('with length, casing and exclude', { length: 7, casing: 'lower', - bannedChars: 'lmnopqrstu', + exclude: 'lmnopqrstu', }); }); @@ -29,11 +29,11 @@ describe('string', () => { .it('with casing = lower', { casing: 'lower' }) .it('with casing = upper', { casing: 'upper' }) .it('with casing = mixed', { casing: 'mixed' }) - .it('with bannedChars', { bannedChars: 'abcdefghijk12345' }) - .it('with length, casing and bannedChars', { + .it('with exclude', { exclude: 'abcdefghijk12345' }) + .it('with length, casing and exclude', { length: 7, casing: 'lower', - bannedChars: 'lmnopqrstu67890', + exclude: 'lmnopqrstu67890', }); }); @@ -56,11 +56,11 @@ describe('string', () => { .itRepeated('with length parameter', 5, 5) .it('with length', { length: 6 }) .it('with allowLeadingZeros', { allowLeadingZeros: true }) - .it('with bannedDigits', { bannedDigits: '12345' }) - .it('with length, allowLeadingZeros and bannedDigits', { + .it('with exclude', { exclude: '12345' }) + .it('with length, allowLeadingZeros and exclude', { length: 7, allowLeadingZeros: true, - bannedDigits: '12345', + exclude: '12345', }); }); @@ -114,7 +114,7 @@ describe('string', () => { const actual = faker.string.alpha({ length: 5, casing: 'lower', - bannedChars: ['a', 'p'], + exclude: ['a', 'p'], }); expect(actual).toHaveLength(5); @@ -125,35 +125,35 @@ describe('string', () => { const actual = faker.string.alpha({ length: 5, casing: 'lower', - bannedChars: 'ap', + exclude: 'ap', }); expect(actual).toHaveLength(5); expect(actual).toMatch(/^[b-oq-z]{5}$/); }); - it('should be able handle mistake in banned characters array', () => { + it('should be able handle mistake in excluded characters array', () => { const alphaText = faker.string.alpha({ length: 5, casing: 'lower', - bannedChars: ['a', 'a', 'p'], + exclude: ['a', 'a', 'p'], }); expect(alphaText).toHaveLength(5); expect(alphaText).toMatch(/^[b-oq-z]{5}$/); }); - it('should throw if all possible characters being banned', () => { - const bannedChars = 'abcdefghijklmnopqrstuvwxyz'.split(''); + it('should throw if all possible characters being excluded', () => { + const exclude = 'abcdefghijklmnopqrstuvwxyz'.split(''); expect(() => faker.string.alpha({ length: 5, casing: 'lower', - bannedChars, + exclude, }) ).toThrowError( new FakerError( - 'Unable to generate string, because all possible characters are banned.' + 'Unable to generate string, because all possible characters are excluded.' ) ); }); @@ -162,15 +162,15 @@ describe('string', () => { const input: { length: number; casing: 'mixed'; - bannedChars: string[]; + exclude: string[]; } = Object.freeze({ length: 5, casing: 'mixed', - bannedChars: ['a', '%'], + exclude: ['a', '%'], }); expect(() => faker.string.alpha(input)).not.toThrow(); - expect(input.bannedChars).toEqual(['a', '%']); + expect(input.exclude).toEqual(['a', '%']); }); }); @@ -206,92 +206,92 @@ describe('string', () => { ); it('should be able to ban all alphabetic characters', () => { - const bannedChars = 'abcdefghijklmnopqrstuvwxyz'.split(''); + const exclude = 'abcdefghijklmnopqrstuvwxyz'.split(''); const alphaText = faker.string.alphanumeric({ length: 5, casing: 'lower', - bannedChars, + exclude, }); expect(alphaText).toHaveLength(5); - for (const bannedChar of bannedChars) { - expect(alphaText).not.includes(bannedChar); + for (const excludedChar of exclude) { + expect(alphaText).not.includes(excludedChar); } }); it('should be able to ban all alphabetic characters via string', () => { - const bannedChars = 'abcdefghijklmnopqrstuvwxyz'; + const exclude = 'abcdefghijklmnopqrstuvwxyz'; const alphaText = faker.string.alphanumeric({ length: 5, casing: 'lower', - bannedChars, + exclude, }); expect(alphaText).toHaveLength(5); - for (const bannedChar of bannedChars) { - expect(alphaText).not.includes(bannedChar); + for (const excludedChar of exclude) { + expect(alphaText).not.includes(excludedChar); } }); it('should be able to ban all numeric characters', () => { - const bannedChars = '0123456789'.split(''); + const exclude = '0123456789'.split(''); const alphaText = faker.string.alphanumeric({ length: 5, - bannedChars, + exclude, }); expect(alphaText).toHaveLength(5); - for (const bannedChar of bannedChars) { - expect(alphaText).not.includes(bannedChar); + for (const excludedChar of exclude) { + expect(alphaText).not.includes(excludedChar); } }); it('should be able to ban all numeric characters via string', () => { - const bannedChars = '0123456789'; + const exclude = '0123456789'; const alphaText = faker.string.alphanumeric({ length: 5, - bannedChars, + exclude, }); expect(alphaText).toHaveLength(5); - for (const bannedChar of bannedChars) { - expect(alphaText).not.includes(bannedChar); + for (const excludedChar of exclude) { + expect(alphaText).not.includes(excludedChar); } }); - it('should be able to handle mistake in banned characters array', () => { + it('should be able to handle mistake in excluded characters array', () => { const alphaText = faker.string.alphanumeric({ length: 5, casing: 'lower', - bannedChars: ['a', 'p', 'a'], + exclude: ['a', 'p', 'a'], }); expect(alphaText).toHaveLength(5); expect(alphaText).toMatch(/^[0-9b-oq-z]{5}$/); }); - it('should throw if all possible characters being banned', () => { - const bannedChars = 'abcdefghijklmnopqrstuvwxyz0123456789'.split(''); + it('should throw if all possible characters being excluded', () => { + const exclude = 'abcdefghijklmnopqrstuvwxyz0123456789'.split(''); expect(() => faker.string.alphanumeric({ length: 5, casing: 'lower', - bannedChars, + exclude, }) ).toThrowError( new FakerError( - 'Unable to generate string, because all possible characters are banned.' + 'Unable to generate string, because all possible characters are excluded.' ) ); }); - it('should throw if all possible characters being banned via string', () => { - const bannedChars = 'abcdefghijklmnopqrstuvwxyz0123456789'; + it('should throw if all possible characters being excluded via string', () => { + const exclude = 'abcdefghijklmnopqrstuvwxyz0123456789'; expect(() => faker.string.alphanumeric({ length: 5, casing: 'lower', - bannedChars, + exclude, }) ).toThrowError(); }); @@ -299,14 +299,14 @@ describe('string', () => { it('should not mutate the input object', () => { const input: { length: number; - bannedChars: string[]; + exclude: string[]; } = Object.freeze({ length: 5, - bannedChars: ['a', '0', '%'], + exclude: ['a', '0', '%'], }); expect(() => faker.string.alphanumeric(input)).not.toThrow(); - expect(input.bannedChars).toEqual(['a', '0', '%']); + expect(input.exclude).toEqual(['a', '0', '%']); }); }); @@ -374,68 +374,68 @@ describe('string', () => { expect(actual).toMatch(/^[0-9]+$/); }); - it('should allow leading zeros via option and all other digits banned', () => { + it('should allow leading zeros via option and all other digits excluded', () => { const actual = faker.string.numeric({ length: 4, allowLeadingZeros: true, - bannedDigits: '123456789'.split(''), + exclude: '123456789'.split(''), }); expect(actual).toBe('0000'); }); - it('should allow leading zeros via option and all other digits banned via string', () => { + it('should allow leading zeros via option and all other digits excluded via string', () => { const actual = faker.string.numeric({ length: 4, allowLeadingZeros: true, - bannedDigits: '123456789', + exclude: '123456789', }); expect(actual).toBe('0000'); }); - it('should fail on leading zeros via option and all other digits banned', () => { + it('should fail on leading zeros via option and all other digits excluded', () => { expect(() => faker.string.numeric({ length: 4, allowLeadingZeros: false, - bannedDigits: '123456789'.split(''), + exclude: '123456789'.split(''), }) ).toThrowError( new FakerError( - 'Unable to generate numeric string, because all possible digits are banned.' + 'Unable to generate numeric string, because all possible digits are excluded.' ) ); }); - it('should fail on leading zeros via option and all other digits banned via string', () => { + it('should fail on leading zeros via option and all other digits excluded via string', () => { expect(() => faker.string.numeric({ length: 4, allowLeadingZeros: false, - bannedDigits: '123456789', + exclude: '123456789', }) ).toThrowError( new FakerError( - 'Unable to generate numeric string, because all possible digits are banned.' + 'Unable to generate numeric string, because all possible digits are excluded.' ) ); }); - it('should ban all digits passed via bannedDigits', () => { + it('should ban all digits passed via exclude', () => { const actual = faker.string.numeric({ length: 1000, - bannedDigits: 'c84U1'.split(''), + exclude: 'c84U1'.split(''), }); expect(actual).toHaveLength(1000); expect(actual).toMatch(/^[0235679]{1000}$/); }); - it('should ban all digits passed via bannedDigits via string', () => { + it('should ban all digits passed via exclude via string', () => { const actual = faker.string.numeric({ length: 1000, - bannedDigits: 'c84U1', + exclude: 'c84U1', }); expect(actual).toHaveLength(1000);