From 3c5ceec96d59c4e6c17fdf6e9ffc785a5fb92056 Mon Sep 17 00:00:00 2001 From: Suyash Gulati Date: Mon, 27 Nov 2023 00:04:38 +0530 Subject: [PATCH 1/5] refactor(helper): deprecate replaceSymbolWithNumber (#2557) --- src/modules/helpers/index.ts | 63 +++++++++++++++++++++++++++++------- src/modules/phone/index.ts | 3 +- 2 files changed, 53 insertions(+), 13 deletions(-) diff --git a/src/modules/helpers/index.ts b/src/modules/helpers/index.ts index aaf0e231a0b..9a681da9641 100644 --- a/src/modules/helpers/index.ts +++ b/src/modules/helpers/index.ts @@ -158,6 +158,45 @@ function legacyRegexpStringParse( return string; } +/** + * Parses the given string symbol by symbol and replaces the placeholders with digits (`0` - `9`). + * `!` will be replaced by digits >=2 (`2` - `9`). + * + * Note: This method will be removed in v9. + * + * @internal + * + * @param faker The Faker instance to use. + * @param string The template string to parse. Defaults to `''`. + * @param symbol The symbol to replace with digits. Defaults to `'#'`. + * + * @example + * legacyReplaceSymbolWithNumber(faker) // '' + * legacyReplaceSymbolWithNumber(faker, '#####') // '04812' + * legacyReplaceSymbolWithNumber(faker, '!####') // '27378' + * legacyReplaceSymbolWithNumber(faker, 'Your pin is: !####') // '29841' + * + * @since 8.4.0 + */ +export function legacyReplaceSymbolWithNumber( + faker: SimpleFaker, + string: string = '', + symbol: string = '#' +): string { + let str = ''; + for (let i = 0; i < string.length; i++) { + if (string.charAt(i) === symbol) { + str += faker.number.int(9); + } else if (string.charAt(i) === '!') { + str += faker.number.int({ min: 2, max: 9 }); + } else { + str += string.charAt(i); + } + } + + return str; +} + /** * Module with various helper methods providing basic (seed-dependent) operations useful for implementing faker methods (without methods requiring localized data). */ @@ -198,6 +237,8 @@ export class SimpleHelpersModule extends SimpleModuleBase { * @param string The template string to parse. Defaults to `''`. * @param symbol The symbol to replace with digits. Defaults to `'#'`. * + * @see faker.string.numeric(): For the replacement method. + * * @example * faker.helpers.replaceSymbolWithNumber() // '' * faker.helpers.replaceSymbolWithNumber('#####') // '04812' @@ -205,20 +246,18 @@ export class SimpleHelpersModule extends SimpleModuleBase { * faker.helpers.replaceSymbolWithNumber('Your pin is: !####') // '29841' * * @since 2.0.1 + * + * @deprecated Use `faker.string.numeric()` instead. Example: `value.replace(/#+/g, (m) => faker.string.numeric(m.length));` */ replaceSymbolWithNumber(string: string = '', symbol: string = '#'): string { - let str = ''; - for (let i = 0; i < string.length; i++) { - if (string.charAt(i) === symbol) { - str += this.faker.number.int(9); - } else if (string.charAt(i) === '!') { - str += this.faker.number.int({ min: 2, max: 9 }); - } else { - str += string.charAt(i); - } - } + deprecated({ + deprecated: 'faker.helpers.replaceSymbolWithNumber', + proposed: 'string.replace(/#+/g, (m) => faker.string.numeric(m.length))', + since: '8.4', + until: '9.0', + }); - return str; + return legacyReplaceSymbolWithNumber(this.faker, string, symbol); } /** @@ -309,7 +348,7 @@ export class SimpleHelpersModule extends SimpleModuleBase { // default values required for calling method without arguments string = legacyRegexpStringParse(this.faker, string); // replace [4-9] with a random number in range etc... - string = this.replaceSymbolWithNumber(string, symbol); // replace ### with random numbers + string = legacyReplaceSymbolWithNumber(this.faker, string, symbol); // replace ### with random numbers const checkNum = luhnCheckValue(string); return string.replace('L', String(checkNum)); diff --git a/src/modules/phone/index.ts b/src/modules/phone/index.ts index 6747e35d10c..833938d71fc 100644 --- a/src/modules/phone/index.ts +++ b/src/modules/phone/index.ts @@ -1,5 +1,6 @@ import { deprecated } from '../../internal/deprecated'; import { ModuleBase } from '../../internal/module-base'; +import { legacyReplaceSymbolWithNumber } from '../helpers'; /** * Module to generate phone-related data. @@ -68,7 +69,7 @@ export class PhoneModule extends ModuleBase { this.faker.helpers.arrayElement( this.faker.definitions.phone_number.formats ); - return this.faker.helpers.replaceSymbolWithNumber(format); + return legacyReplaceSymbolWithNumber(this.faker, format); } /** From 5e0f4f7dd1497e80c2e725a7bee3887abaab25a7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 Nov 2023 16:04:06 +0100 Subject: [PATCH 2/5] chore(deps): update devdependencies (#2561) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: ST-DDT --- package.json | 16 +-- pnpm-lock.yaml | 354 ++++++++++++++++++++++++------------------------- 2 files changed, 185 insertions(+), 185 deletions(-) diff --git a/package.json b/package.json index a0df05738e1..5e0de3cd33f 100644 --- a/package.json +++ b/package.json @@ -94,19 +94,19 @@ "@eslint-types/prettier": "5.0.1-1", "@eslint-types/typescript-eslint": "~6.12.0", "@eslint-types/unicorn": "~49.0.0", - "@types/markdown-it": "~13.0.6", - "@types/node": "~20.9.2", - "@types/sanitize-html": "~2.9.4", - "@types/semver": "~7.5.5", - "@types/validator": "~13.11.6", + "@types/markdown-it": "~13.0.7", + "@types/node": "~20.10.0", + "@types/sanitize-html": "~2.9.5", + "@types/semver": "~7.5.6", + "@types/validator": "~13.11.7", "@typescript-eslint/eslint-plugin": "~6.12.0", "@typescript-eslint/parser": "~6.12.0", "@vitest/coverage-v8": "~0.34.6", "@vitest/ui": "~0.34.7", "@vueuse/core": "~10.6.1", "conventional-changelog-cli": "~4.1.0", - "cypress": "~13.5.1", - "esbuild": "~0.19.6", + "cypress": "~13.6.0", + "esbuild": "~0.19.8", "eslint": "~8.54.0", "eslint-config-prettier": "~9.0.0", "eslint-define-config": "~2.0.0", @@ -131,7 +131,7 @@ "vite": "~4.5.0", "vitepress": "1.0.0-beta.7", "vitest": "~0.34.6", - "vue": "~3.3.8" + "vue": "~3.3.9" }, "packageManager": "pnpm@8.5.1", "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fdda6adc0a7..5ad13cc710e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,20 +23,20 @@ devDependencies: specifier: ~49.0.0 version: 49.0.0 '@types/markdown-it': - specifier: ~13.0.6 - version: 13.0.6 + specifier: ~13.0.7 + version: 13.0.7 '@types/node': - specifier: ~20.9.2 - version: 20.9.2 + specifier: ~20.10.0 + version: 20.10.0 '@types/sanitize-html': - specifier: ~2.9.4 - version: 2.9.4 + specifier: ~2.9.5 + version: 2.9.5 '@types/semver': - specifier: ~7.5.5 - version: 7.5.5 + specifier: ~7.5.6 + version: 7.5.6 '@types/validator': - specifier: ~13.11.6 - version: 13.11.6 + specifier: ~13.11.7 + version: 13.11.7 '@typescript-eslint/eslint-plugin': specifier: ~6.12.0 version: 6.12.0(@typescript-eslint/parser@6.12.0)(eslint@8.54.0)(typescript@4.9.5) @@ -51,16 +51,16 @@ devDependencies: version: 0.34.7(vitest@0.34.6) '@vueuse/core': specifier: ~10.6.1 - version: 10.6.1(vue@3.3.8) + version: 10.6.1(vue@3.3.9) conventional-changelog-cli: specifier: ~4.1.0 version: 4.1.0 cypress: - specifier: ~13.5.1 - version: 13.5.1 + specifier: ~13.6.0 + version: 13.6.0 esbuild: - specifier: ~0.19.6 - version: 0.19.6 + specifier: ~0.19.8 + version: 0.19.8 eslint: specifier: ~8.54.0 version: 8.54.0 @@ -126,16 +126,16 @@ devDependencies: version: 13.11.0 vite: specifier: ~4.5.0 - version: 4.5.0(@types/node@20.9.2) + version: 4.5.0(@types/node@20.10.0) vitepress: specifier: 1.0.0-beta.7 - version: 1.0.0-beta.7(@algolia/client-search@4.19.1)(@types/node@20.9.2)(search-insights@2.11.0)(typescript@4.9.5) + version: 1.0.0-beta.7(@algolia/client-search@4.19.1)(@types/node@20.10.0)(search-insights@2.11.0)(typescript@4.9.5) vitest: specifier: ~0.34.6 version: 0.34.6(@vitest/ui@0.34.7) vue: - specifier: ~3.3.8 - version: 3.3.8(typescript@4.9.5) + specifier: ~3.3.9 + version: 3.3.9(typescript@4.9.5) packages: @@ -486,8 +486,8 @@ packages: dev: true optional: true - /@esbuild/android-arm64@0.19.6: - resolution: {integrity: sha512-KQ/hbe9SJvIJ4sR+2PcZ41IBV+LPJyYp6V1K1P1xcMRup9iYsBoQn4MzE3mhMLOld27Au2eDcLlIREeKGUXpHQ==} + /@esbuild/android-arm64@0.19.8: + resolution: {integrity: sha512-B8JbS61bEunhfx8kasogFENgQfr/dIp+ggYXwTqdbMAgGDhRa3AaPpQMuQU0rNxDLECj6FhDzk1cF9WHMVwrtA==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -504,8 +504,8 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.19.6: - resolution: {integrity: sha512-muPzBqXJKCbMYoNbb1JpZh/ynl0xS6/+pLjrofcR3Nad82SbsCogYzUE6Aq9QT3cLP0jR/IVK/NHC9b90mSHtg==} + /@esbuild/android-arm@0.19.8: + resolution: {integrity: sha512-31E2lxlGM1KEfivQl8Yf5aYU/mflz9g06H6S15ITUFQueMFtFjESRMoDSkvMo8thYvLBax+VKTPlpnx+sPicOA==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -522,8 +522,8 @@ packages: dev: true optional: true - /@esbuild/android-x64@0.19.6: - resolution: {integrity: sha512-VVJVZQ7p5BBOKoNxd0Ly3xUM78Y4DyOoFKdkdAe2m11jbh0LEU4bPles4e/72EMl4tapko8o915UalN/5zhspg==} + /@esbuild/android-x64@0.19.8: + resolution: {integrity: sha512-rdqqYfRIn4jWOp+lzQttYMa2Xar3OK9Yt2fhOhzFXqg0rVWEfSclJvZq5fZslnz6ypHvVf3CT7qyf0A5pM682A==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -540,8 +540,8 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64@0.19.6: - resolution: {integrity: sha512-91LoRp/uZAKx6ESNspL3I46ypwzdqyDLXZH7x2QYCLgtnaU08+AXEbabY2yExIz03/am0DivsTtbdxzGejfXpA==} + /@esbuild/darwin-arm64@0.19.8: + resolution: {integrity: sha512-RQw9DemMbIq35Bprbboyf8SmOr4UXsRVxJ97LgB55VKKeJOOdvsIPy0nFyF2l8U+h4PtBx/1kRf0BelOYCiQcw==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -558,8 +558,8 @@ packages: dev: true optional: true - /@esbuild/darwin-x64@0.19.6: - resolution: {integrity: sha512-QCGHw770ubjBU1J3ZkFJh671MFajGTYMZumPs9E/rqU52md6lIil97BR0CbPq6U+vTh3xnTNDHKRdR8ggHnmxQ==} + /@esbuild/darwin-x64@0.19.8: + resolution: {integrity: sha512-3sur80OT9YdeZwIVgERAysAbwncom7b4bCI2XKLjMfPymTud7e/oY4y+ci1XVp5TfQp/bppn7xLw1n/oSQY3/Q==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -576,8 +576,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64@0.19.6: - resolution: {integrity: sha512-J53d0jGsDcLzWk9d9SPmlyF+wzVxjXpOH7jVW5ae7PvrDst4kiAz6sX+E8btz0GB6oH12zC+aHRD945jdjF2Vg==} + /@esbuild/freebsd-arm64@0.19.8: + resolution: {integrity: sha512-WAnPJSDattvS/XtPCTj1tPoTxERjcTpH6HsMr6ujTT+X6rylVe8ggxk8pVxzf5U1wh5sPODpawNicF5ta/9Tmw==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -594,8 +594,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64@0.19.6: - resolution: {integrity: sha512-hn9qvkjHSIB5Z9JgCCjED6YYVGCNpqB7dEGavBdG6EjBD8S/UcNUIlGcB35NCkMETkdYwfZSvD9VoDJX6VeUVA==} + /@esbuild/freebsd-x64@0.19.8: + resolution: {integrity: sha512-ICvZyOplIjmmhjd6mxi+zxSdpPTKFfyPPQMQTK/w+8eNK6WV01AjIztJALDtwNNfFhfZLux0tZLC+U9nSyA5Zg==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -612,8 +612,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm64@0.19.6: - resolution: {integrity: sha512-HQCOrk9XlH3KngASLaBfHpcoYEGUt829A9MyxaI8RMkfRA8SakG6YQEITAuwmtzFdEu5GU4eyhKcpv27dFaOBg==} + /@esbuild/linux-arm64@0.19.8: + resolution: {integrity: sha512-z1zMZivxDLHWnyGOctT9JP70h0beY54xDDDJt4VpTX+iwA77IFsE1vCXWmprajJGa+ZYSqkSbRQ4eyLCpCmiCQ==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -630,8 +630,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm@0.19.6: - resolution: {integrity: sha512-G8IR5zFgpXad/Zp7gr7ZyTKyqZuThU6z1JjmRyN1vSF8j0bOlGzUwFSMTbctLAdd7QHpeyu0cRiuKrqK1ZTwvQ==} + /@esbuild/linux-arm@0.19.8: + resolution: {integrity: sha512-H4vmI5PYqSvosPaTJuEppU9oz1dq2A7Mr2vyg5TF9Ga+3+MGgBdGzcyBP7qK9MrwFQZlvNyJrvz6GuCaj3OukQ==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -648,8 +648,8 @@ packages: dev: true optional: true - /@esbuild/linux-ia32@0.19.6: - resolution: {integrity: sha512-22eOR08zL/OXkmEhxOfshfOGo8P69k8oKHkwkDrUlcB12S/sw/+COM4PhAPT0cAYW/gpqY2uXp3TpjQVJitz7w==} + /@esbuild/linux-ia32@0.19.8: + resolution: {integrity: sha512-1a8suQiFJmZz1khm/rDglOc8lavtzEMRo0v6WhPgxkrjcU0LkHj+TwBrALwoz/OtMExvsqbbMI0ChyelKabSvQ==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -666,8 +666,8 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.19.6: - resolution: {integrity: sha512-82RvaYAh/SUJyjWA8jDpyZCHQjmEggL//sC7F3VKYcBMumQjUL3C5WDl/tJpEiKtt7XrWmgjaLkrk205zfvwTA==} + /@esbuild/linux-loong64@0.19.8: + resolution: {integrity: sha512-fHZWS2JJxnXt1uYJsDv9+b60WCc2RlvVAy1F76qOLtXRO+H4mjt3Tr6MJ5l7Q78X8KgCFudnTuiQRBhULUyBKQ==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -684,8 +684,8 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el@0.19.6: - resolution: {integrity: sha512-8tvnwyYJpR618vboIv2l8tK2SuK/RqUIGMfMENkeDGo3hsEIrpGldMGYFcWxWeEILe5Fi72zoXLmhZ7PR23oQA==} + /@esbuild/linux-mips64el@0.19.8: + resolution: {integrity: sha512-Wy/z0EL5qZYLX66dVnEg9riiwls5IYnziwuju2oUiuxVc+/edvqXa04qNtbrs0Ukatg5HEzqT94Zs7J207dN5Q==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -702,8 +702,8 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64@0.19.6: - resolution: {integrity: sha512-Qt+D7xiPajxVNk5tQiEJwhmarNnLPdjXAoA5uWMpbfStZB0+YU6a3CtbWYSy+sgAsnyx4IGZjWsTzBzrvg/fMA==} + /@esbuild/linux-ppc64@0.19.8: + resolution: {integrity: sha512-ETaW6245wK23YIEufhMQ3HSeHO7NgsLx8gygBVldRHKhOlD1oNeNy/P67mIh1zPn2Hr2HLieQrt6tWrVwuqrxg==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -720,8 +720,8 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64@0.19.6: - resolution: {integrity: sha512-lxRdk0iJ9CWYDH1Wpnnnc640ajF4RmQ+w6oHFZmAIYu577meE9Ka/DCtpOrwr9McMY11ocbp4jirgGgCi7Ls/g==} + /@esbuild/linux-riscv64@0.19.8: + resolution: {integrity: sha512-T2DRQk55SgoleTP+DtPlMrxi/5r9AeFgkhkZ/B0ap99zmxtxdOixOMI570VjdRCs9pE4Wdkz7JYrsPvsl7eESg==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -738,8 +738,8 @@ packages: dev: true optional: true - /@esbuild/linux-s390x@0.19.6: - resolution: {integrity: sha512-MopyYV39vnfuykHanRWHGRcRC3AwU7b0QY4TI8ISLfAGfK+tMkXyFuyT1epw/lM0pflQlS53JoD22yN83DHZgA==} + /@esbuild/linux-s390x@0.19.8: + resolution: {integrity: sha512-NPxbdmmo3Bk7mbNeHmcCd7R7fptJaczPYBaELk6NcXxy7HLNyWwCyDJ/Xx+/YcNH7Im5dHdx9gZ5xIwyliQCbg==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -756,8 +756,8 @@ packages: dev: true optional: true - /@esbuild/linux-x64@0.19.6: - resolution: {integrity: sha512-UWcieaBzsN8WYbzFF5Jq7QULETPcQvlX7KL4xWGIB54OknXJjBO37sPqk7N82WU13JGWvmDzFBi1weVBajPovg==} + /@esbuild/linux-x64@0.19.8: + resolution: {integrity: sha512-lytMAVOM3b1gPypL2TRmZ5rnXl7+6IIk8uB3eLsV1JwcizuolblXRrc5ShPrO9ls/b+RTp+E6gbsuLWHWi2zGg==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -774,8 +774,8 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64@0.19.6: - resolution: {integrity: sha512-EpWiLX0fzvZn1wxtLxZrEW+oQED9Pwpnh+w4Ffv8ZLuMhUoqR9q9rL4+qHW8F4Mg5oQEKxAoT0G+8JYNqCiR6g==} + /@esbuild/netbsd-x64@0.19.8: + resolution: {integrity: sha512-hvWVo2VsXz/8NVt1UhLzxwAfo5sioj92uo0bCfLibB0xlOmimU/DeAEsQILlBQvkhrGjamP0/el5HU76HAitGw==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -792,8 +792,8 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64@0.19.6: - resolution: {integrity: sha512-fFqTVEktM1PGs2sLKH4M5mhAVEzGpeZJuasAMRnvDZNCV0Cjvm1Hu35moL2vC0DOrAQjNTvj4zWrol/lwQ8Deg==} + /@esbuild/openbsd-x64@0.19.8: + resolution: {integrity: sha512-/7Y7u77rdvmGTxR83PgaSvSBJCC2L3Kb1M/+dmSIvRvQPXXCuC97QAwMugBNG0yGcbEGfFBH7ojPzAOxfGNkwQ==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -810,8 +810,8 @@ packages: dev: true optional: true - /@esbuild/sunos-x64@0.19.6: - resolution: {integrity: sha512-M+XIAnBpaNvaVAhbe3uBXtgWyWynSdlww/JNZws0FlMPSBy+EpatPXNIlKAdtbFVII9OpX91ZfMb17TU3JKTBA==} + /@esbuild/sunos-x64@0.19.8: + resolution: {integrity: sha512-9Lc4s7Oi98GqFA4HzA/W2JHIYfnXbUYgekUP/Sm4BG9sfLjyv6GKKHKKVs83SMicBF2JwAX6A1PuOLMqpD001w==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -828,8 +828,8 @@ packages: dev: true optional: true - /@esbuild/win32-arm64@0.19.6: - resolution: {integrity: sha512-2DchFXn7vp/B6Tc2eKdTsLzE0ygqKkNUhUBCNtMx2Llk4POIVMUq5rUYjdcedFlGLeRe1uLCpVvCmE+G8XYybA==} + /@esbuild/win32-arm64@0.19.8: + resolution: {integrity: sha512-rq6WzBGjSzihI9deW3fC2Gqiak68+b7qo5/3kmB6Gvbh/NYPA0sJhrnp7wgV4bNwjqM+R2AApXGxMO7ZoGhIJg==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -846,8 +846,8 @@ packages: dev: true optional: true - /@esbuild/win32-ia32@0.19.6: - resolution: {integrity: sha512-PBo/HPDQllyWdjwAVX+Gl2hH0dfBydL97BAH/grHKC8fubqp02aL4S63otZ25q3sBdINtOBbz1qTZQfXbP4VBg==} + /@esbuild/win32-ia32@0.19.8: + resolution: {integrity: sha512-AIAbverbg5jMvJznYiGhrd3sumfwWs8572mIJL5NQjJa06P8KfCPWZQ0NwZbPQnbQi9OWSZhFVSUWjjIrn4hSw==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -864,8 +864,8 @@ packages: dev: true optional: true - /@esbuild/win32-x64@0.19.6: - resolution: {integrity: sha512-OE7yIdbDif2kKfrGa+V0vx/B3FJv2L4KnIiLlvtibPyO9UkgO3rzYE0HhpREo2vmJ1Ixq1zwm9/0er+3VOSZJA==} + /@esbuild/win32-x64@0.19.8: + resolution: {integrity: sha512-bfZ0cQ1uZs2PqpulNL5j/3w+GDhP36k1K5c38QdQg+Swy51jFZWWeIkteNsufkQxp986wnqRRsb/bHbY1WQ7TA==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -1175,8 +1175,8 @@ packages: resolution: {integrity: sha512-yg6E+u0/+Zjva+buc3EIb+29XEg4wltq7cSmd4Uc2EE/1nUVmxyzpX6gUXD0V8jIrG0r7YeOGVIbYRkxeooCtw==} dev: true - /@types/markdown-it@13.0.6: - resolution: {integrity: sha512-0VqpvusJn1/lwRegCxcHVdmLfF+wIsprsKMC9xW8UPcTxhFcQtoN/fBU1zMe8pH7D/RuueMh2CaBaNv+GrLqTw==} + /@types/markdown-it@13.0.7: + resolution: {integrity: sha512-U/CBi2YUUcTHBt5tjO2r5QV/x0Po6nsYwQU4Y04fBS6vfoImaiZ6f8bi3CjTCxBPQSO1LMyUqkByzi8AidyxfA==} dependencies: '@types/linkify-it': 3.0.5 '@types/mdurl': 1.0.5 @@ -1196,8 +1196,8 @@ packages: undici-types: 5.26.5 dev: true - /@types/node@20.9.2: - resolution: {integrity: sha512-WHZXKFCEyIUJzAwh3NyyTHYSR35SevJ6mZ1nWwJafKtiQbqRTIKSRcw3Ma3acqgsent3RRDqeVwpHntMk+9irg==} + /@types/node@20.10.0: + resolution: {integrity: sha512-D0WfRmU9TQ8I9PFx9Yc+EBHw+vSpIub4IDvQivcp26PtPrdMGAq5SDcpXEo/epqa/DXotVpekHiLNTg3iaKXBQ==} dependencies: undici-types: 5.26.5 dev: true @@ -1206,14 +1206,14 @@ packages: resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} dev: true - /@types/sanitize-html@2.9.4: - resolution: {integrity: sha512-Ym4hjmAFxF/eux7nW2yDPAj2o9RYh0vP/9V5ECoHtgJ/O9nPGslUd20CMn6WatRMlFVfjMTg3lMcWq8YyO6QnA==} + /@types/sanitize-html@2.9.5: + resolution: {integrity: sha512-2Sr1vd8Dw+ypsg/oDDfZ57OMSG2Befs+l2CMyCC5bVSK3CpE7lTB2aNlbbWzazgVA+Qqfuholwom6x/mWd1qmw==} dependencies: htmlparser2: 8.0.2 dev: true - /@types/semver@7.5.5: - resolution: {integrity: sha512-+d+WYC1BxJ6yVOgUgzK8gWvp5qF8ssV5r4nsDcZWKRWcDQLQ619tvWAxJQYGgBrO1MnLJC7a5GtiYsAoQ47dJg==} + /@types/semver@7.5.6: + resolution: {integrity: sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==} dev: true /@types/sinonjs__fake-timers@8.1.1: @@ -1224,8 +1224,8 @@ packages: resolution: {integrity: sha512-m04Om5Gz6kbjUwAQ7XJJQ30OdEFsSmAVsvn4NYwcTRyMVpKKa1aPuESw1n2CxS5fYkOQv3nHgDKeNa8e76fUkw==} dev: true - /@types/validator@13.11.6: - resolution: {integrity: sha512-HUgHujPhKuNzgNXBRZKYexwoG+gHKU+tnfPqjWXFghZAnn73JElicMkuSKJyLGr9JgyA8IgK7fj88IyA9rwYeQ==} + /@types/validator@13.11.7: + resolution: {integrity: sha512-q0JomTsJ2I5Mv7dhHhQLGjMvX0JJm5dyZ1DXQySIUzU1UlwzB8bt+R6+LODUbz0UDIOvEzGc28tk27gBJw2N8Q==} dev: true /@types/web-bluetooth@0.0.20: @@ -1236,7 +1236,7 @@ packages: resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} requiresBuild: true dependencies: - '@types/node': 20.9.2 + '@types/node': 20.10.0 dev: true optional: true @@ -1386,7 +1386,7 @@ packages: dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.54.0) '@types/json-schema': 7.0.15 - '@types/semver': 7.5.5 + '@types/semver': 7.5.6 '@typescript-eslint/scope-manager': 6.11.0 '@typescript-eslint/types': 6.11.0 '@typescript-eslint/typescript-estree': 6.11.0(typescript@4.9.5) @@ -1405,7 +1405,7 @@ packages: dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.54.0) '@types/json-schema': 7.0.15 - '@types/semver': 7.5.5 + '@types/semver': 7.5.6 '@typescript-eslint/scope-manager': 6.12.0 '@typescript-eslint/types': 6.12.0 '@typescript-eslint/typescript-estree': 6.12.0(typescript@4.9.5) @@ -1436,15 +1436,15 @@ packages: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true - /@vitejs/plugin-vue@4.5.0(vite@4.5.0)(vue@3.3.8): + /@vitejs/plugin-vue@4.5.0(vite@4.5.0)(vue@3.3.9): resolution: {integrity: sha512-a2WSpP8X8HTEww/U00bU4mX1QpLINNuz/2KMNpLsdu3BzOpak3AGI1CJYBTXcc4SPhaD0eNRUp7IyQK405L5dQ==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: vite: ^4.0.0 || ^5.0.0 vue: ^3.2.25 dependencies: - vite: 4.5.0(@types/node@20.9.2) - vue: 3.3.8(typescript@4.9.5) + vite: 4.5.0(@types/node@20.10.0) + vue: 3.3.9(typescript@4.9.5) dev: true /@vitest/coverage-v8@0.34.6(vitest@0.34.6): @@ -1529,106 +1529,106 @@ packages: pretty-format: 29.7.0 dev: true - /@vue/compiler-core@3.3.8: - resolution: {integrity: sha512-hN/NNBUECw8SusQvDSqqcVv6gWq8L6iAktUR0UF3vGu2OhzRqcOiAno0FmBJWwxhYEXRlQJT5XnoKsVq1WZx4g==} + /@vue/compiler-core@3.3.9: + resolution: {integrity: sha512-+/Lf68Vr/nFBA6ol4xOtJrW+BQWv3QWKfRwGSm70jtXwfhZNF4R/eRgyVJYoxFRhdCTk/F6g99BP0ffPgZihfQ==} dependencies: '@babel/parser': 7.23.3 - '@vue/shared': 3.3.8 + '@vue/shared': 3.3.9 estree-walker: 2.0.2 source-map-js: 1.0.2 dev: true - /@vue/compiler-dom@3.3.8: - resolution: {integrity: sha512-+PPtv+p/nWDd0AvJu3w8HS0RIm/C6VGBIRe24b9hSyNWOAPEUosFZ5diwawwP8ip5sJ8n0Pe87TNNNHnvjs0FQ==} + /@vue/compiler-dom@3.3.9: + resolution: {integrity: sha512-nfWubTtLXuT4iBeDSZ5J3m218MjOy42Vp2pmKVuBKo2/BLcrFUX8nCSr/bKRFiJ32R8qbdnnnBgRn9AdU5v0Sg==} dependencies: - '@vue/compiler-core': 3.3.8 - '@vue/shared': 3.3.8 + '@vue/compiler-core': 3.3.9 + '@vue/shared': 3.3.9 dev: true - /@vue/compiler-sfc@3.3.8: - resolution: {integrity: sha512-WMzbUrlTjfYF8joyT84HfwwXo+8WPALuPxhy+BZ6R4Aafls+jDBnSz8PDz60uFhuqFbl3HxRfxvDzrUf3THwpA==} + /@vue/compiler-sfc@3.3.9: + resolution: {integrity: sha512-wy0CNc8z4ihoDzjASCOCsQuzW0A/HP27+0MDSSICMjVIFzk/rFViezkR3dzH+miS2NDEz8ywMdbjO5ylhOLI2A==} dependencies: '@babel/parser': 7.23.3 - '@vue/compiler-core': 3.3.8 - '@vue/compiler-dom': 3.3.8 - '@vue/compiler-ssr': 3.3.8 - '@vue/reactivity-transform': 3.3.8 - '@vue/shared': 3.3.8 + '@vue/compiler-core': 3.3.9 + '@vue/compiler-dom': 3.3.9 + '@vue/compiler-ssr': 3.3.9 + '@vue/reactivity-transform': 3.3.9 + '@vue/shared': 3.3.9 estree-walker: 2.0.2 magic-string: 0.30.5 postcss: 8.4.31 source-map-js: 1.0.2 dev: true - /@vue/compiler-ssr@3.3.8: - resolution: {integrity: sha512-hXCqQL/15kMVDBuoBYpUnSYT8doDNwsjvm3jTefnXr+ytn294ySnT8NlsFHmTgKNjwpuFy7XVV8yTeLtNl/P6w==} + /@vue/compiler-ssr@3.3.9: + resolution: {integrity: sha512-NO5oobAw78R0G4SODY5A502MGnDNiDjf6qvhn7zD7TJGc8XDeIEw4fg6JU705jZ/YhuokBKz0A5a/FL/XZU73g==} dependencies: - '@vue/compiler-dom': 3.3.8 - '@vue/shared': 3.3.8 + '@vue/compiler-dom': 3.3.9 + '@vue/shared': 3.3.9 dev: true /@vue/devtools-api@6.5.1: resolution: {integrity: sha512-+KpckaAQyfbvshdDW5xQylLni1asvNSGme1JFs8I1+/H5pHEhqUKMEQD/qn3Nx5+/nycBq11qAEi8lk+LXI2dA==} dev: true - /@vue/reactivity-transform@3.3.8: - resolution: {integrity: sha512-49CvBzmZNtcHua0XJ7GdGifM8GOXoUMOX4dD40Y5DxI3R8OUhMlvf2nvgUAcPxaXiV5MQQ1Nwy09ADpnLQUqRw==} + /@vue/reactivity-transform@3.3.9: + resolution: {integrity: sha512-HnUFm7Ry6dFa4Lp63DAxTixUp8opMtQr6RxQCpDI1vlh12rkGIeYqMvJtK+IKyEfEOa2I9oCkD1mmsPdaGpdVg==} dependencies: '@babel/parser': 7.23.3 - '@vue/compiler-core': 3.3.8 - '@vue/shared': 3.3.8 + '@vue/compiler-core': 3.3.9 + '@vue/shared': 3.3.9 estree-walker: 2.0.2 magic-string: 0.30.5 dev: true - /@vue/reactivity@3.3.8: - resolution: {integrity: sha512-ctLWitmFBu6mtddPyOKpHg8+5ahouoTCRtmAHZAXmolDtuZXfjL2T3OJ6DL6ezBPQB1SmMnpzjiWjCiMYmpIuw==} + /@vue/reactivity@3.3.9: + resolution: {integrity: sha512-VmpIqlNp+aYDg2X0xQhJqHx9YguOmz2UxuUJDckBdQCNkipJvfk9yA75woLWElCa0Jtyec3lAAt49GO0izsphw==} dependencies: - '@vue/shared': 3.3.8 + '@vue/shared': 3.3.9 dev: true - /@vue/runtime-core@3.3.8: - resolution: {integrity: sha512-qurzOlb6q26KWQ/8IShHkMDOuJkQnQcTIp1sdP4I9MbCf9FJeGVRXJFr2mF+6bXh/3Zjr9TDgURXrsCr9bfjUw==} + /@vue/runtime-core@3.3.9: + resolution: {integrity: sha512-xxaG9KvPm3GTRuM4ZyU8Tc+pMVzcu6eeoSRQJ9IE7NmCcClW6z4B3Ij6L4EDl80sxe/arTtQ6YmgiO4UZqRc+w==} dependencies: - '@vue/reactivity': 3.3.8 - '@vue/shared': 3.3.8 + '@vue/reactivity': 3.3.9 + '@vue/shared': 3.3.9 dev: true - /@vue/runtime-dom@3.3.8: - resolution: {integrity: sha512-Noy5yM5UIf9UeFoowBVgghyGGPIDPy1Qlqt0yVsUdAVbqI8eeMSsTqBtauaEoT2UFXUk5S64aWVNJN4MJ2vRdA==} + /@vue/runtime-dom@3.3.9: + resolution: {integrity: sha512-e7LIfcxYSWbV6BK1wQv9qJyxprC75EvSqF/kQKe6bdZEDNValzeRXEVgiX7AHI6hZ59HA4h7WT5CGvm69vzJTQ==} dependencies: - '@vue/runtime-core': 3.3.8 - '@vue/shared': 3.3.8 + '@vue/runtime-core': 3.3.9 + '@vue/shared': 3.3.9 csstype: 3.1.2 dev: true - /@vue/server-renderer@3.3.8(vue@3.3.8): - resolution: {integrity: sha512-zVCUw7RFskvPuNlPn/8xISbrf0zTWsTSdYTsUTN1ERGGZGVnRxM2QZ3x1OR32+vwkkCm0IW6HmJ49IsPm7ilLg==} + /@vue/server-renderer@3.3.9(vue@3.3.9): + resolution: {integrity: sha512-w0zT/s5l3Oa3ZjtLW88eO4uV6AQFqU8X5GOgzq7SkQQu6vVr+8tfm+OI2kDBplS/W/XgCBuFXiPw6T5EdwXP0A==} peerDependencies: - vue: 3.3.8 + vue: 3.3.9 dependencies: - '@vue/compiler-ssr': 3.3.8 - '@vue/shared': 3.3.8 - vue: 3.3.8(typescript@4.9.5) + '@vue/compiler-ssr': 3.3.9 + '@vue/shared': 3.3.9 + vue: 3.3.9(typescript@4.9.5) dev: true - /@vue/shared@3.3.8: - resolution: {integrity: sha512-8PGwybFwM4x8pcfgqEQFy70NaQxASvOC5DJwLQfpArw1UDfUXrJkdxD3BhVTMS+0Lef/TU7YO0Jvr0jJY8T+mw==} + /@vue/shared@3.3.9: + resolution: {integrity: sha512-ZE0VTIR0LmYgeyhurPTpy4KzKsuDyQbMSdM49eKkMnT5X4VfFBLysMzjIZhLEFQYjjOVVfbvUDHckwjDFiO2eA==} dev: true - /@vueuse/core@10.6.1(vue@3.3.8): + /@vueuse/core@10.6.1(vue@3.3.9): resolution: {integrity: sha512-Pc26IJbqgC9VG1u6VY/xrXXfxD33hnvxBnKrLlA2LJlyHII+BSrRoTPJgGYq7qZOu61itITFUnm6QbacwZ4H8Q==} dependencies: '@types/web-bluetooth': 0.0.20 '@vueuse/metadata': 10.6.1 - '@vueuse/shared': 10.6.1(vue@3.3.8) - vue-demi: 0.14.6(vue@3.3.8) + '@vueuse/shared': 10.6.1(vue@3.3.9) + vue-demi: 0.14.6(vue@3.3.9) transitivePeerDependencies: - '@vue/composition-api' - vue dev: true - /@vueuse/integrations@10.6.1(focus-trap@7.5.4)(vue@3.3.8): + /@vueuse/integrations@10.6.1(focus-trap@7.5.4)(vue@3.3.9): resolution: {integrity: sha512-mPDupuofMJ4DPmtX/FfP1MajmWRzYDv8WSaTCo8LQ5kFznjWgmUQ16ApjYqgMquqffNY6+IRMdMgosLDRZOSZA==} peerDependencies: async-validator: '*' @@ -1669,10 +1669,10 @@ packages: universal-cookie: optional: true dependencies: - '@vueuse/core': 10.6.1(vue@3.3.8) - '@vueuse/shared': 10.6.1(vue@3.3.8) + '@vueuse/core': 10.6.1(vue@3.3.9) + '@vueuse/shared': 10.6.1(vue@3.3.9) focus-trap: 7.5.4 - vue-demi: 0.14.6(vue@3.3.8) + vue-demi: 0.14.6(vue@3.3.9) transitivePeerDependencies: - '@vue/composition-api' - vue @@ -1682,10 +1682,10 @@ packages: resolution: {integrity: sha512-qhdwPI65Bgcj23e5lpGfQsxcy0bMjCAsUGoXkJ7DsoeDUdasbZ2DBa4dinFCOER3lF4gwUv+UD2AlA11zdzMFw==} dev: true - /@vueuse/shared@10.6.1(vue@3.3.8): + /@vueuse/shared@10.6.1(vue@3.3.9): resolution: {integrity: sha512-TECVDTIedFlL0NUfHWncf3zF9Gc4VfdxfQc8JFwoVZQmxpONhLxFrlm0eHQeidHj4rdTPL3KXJa0TZCk1wnc5Q==} dependencies: - vue-demi: 0.14.6(vue@3.3.8) + vue-demi: 0.14.6(vue@3.3.9) transitivePeerDependencies: - '@vue/composition-api' - vue @@ -2529,8 +2529,8 @@ packages: resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} dev: true - /cypress@13.5.1: - resolution: {integrity: sha512-yqLViT0D/lPI8Kkm7ciF/x/DCK/H/DnogdGyiTnQgX4OVR2aM30PtK+kvklTOD1u3TuItiD9wUQAF8EYWtyZug==} + /cypress@13.6.0: + resolution: {integrity: sha512-quIsnFmtj4dBUEJYU4OH0H12bABJpSujvWexC24Ju1gTlKMJbeT6tTO0vh7WNfiBPPjoIXLN+OUqVtiKFs6SGw==} engines: {node: ^16.0.0 || ^18.0.0 || >=20.0.0} hasBin: true requiresBuild: true @@ -2923,34 +2923,34 @@ packages: '@esbuild/win32-x64': 0.18.20 dev: true - /esbuild@0.19.6: - resolution: {integrity: sha512-Xl7dntjA2OEIvpr9j0DVxxnog2fyTGnyVoQXAMQI6eR3mf9zCQds7VIKUDCotDgE/p4ncTgeRqgX8t5d6oP4Gw==} + /esbuild@0.19.8: + resolution: {integrity: sha512-l7iffQpT2OrZfH2rXIp7/FkmaeZM0vxbxN9KfiCwGYuZqzMg/JdvX26R31Zxn/Pxvsrg3Y9N6XTcnknqDyyv4w==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/android-arm': 0.19.6 - '@esbuild/android-arm64': 0.19.6 - '@esbuild/android-x64': 0.19.6 - '@esbuild/darwin-arm64': 0.19.6 - '@esbuild/darwin-x64': 0.19.6 - '@esbuild/freebsd-arm64': 0.19.6 - '@esbuild/freebsd-x64': 0.19.6 - '@esbuild/linux-arm': 0.19.6 - '@esbuild/linux-arm64': 0.19.6 - '@esbuild/linux-ia32': 0.19.6 - '@esbuild/linux-loong64': 0.19.6 - '@esbuild/linux-mips64el': 0.19.6 - '@esbuild/linux-ppc64': 0.19.6 - '@esbuild/linux-riscv64': 0.19.6 - '@esbuild/linux-s390x': 0.19.6 - '@esbuild/linux-x64': 0.19.6 - '@esbuild/netbsd-x64': 0.19.6 - '@esbuild/openbsd-x64': 0.19.6 - '@esbuild/sunos-x64': 0.19.6 - '@esbuild/win32-arm64': 0.19.6 - '@esbuild/win32-ia32': 0.19.6 - '@esbuild/win32-x64': 0.19.6 + '@esbuild/android-arm': 0.19.8 + '@esbuild/android-arm64': 0.19.8 + '@esbuild/android-x64': 0.19.8 + '@esbuild/darwin-arm64': 0.19.8 + '@esbuild/darwin-x64': 0.19.8 + '@esbuild/freebsd-arm64': 0.19.8 + '@esbuild/freebsd-x64': 0.19.8 + '@esbuild/linux-arm': 0.19.8 + '@esbuild/linux-arm64': 0.19.8 + '@esbuild/linux-ia32': 0.19.8 + '@esbuild/linux-loong64': 0.19.8 + '@esbuild/linux-mips64el': 0.19.8 + '@esbuild/linux-ppc64': 0.19.8 + '@esbuild/linux-riscv64': 0.19.8 + '@esbuild/linux-s390x': 0.19.8 + '@esbuild/linux-x64': 0.19.8 + '@esbuild/netbsd-x64': 0.19.8 + '@esbuild/openbsd-x64': 0.19.8 + '@esbuild/sunos-x64': 0.19.8 + '@esbuild/win32-arm64': 0.19.8 + '@esbuild/win32-ia32': 0.19.8 + '@esbuild/win32-x64': 0.19.8 dev: true /escalade@3.1.1: @@ -6037,7 +6037,7 @@ packages: extsprintf: 1.3.0 dev: true - /vite-node@0.34.6(@types/node@20.9.2): + /vite-node@0.34.6(@types/node@20.10.0): resolution: {integrity: sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==} engines: {node: '>=v14.18.0'} hasBin: true @@ -6047,7 +6047,7 @@ packages: mlly: 1.4.2 pathe: 1.1.1 picocolors: 1.0.0 - vite: 4.5.0(@types/node@20.9.2) + vite: 4.5.0(@types/node@20.10.0) transitivePeerDependencies: - '@types/node' - less @@ -6059,7 +6059,7 @@ packages: - terser dev: true - /vite@4.5.0(@types/node@20.9.2): + /vite@4.5.0(@types/node@20.10.0): resolution: {integrity: sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -6087,7 +6087,7 @@ packages: terser: optional: true dependencies: - '@types/node': 20.9.2 + '@types/node': 20.10.0 esbuild: 0.18.20 postcss: 8.4.31 rollup: 3.29.4 @@ -6095,23 +6095,23 @@ packages: fsevents: 2.3.3 dev: true - /vitepress@1.0.0-beta.7(@algolia/client-search@4.19.1)(@types/node@20.9.2)(search-insights@2.11.0)(typescript@4.9.5): + /vitepress@1.0.0-beta.7(@algolia/client-search@4.19.1)(@types/node@20.10.0)(search-insights@2.11.0)(typescript@4.9.5): resolution: {integrity: sha512-P9Rw+FXatKIU4fVdtKxqwHl6fby8E/8zE3FIfep6meNgN4BxbWqoKJ6yfuuQQR9IrpQqwnyaBh4LSabyll6tWg==} hasBin: true dependencies: '@docsearch/css': 3.5.2 '@docsearch/js': 3.5.2(@algolia/client-search@4.19.1)(search-insights@2.11.0) - '@vitejs/plugin-vue': 4.5.0(vite@4.5.0)(vue@3.3.8) + '@vitejs/plugin-vue': 4.5.0(vite@4.5.0)(vue@3.3.9) '@vue/devtools-api': 6.5.1 - '@vueuse/core': 10.6.1(vue@3.3.8) - '@vueuse/integrations': 10.6.1(focus-trap@7.5.4)(vue@3.3.8) + '@vueuse/core': 10.6.1(vue@3.3.9) + '@vueuse/integrations': 10.6.1(focus-trap@7.5.4)(vue@3.3.9) body-scroll-lock: 4.0.0-beta.0 focus-trap: 7.5.4 mark.js: 8.11.1 minisearch: 6.2.0 shiki: 0.14.5 - vite: 4.5.0(@types/node@20.9.2) - vue: 3.3.8(typescript@4.9.5) + vite: 4.5.0(@types/node@20.10.0) + vue: 3.3.9(typescript@4.9.5) transitivePeerDependencies: - '@algolia/client-search' - '@types/node' @@ -6173,7 +6173,7 @@ packages: dependencies: '@types/chai': 4.3.10 '@types/chai-subset': 1.3.5 - '@types/node': 20.9.2 + '@types/node': 20.10.0 '@vitest/expect': 0.34.6 '@vitest/runner': 0.34.6 '@vitest/snapshot': 0.34.6 @@ -6193,8 +6193,8 @@ packages: strip-literal: 1.3.0 tinybench: 2.5.1 tinypool: 0.7.0 - vite: 4.5.0(@types/node@20.9.2) - vite-node: 0.34.6(@types/node@20.9.2) + vite: 4.5.0(@types/node@20.10.0) + vite-node: 0.34.6(@types/node@20.10.0) why-is-node-running: 2.2.2 transitivePeerDependencies: - less @@ -6214,7 +6214,7 @@ packages: resolution: {integrity: sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==} dev: true - /vue-demi@0.14.6(vue@3.3.8): + /vue-demi@0.14.6(vue@3.3.9): resolution: {integrity: sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==} engines: {node: '>=12'} hasBin: true @@ -6226,22 +6226,22 @@ packages: '@vue/composition-api': optional: true dependencies: - vue: 3.3.8(typescript@4.9.5) + vue: 3.3.9(typescript@4.9.5) dev: true - /vue@3.3.8(typescript@4.9.5): - resolution: {integrity: sha512-5VSX/3DabBikOXMsxzlW8JyfeLKlG9mzqnWgLQLty88vdZL7ZJgrdgBOmrArwxiLtmS+lNNpPcBYqrhE6TQW5w==} + /vue@3.3.9(typescript@4.9.5): + resolution: {integrity: sha512-sy5sLCTR8m6tvUk1/ijri3Yqzgpdsmxgj6n6yl7GXXCXqVbmW2RCXe9atE4cEI6Iv7L89v5f35fZRRr5dChP9w==} peerDependencies: typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@vue/compiler-dom': 3.3.8 - '@vue/compiler-sfc': 3.3.8 - '@vue/runtime-dom': 3.3.8 - '@vue/server-renderer': 3.3.8(vue@3.3.8) - '@vue/shared': 3.3.8 + '@vue/compiler-dom': 3.3.9 + '@vue/compiler-sfc': 3.3.9 + '@vue/runtime-dom': 3.3.9 + '@vue/server-renderer': 3.3.9(vue@3.3.9) + '@vue/shared': 3.3.9 typescript: 4.9.5 dev: true From 2eca5bc06c5f53efe9fe495577cd930620453794 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Fri, 1 Dec 2023 18:10:05 +0100 Subject: [PATCH 3/5] test(mersenne): add tests for value ranges (#2470) --- src/internal/mersenne.ts | 2 +- .../__snapshots__/mersenne.spec.ts.snap | 0 test/internal/mersenne-test-utils.ts | 17 +++ test/internal/mersenne.spec.ts | 136 ++++++++++++++++++ test/mersenne.spec.ts | 57 -------- test/modules/number.spec.ts | 37 ++++- 6 files changed, 190 insertions(+), 59 deletions(-) rename test/{ => internal}/__snapshots__/mersenne.spec.ts.snap (100%) create mode 100644 test/internal/mersenne-test-utils.ts create mode 100644 test/internal/mersenne.spec.ts delete mode 100644 test/mersenne.spec.ts diff --git a/src/internal/mersenne.ts b/src/internal/mersenne.ts index 6be5825d32c..2372e364d78 100644 --- a/src/internal/mersenne.ts +++ b/src/internal/mersenne.ts @@ -73,7 +73,7 @@ import type { Randomizer } from '../randomizer'; * * @internal */ -class MersenneTwister19937 { +export class MersenneTwister19937 { private readonly N = 624; private readonly M = 397; private readonly MATRIX_A = 0x9908b0df; // constant vector a diff --git a/test/__snapshots__/mersenne.spec.ts.snap b/test/internal/__snapshots__/mersenne.spec.ts.snap similarity index 100% rename from test/__snapshots__/mersenne.spec.ts.snap rename to test/internal/__snapshots__/mersenne.spec.ts.snap diff --git a/test/internal/mersenne-test-utils.ts b/test/internal/mersenne-test-utils.ts new file mode 100644 index 00000000000..ee7a43da455 --- /dev/null +++ b/test/internal/mersenne-test-utils.ts @@ -0,0 +1,17 @@ +// Moved to a separate file to avoid importing the tests + +/** + * The maximum value that can be returned by `MersenneTwister19937.genrandReal2()`. + * This is the max possible value with 32 bits of precision that is less than 1. + */ +export const TWISTER_32CO_MAX_VALUE = 0.9999999997671694; +/** + * The maximum value that can be returned by `MersenneTwister19937.genrandRes53()`. + * This is the max possible value with 53 bits of precision that is less than 1. + */ +export const TWISTER_53CO_MAX_VALUE = 0.9999999999999999; +// Re-exported because the value might change in the future +/** + * The maximum value that can be returned by `next()`. + */ +export const MERSENNE_MAX_VALUE = TWISTER_32CO_MAX_VALUE; diff --git a/test/internal/mersenne.spec.ts b/test/internal/mersenne.spec.ts new file mode 100644 index 00000000000..bbee050258f --- /dev/null +++ b/test/internal/mersenne.spec.ts @@ -0,0 +1,136 @@ +import { beforeAll, beforeEach, describe, expect, it } from 'vitest'; +import { + generateMersenne32Randomizer, + MersenneTwister19937, +} from '../../src/internal/mersenne'; +import type { Randomizer } from '../../src/randomizer'; +import { seededRuns } from '../support/seeded-runs'; +import { times } from '../support/times'; +import { + MERSENNE_MAX_VALUE, + TWISTER_32CO_MAX_VALUE, + TWISTER_53CO_MAX_VALUE, +} from './mersenne-test-utils'; + +const NON_SEEDED_BASED_RUN = 25; + +function newTwister( + seed: number = Math.random() * Number.MAX_SAFE_INTEGER +): MersenneTwister19937 { + const twister = new MersenneTwister19937(); + twister.initGenrand(seed); + return twister; +} + +describe('MersenneTwister19937', () => { + describe('genrandInt32()', () => { + it('should be able to return 0', () => { + const twister = newTwister(257678572); + + // There is no single value seed that can produce 0 in the first call + for (let i = 0; i < 5; i++) { + twister.genrandInt32(); + } + + const actual = twister.genrandInt32(); + expect(actual).toBe(0); + }); + + it('should be able to return 2^32-1', () => { + const twister = newTwister(2855577693); + const actual = twister.genrandInt32(); + expect(actual).toBe(2 ** 32 - 1); + }); + }); + + describe('genrandReal2()', () => { + it('should be able to return 0', () => { + const twister = newTwister(); + // shortcut to return minimal value + // the test above shows that it is possible to return 0 + twister.genrandInt32 = () => 0; + const actual = twister.genrandReal2(); + expect(actual).toBe(0); + }); + + it('should be able to return almost 1', () => { + const twister = newTwister(); + // shortcut to return maximal value + // the test above shows that it is possible to return 2^32-1 + twister.genrandInt32 = () => 2 ** 32 - 1; + const actual = twister.genrandReal2(); + expect(actual).toBe(TWISTER_32CO_MAX_VALUE); + }); + }); + + describe('genrandRes53()', () => { + it('should be able to return 0', () => { + const twister = newTwister(); + // shortcut to return minimal value + // the test above shows that it is possible to return 0 + twister.genrandInt32 = () => 0; + const actual = twister.genrandRes53(); + expect(actual).toBe(0); + }); + + it('should be able to return almost 1', () => { + const twister = newTwister(); + // shortcut to return maximal value + // the test above shows that it is possible to return 2^32-1 + twister.genrandInt32 = () => 2 ** 32 - 1; + const actual = twister.genrandRes53(); + expect(actual).toBe(TWISTER_53CO_MAX_VALUE); + }); + }); +}); + +describe('generateMersenne32Randomizer()', () => { + const randomizer: Randomizer = generateMersenne32Randomizer(); + + it('should return a result matching the interface', () => { + expect(randomizer).toBeDefined(); + expect(randomizer).toBeTypeOf('object'); + expect(randomizer.next).toBeTypeOf('function'); + expect(randomizer.seed).toBeTypeOf('function'); + }); + + describe.each( + [...seededRuns, ...seededRuns.map((v) => [v, 1, 2])].map((v) => [v]) + )('seed: %j', (seed) => { + beforeEach(() => { + randomizer.seed(seed); + }); + + it('should return deterministic value for next()', () => { + const actual = randomizer.next(); + + expect(actual).toMatchSnapshot(); + }); + }); + + function randomSeed(): number { + return Math.ceil(Math.random() * 1_000_000_000); + } + + // Create and log-back the seed for debug purposes + describe.each( + times(NON_SEEDED_BASED_RUN).flatMap(() => [ + [randomSeed()], + [[randomSeed(), randomSeed()]], + ]) + )('random seeded tests %j', (seed) => { + beforeAll(() => { + randomizer.seed(seed); + }); + + describe('next', () => { + it('should return random number from interval [0, 1)', () => { + const actual = randomizer.next(); + + expect(actual).toBeGreaterThanOrEqual(0); + expect(actual).toBeLessThanOrEqual(MERSENNE_MAX_VALUE); + expect(actual).toBeLessThan(1); + }); + }); + }); +}); diff --git a/test/mersenne.spec.ts b/test/mersenne.spec.ts deleted file mode 100644 index 6c7d5a18579..00000000000 --- a/test/mersenne.spec.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { beforeAll, beforeEach, describe, expect, it } from 'vitest'; -import { generateMersenne32Randomizer } from '../src/internal/mersenne'; -import type { Randomizer } from '../src/randomizer'; -import { seededRuns } from './support/seeded-runs'; -import { times } from './support/times'; - -const NON_SEEDED_BASED_RUN = 25; - -describe('generateMersenne32Randomizer()', () => { - const randomizer: Randomizer = generateMersenne32Randomizer(); - - it('should return a result matching the interface', () => { - expect(randomizer).toBeDefined(); - expect(randomizer).toBeTypeOf('object'); - expect(randomizer.next).toBeTypeOf('function'); - expect(randomizer.seed).toBeTypeOf('function'); - }); - - describe.each( - [...seededRuns, ...seededRuns.map((v) => [v, 1, 2])].map((v) => [v]) - )('seed: %j', (seed) => { - beforeEach(() => { - randomizer.seed(seed); - }); - - it('should return deterministic value for next()', () => { - const actual = randomizer.next(); - - expect(actual).toMatchSnapshot(); - }); - }); - - function randomSeed(): number { - return Math.ceil(Math.random() * 1_000_000_000); - } - - // Create and log-back the seed for debug purposes - describe.each( - times(NON_SEEDED_BASED_RUN).flatMap(() => [ - [randomSeed()], - [[randomSeed(), randomSeed()]], - ]) - )('random seeded tests %j', (seed) => { - beforeAll(() => { - randomizer.seed(seed); - }); - - describe('next', () => { - it('should return random number from interval [0, 1)', () => { - const actual = randomizer.next(); - - expect(actual).toBeGreaterThanOrEqual(0); - expect(actual).toBeLessThan(1); - }); - }); - }); -}); diff --git a/test/modules/number.spec.ts b/test/modules/number.spec.ts index 66018ee61bd..699200b22f4 100644 --- a/test/modules/number.spec.ts +++ b/test/modules/number.spec.ts @@ -1,6 +1,7 @@ import validator from 'validator'; import { describe, expect, it } from 'vitest'; -import { faker, FakerError } from '../../src'; +import { faker, FakerError, SimpleFaker } from '../../src'; +import { MERSENNE_MAX_VALUE } from '../internal/mersenne-test-utils'; import { seededTests } from '../support/seeded-runs'; describe('number', () => { @@ -507,4 +508,38 @@ describe('number', () => { }); }); }); + + describe('value range tests', () => { + const customFaker = new SimpleFaker(); + // @ts-expect-error: access private member field + const randomizer = customFaker._randomizer; + describe('int', () => { + it('should be able to return 0', () => { + randomizer.next = () => 0; + const actual = customFaker.number.int(); + expect(actual).toBe(0); + }); + + // TODO @ST-DDT 2023-10-12: This requires a randomizer with 53 bits of precision + it.todo('should be able to return MAX_SAFE_INTEGER', () => { + randomizer.next = () => MERSENNE_MAX_VALUE; + const actual = customFaker.number.int(); + expect(actual).toBe(Number.MAX_SAFE_INTEGER); + }); + }); + + describe('float', () => { + it('should be able to return 0', () => { + randomizer.next = () => 0; + const actual = customFaker.number.float(); + expect(actual).toBe(0); + }); + + it('should be able to return almost 1', () => { + randomizer.next = () => MERSENNE_MAX_VALUE; + const actual = customFaker.number.float(); + expect(actual).toBe(MERSENNE_MAX_VALUE); + }); + }); + }); }); From 9dd57d742d736de0a5cf75aa8ef1ebb2460afd19 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Fri, 1 Dec 2023 18:19:40 +0100 Subject: [PATCH 4/5] chore(helpers): fix examples on internal functions (#2559) --- src/modules/helpers/index.ts | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/modules/helpers/index.ts b/src/modules/helpers/index.ts index 9a681da9641..26de107dc2e 100644 --- a/src/modules/helpers/index.ts +++ b/src/modules/helpers/index.ts @@ -9,7 +9,7 @@ import * as uniqueExec from './unique'; /** * Returns a number based on given RegEx-based quantifier symbol or quantifier values. * - * @param faker Faker instance + * @param faker The Faker instance to use. * @param quantifierSymbol Quantifier symbols can be either of these: `?`, `*`, `+`. * @param quantifierMin Quantifier minimum value. If given without a maximum, this will be used as the quantifier value. * @param quantifierMax Quantifier maximum value. Will randomly get a value between the minimum and maximum if both are provided. @@ -17,9 +17,9 @@ import * as uniqueExec from './unique'; * @returns a random number based on the given quantifier parameters. * * @example - * getRepetitionsBasedOnQuantifierParameters(this.faker, '*', null, null) // 3 - * getRepetitionsBasedOnQuantifierParameters(this.faker, null, 10, null) // 10 - * getRepetitionsBasedOnQuantifierParameters(this.faker, null, 5, 8) // 6 + * getRepetitionsBasedOnQuantifierParameters(faker, '*', null, null) // 3 + * getRepetitionsBasedOnQuantifierParameters(faker, null, 10, null) // 10 + * getRepetitionsBasedOnQuantifierParameters(faker, null, 5, 8) // 6 * * @since 8.0.0 */ @@ -73,7 +73,9 @@ function getRepetitionsBasedOnQuantifierParameters( } /** - * Replaces the regex like expressions in the given string with matching values. Note: This method will be removed in v9. + * Replaces the regex like expressions in the given string with matching values. + * + * Note: This method will be removed in v9. * * Supported patterns: * - `.{times}` => Repeat the character exactly `times` times. @@ -82,15 +84,15 @@ function getRepetitionsBasedOnQuantifierParameters( * * @internal * - * @param faker A Faker instance. + * @param faker The Faker instance to use. * @param string The template string to parse. * * @example - * faker.helpers.legacyRegexpStringParse() // '' - * faker.helpers.legacyRegexpStringParse('#{5}') // '#####' - * faker.helpers.legacyRegexpStringParse('#{2,9}') // '#######' - * faker.helpers.legacyRegexpStringParse('[500-15000]') // '8375' - * faker.helpers.legacyRegexpStringParse('#{3}test[1-5]') // '###test3' + * legacyRegexpStringParse(faker) // '' + * legacyRegexpStringParse(faker, '#{5}') // '#####' + * legacyRegexpStringParse(faker, '#{2,9}') // '#######' + * legacyRegexpStringParse(faker, '[500-15000]') // '8375' + * legacyRegexpStringParse(faker, '#{3}test[1-5]') // '###test3' * * @since 5.0.0 */ From 505f659e4359a39b6e7949209071ba663b751151 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Sun, 3 Dec 2023 01:07:39 +0100 Subject: [PATCH 5/5] docs: check and improve handling of duplicate tags (#2444) --- scripts/apidoc/typedoc.ts | 44 +++++++++-- src/modules/helpers/index.ts | 4 +- .../__snapshots__/signature.spec.ts.snap | 73 ++++++++++++------- test/scripts/apidoc/signature.example.ts | 14 +++- test/scripts/apidoc/verify-jsdoc-tags.spec.ts | 1 + 5 files changed, 99 insertions(+), 37 deletions(-) diff --git a/scripts/apidoc/typedoc.ts b/scripts/apidoc/typedoc.ts index 12b474b0435..a795efa27c2 100644 --- a/scripts/apidoc/typedoc.ts +++ b/scripts/apidoc/typedoc.ts @@ -219,7 +219,40 @@ export function extractTagContent( reflection?: CommentHolder, tagProcessor: (tag: CommentTag) => string[] = joinTagContent ): string[] { - return reflection?.comment?.getTags(tag).flatMap(tagProcessor) ?? []; + const tags = + reflection?.comment + ?.getTags(tag) + .flatMap(tagProcessor) + .map((tag) => tag.trim()) ?? []; + if (tags.some((tag) => tag.length === 0)) { + throw new Error(`Expected non-empty ${tag} tag.`); + } + + return tags; +} + +/** + * Extracts the text (md) from a single jsdoc tag. + * + * @param tag The tag to extract the text from. + * @param reflection The reflection to extract the text from. + * @param tagProcessor The function used to extract the text from the tag. + * + * @throws If there are multiple tags of that type. + */ +function extractSingleTagContent( + tag: `@${string}`, + reflection?: CommentHolder, + tagProcessor: (tag: CommentTag) => string[] = joinTagContent +): string | undefined { + const tags = extractTagContent(tag, reflection, tagProcessor); + if (tags.length === 0) { + return undefined; + } else if (tags.length === 1) { + return tags[0]; + } + + throw new Error(`Expected 1 ${tag} tag, but got ${tags.length}.`); } /** @@ -358,8 +391,7 @@ export function joinTagParts(parts?: CommentDisplayPart[]): string | undefined { export function extractDeprecated( reflection?: CommentHolder ): string | undefined { - const deprecated = extractTagContent('@deprecated', reflection).join().trim(); - return deprecated.length === 0 ? undefined : deprecated; + return extractSingleTagContent('@deprecated', reflection); } /** @@ -370,8 +402,8 @@ export function extractDeprecated( * @returns The message explaining the conditions when this method throws. Or `undefined` if it does not throw. */ export function extractThrows(reflection?: CommentHolder): string | undefined { - const throws = extractTagContent('@throws', reflection).join().trim(); - return throws.length === 0 ? undefined : throws; + const content = extractTagContent('@throws', reflection).join('\n'); + return content.length === 0 ? undefined : content; } /** @@ -382,5 +414,5 @@ export function extractThrows(reflection?: CommentHolder): string | undefined { * @returns The contents of the `@since` tag. */ export function extractSince(reflection: CommentHolder): string { - return extractTagContent('@since', reflection).join().trim(); + return extractSingleTagContent('@since', reflection) || MISSING_DESCRIPTION; } diff --git a/src/modules/helpers/index.ts b/src/modules/helpers/index.ts index 26de107dc2e..6e993c8412c 100644 --- a/src/modules/helpers/index.ts +++ b/src/modules/helpers/index.ts @@ -417,8 +417,8 @@ export class SimpleHelpersModule extends SimpleModuleBase { * * @param pattern The template string/RegExp to generate a matching string for. * - * @throws If min value is more than max value in quantifier. e.g. `#{10,5}` - * @throws If invalid quantifier symbol is passed in. + * @throws If min value is more than max value in quantifier, e.g. `#{10,5}`. + * @throws If an invalid quantifier symbol is passed in. * * @example * faker.helpers.fromRegExp('#{5}') // '#####' diff --git a/test/scripts/apidoc/__snapshots__/signature.spec.ts.snap b/test/scripts/apidoc/__snapshots__/signature.spec.ts.snap index 12e7df29bb5..84365003a9d 100644 --- a/test/scripts/apidoc/__snapshots__/signature.spec.ts.snap +++ b/test/scripts/apidoc/__snapshots__/signature.spec.ts.snap @@ -42,8 +42,8 @@ exports[`signature > analyzeSignature() > complexArrayParameter 1`] = ` ], "returns": "T", "seeAlsos": [], - "since": "", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L367", + "since": "Missing", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L377", "throws": undefined, } `; @@ -67,7 +67,7 @@ exports[`signature > analyzeSignature() > defaultBooleanParamMethod 1`] = ` ], "returns": "number", "seeAlsos": [], - "since": "", + "since": "Missing", "sourcePath": "test/scripts/apidoc/signature.example.ts#L105", "throws": undefined, } @@ -84,6 +84,7 @@ exports[`signature > analyzeSignature() > expected and actual methods are equal "methodWithExample", "methodWithMultipleSeeMarkers", "methodWithMultipleSeeMarkersAndBackticks", + "methodWithMultipleThrows", "methodWithSinceMarker", "methodWithThrows", "multiParamMethod", @@ -118,7 +119,7 @@ exports[`signature > analyzeSignature() > functionParamMethod 1`] = ` ], "returns": "number", "seeAlsos": [], - "since": "", + "since": "Missing", "sourcePath": "test/scripts/apidoc/signature.example.ts#L125", "throws": undefined, } @@ -178,7 +179,7 @@ exports[`signature > analyzeSignature() > literalUnionParamMethod 1`] = ` ], "returns": "string", "seeAlsos": [], - "since": "", + "since": "Missing", "sourcePath": "test/scripts/apidoc/signature.example.ts#L159", "throws": undefined, } @@ -198,7 +199,7 @@ exports[`signature > analyzeSignature() > methodWithDeprecated 1`] = ` "seeAlsos": [ "test.apidoc.methodWithExample()", ], - "since": "", + "since": "Missing", "sourcePath": "test/scripts/apidoc/signature.example.ts#L287", "throws": undefined, } @@ -250,8 +251,8 @@ exports[`signature > analyzeSignature() > methodWithDeprecatedOption 1`] = ` ], "returns": "number", "seeAlsos": [], - "since": "", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L308", + "since": "Missing", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L318", "throws": undefined, } `; @@ -268,7 +269,7 @@ exports[`signature > analyzeSignature() > methodWithExample 1`] = ` "parameters": [], "returns": "number", "seeAlsos": [], - "since": "", + "since": "Missing", "sourcePath": "test/scripts/apidoc/signature.example.ts#L276", "throws": undefined, } @@ -288,8 +289,8 @@ exports[`signature > analyzeSignature() > methodWithMultipleSeeMarkers 1`] = ` "test.apidoc.methodWithExample()", "test.apidoc.methodWithDeprecated()", ], - "since": "", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L335", + "since": "Missing", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L345", "throws": undefined, } `; @@ -308,12 +309,30 @@ exports[`signature > analyzeSignature() > methodWithMultipleSeeMarkersAndBacktic "test.apidoc.methodWithExample() with parameter foo.", "test.apidoc.methodWithDeprecated() with parameter bar and baz.", ], - "since": "", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L345", + "since": "Missing", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L355", "throws": undefined, } `; +exports[`signature > analyzeSignature() > methodWithMultipleThrows 1`] = ` +{ + "deprecated": undefined, + "description": "

Test with multiple throws.

+", + "examples": "
ts
methodWithMultipleThrows(): number
+
", + "name": "methodWithMultipleThrows", + "parameters": [], + "returns": "number", + "seeAlsos": [], + "since": "Missing", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L306", + "throws": "First error case. +Another error case.", +} +`; + exports[`signature > analyzeSignature() > methodWithSinceMarker 1`] = ` { "deprecated": undefined, @@ -326,7 +345,7 @@ exports[`signature > analyzeSignature() > methodWithSinceMarker 1`] = ` "returns": "number", "seeAlsos": [], "since": "1.0.0", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L354", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L364", "throws": undefined, } `; @@ -334,7 +353,7 @@ exports[`signature > analyzeSignature() > methodWithSinceMarker 1`] = ` exports[`signature > analyzeSignature() > methodWithThrows 1`] = ` { "deprecated": undefined, - "description": "

Test with throws

+ "description": "

Test with throws.

", "examples": "
ts
methodWithThrows(): number
", @@ -342,9 +361,9 @@ exports[`signature > analyzeSignature() > methodWithThrows 1`] = ` "parameters": [], "returns": "number", "seeAlsos": [], - "since": "", + "since": "Missing", "sourcePath": "test/scripts/apidoc/signature.example.ts#L296", - "throws": "a Faker error", + "throws": "Everytime.", } `; @@ -381,7 +400,7 @@ exports[`signature > analyzeSignature() > multiParamMethod 1`] = ` ], "returns": "number", "seeAlsos": [], - "since": "", + "since": "Missing", "sourcePath": "test/scripts/apidoc/signature.example.ts#L116", "throws": undefined, } @@ -398,7 +417,7 @@ exports[`signature > analyzeSignature() > noParamMethod 1`] = ` "parameters": [], "returns": "number", "seeAlsos": [], - "since": "", + "since": "Missing", "sourcePath": "test/scripts/apidoc/signature.example.ts#L78", "throws": undefined, } @@ -423,7 +442,7 @@ exports[`signature > analyzeSignature() > optionalStringParamMethod 1`] = ` ], "returns": "number", "seeAlsos": [], - "since": "", + "since": "Missing", "sourcePath": "test/scripts/apidoc/signature.example.ts#L96", "throws": undefined, } @@ -491,7 +510,7 @@ It also has a more complex description.

], "returns": "number", "seeAlsos": [], - "since": "", + "since": "Missing", "sourcePath": "test/scripts/apidoc/signature.example.ts#L226", "throws": undefined, } @@ -530,7 +549,7 @@ exports[`signature > analyzeSignature() > optionsInterfaceParamMethodWithDefault ], "returns": "number", "seeAlsos": [], - "since": "", + "since": "Missing", "sourcePath": "test/scripts/apidoc/signature.example.ts#L262", "throws": undefined, } @@ -596,7 +615,7 @@ exports[`signature > analyzeSignature() > optionsParamMethod 1`] = ` ], "returns": "number", "seeAlsos": [], - "since": "", + "since": "Missing", "sourcePath": "test/scripts/apidoc/signature.example.ts#L196", "throws": undefined, } @@ -635,7 +654,7 @@ exports[`signature > analyzeSignature() > optionsTypeParamMethodWithDefaults 1`] ], "returns": "number", "seeAlsos": [], - "since": "", + "since": "Missing", "sourcePath": "test/scripts/apidoc/signature.example.ts#L244", "throws": undefined, } @@ -660,7 +679,7 @@ exports[`signature > analyzeSignature() > recordParamMethod 1`] = ` ], "returns": "number", "seeAlsos": [], - "since": "", + "since": "Missing", "sourcePath": "test/scripts/apidoc/signature.example.ts#L182", "throws": undefined, } @@ -685,7 +704,7 @@ exports[`signature > analyzeSignature() > requiredNumberParamMethod 1`] = ` ], "returns": "number", "seeAlsos": [], - "since": "", + "since": "Missing", "sourcePath": "test/scripts/apidoc/signature.example.ts#L87", "throws": undefined, } @@ -742,7 +761,7 @@ exports[`signature > analyzeSignature() > stringUnionParamMethod 1`] = ` ], "returns": "string", "seeAlsos": [], - "since": "", + "since": "Missing", "sourcePath": "test/scripts/apidoc/signature.example.ts#L138", "throws": undefined, } diff --git a/test/scripts/apidoc/signature.example.ts b/test/scripts/apidoc/signature.example.ts index 724f687d3a6..2f62057bc01 100644 --- a/test/scripts/apidoc/signature.example.ts +++ b/test/scripts/apidoc/signature.example.ts @@ -289,14 +289,24 @@ export class SignatureTest { } /** - * Test with throws + * Test with throws. * - * @throws a Faker error + * @throws Everytime. */ methodWithThrows(): number { throw new FakerError('Test error'); } + /** + * Test with multiple throws. + * + * @throws First error case. + * @throws Another error case. + */ + methodWithMultipleThrows(): number { + throw new FakerError('Another test error'); + } + /** * Test with deprecated option. * diff --git a/test/scripts/apidoc/verify-jsdoc-tags.spec.ts b/test/scripts/apidoc/verify-jsdoc-tags.spec.ts index efb1919bf35..76865c16e80 100644 --- a/test/scripts/apidoc/verify-jsdoc-tags.spec.ts +++ b/test/scripts/apidoc/verify-jsdoc-tags.spec.ts @@ -300,6 +300,7 @@ describe('verify JSDoc tags', () => { it('verify @since tag', () => { const since = extractSince(signature); expect(since, '@since to be present').toBeTruthy(); + expect(since).not.toBe(MISSING_DESCRIPTION); expect(since, '@since to be a valid semver').toSatisfy( validator.isSemVer );