diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 4aef7e5ed88..b44b0a8975d 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,31 +1,106 @@ name: "\U0001F41E Bug report" description: Report an issue -labels: ['s: pending triage'] # This will automatically assign the 's: pending triage' label +labels: ['s: pending triage', 'c: bug'] body: - type: markdown attributes: - value: Thanks for taking the time to fill out this bug report! + value: | + Thanks for taking the time to fill out this bug report! + + If you are unsure whether your problem is a bug or not, you can check the following: + + - use our [Discord community](https://chat.fakerjs.dev) + - open a new [discussion](https://github.com/faker-js/faker/discussions) and ask your question there + - use [StackOverflow using the tag `faker-js`](https://stackoverflow.com/questions/tagged/faker-js) + + - type: checkboxes + id: checkboxes + attributes: + label: Pre-Checks + description: Before submitting the issue, please make sure you do the following + options: + - label: Follow our [Code of Conduct](https://github.com/faker-js/faker/blob/main/CODE_OF_CONDUCT.md). + required: true + - label: Read the [Contributing Guidelines](https://github.com/faker-js/faker/blob/main/CONTRIBUTING.md). + required: true + - label: Read the [docs](https://fakerjs.dev/guide). + required: true + - label: Check that there isn't [already an issue](https://github.com/faker-js/faker/issues) that reports the same bug to avoid creating a duplicate. + required: true + - label: Make sure this is a Faker issue and not related to a combination with another package. + required: true + - label: Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/faker-js/faker/discussions) or join our [Discord Chat Server](https://chat.fakerjs.dev). + required: true + - label: The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug. + required: true + - label: I am willing to provide a PR. + - type: textarea id: bug-description attributes: label: Describe the bug - description: A clear and concise description of what the bug is. If you intend to submit a PR for this issue, tell us in the description. Thanks! - placeholder: Bug description + description: A clear and concise description of what the bug is. + placeholder: I am doing ... What I expect is ... What actually happening is ... validations: required: true + - type: textarea id: reproduction attributes: - label: Reproduction - description: Please reproduce the problem you ran into. - placeholder: Reproduction + label: Minimal reproduction code + description: | + An URL to some git repository or gist that reproduces this issue. [Wtf is a minimum reproduction?](https://jmcdo29.github.io/wtf-is-a-minimum-reproduction) + You can also provide a [Faker StackBlitz workspace](https://fakerjs.dev/new) with a reproduction. + Alternatively you could write the code sample directly here with [markdown support.](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks) + placeholder: 'https://github.com/..., https://fakerjs.dev/new or ``` code ```' + + - type: textarea + id: additional-context + attributes: + label: Additional Context + description: | + Anything else relevant? Please tell us here if you run Faker in a Web Browser. + **Tip:** You can attach images, recordings or log files by clicking this area to highlight it and then dragging files in. + + - type: textarea + id: environment-info + attributes: + label: Environment Info + description: Output of `npx envinfo --system --npmPackages '@faker-js/*' --binaries --browsers` + render: shell + placeholder: | + System: + OS: _ + CPU: _ + Memory: _ / _ + Container: Yes/No + Shell: _ + Binaries: + Node: _ - /usr/bin/node + Yarn: _ - /usr/bin/yarn + npm: _ - /usr/bin/npm + npmPackages: + @faker-js/faker: _ => _ validations: required: true - - type: textarea - id: additional-info + + - type: checkboxes + id: module-system attributes: - label: Additional Info - description: Give us additional info like e.g. version numbers. - placeholder: Additional info + label: Which module system do you use? + options: + - label: CJS + - label: ESM + + - type: dropdown + id: package-manager + attributes: + label: Used Package Manager + description: Select the used package manager + options: + - npm + - yarn + - pnpm + - other validations: - required: false + required: true diff --git a/.github/semantic.yml b/.github/semantic.yml deleted file mode 100644 index 2511b793408..00000000000 --- a/.github/semantic.yml +++ /dev/null @@ -1,17 +0,0 @@ -titleOnly: true -types: - - feat - - fix - - docs - - dx - - refactor - - perf - - test - - workflow - - build - - ci - - chore - - types - - wip - - release - - deps diff --git a/.github/workflows/semantic-pull-request.yml b/.github/workflows/semantic-pull-request.yml index df554b38e75..195bd7bfaae 100644 --- a/.github/workflows/semantic-pull-request.yml +++ b/.github/workflows/semantic-pull-request.yml @@ -16,3 +16,21 @@ jobs: uses: amannn/action-semantic-pull-request@v4 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + types: | + feat + fix + docs + dx + refactor + perf + test + locale + workflow + build + ci + chore + types + wip + release + deps diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d056771be51..82339869019 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -59,7 +59,7 @@ Example: ```ts /** - * @see faker.cat.random + * @see faker.cat.random() * * @deprecated Use faker.cat.random() instead. */ diff --git a/README.md b/README.md index 14192bc6abd..e9c64f4da2c 100644 --- a/README.md +++ b/README.md @@ -98,11 +98,13 @@ The API covers the following modules: ### Templates -Faker contains a generator method `faker.fake` for combining faker API methods using a mustache string format. +Faker contains a generator method `faker.helpers.fake` for combining faker API methods using a mustache string format. ```ts console.log( - faker.fake('Hello {{name.prefix}} {{name.lastName}}, how are you today?') + faker.helpers.fake( + 'Hello {{name.prefix}} {{name.lastName}}, how are you today?' + ) ); ``` diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 91e7fd2fa91..9b013d2ebd4 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -1,93 +1,7 @@ -import type { DefaultTheme } from 'vitepress'; import { defineConfig } from 'vitepress'; import { apiPages } from './api-pages'; import { currentVersion, oldVersions } from './versions'; -const nav: DefaultTheme.NavItem[] = [ - { text: 'Guide', link: '/guide/' }, - // { text: 'Playground', link: '/playground/' }, - { - text: 'Ecosystem', - items: [ - { text: 'Discord ', link: 'https://chat.fakerjs.dev' }, - { text: 'StackBlitz ', link: 'https://fakerjs.dev/new' }, - { text: 'Twitter ', link: 'https://twitter.com/faker_js' }, - ], - }, - { - text: 'About', - items: [ - { - text: 'Announcements', - link: '/about/announcements', - }, - { - text: 'Team', - link: '/about/team', - }, - ], - }, - { - text: currentVersion, - items: [ - { - text: 'Release Notes', - link: 'https://github.com/faker-js/faker/releases', - }, - ...oldVersions.map(({ version, link }) => ({ - text: version, - link, - })), - ], - }, -]; - -const sidebar: DefaultTheme.MultiSideBarConfig = { - '/about': [ - { - text: 'About', - children: [ - { - text: 'Announcements', - link: '/about/announcements', - children: [ - { text: '2022-01-14', link: '/about/announcements/2022-01-14' }, - ], - }, - { - text: 'Team', - link: '/about/team', - }, - ], - }, - ], - '/': [ - { - text: 'Guide', - children: [ - { - text: 'Getting Started', - link: '/guide/', - }, - ], - }, - { - text: 'API', - children: apiPages, - }, - { - text: 'Migrating from Faker v5', - link: '/migration-guide-v5/', - }, - ], -}; - -const algolia: DefaultTheme.AlgoliaSearchOptions = { - apiKey: process.env.API_KEY, - appId: process.env.APP_ID, - indexName: 'fakerjs', -}; - const description = 'Generate massive amounts of fake (but reasonable) data for testing and development.'; const image = 'https://fakerjs.dev/social-image.png'; @@ -95,6 +9,7 @@ const image = 'https://fakerjs.dev/social-image.png'; export default defineConfig({ title: 'Faker', description, + head: [ ['link', { rel: 'icon', href: '/logo.svg' }], ['meta', { name: 'theme-color', content: '#40af7c' }], @@ -141,15 +56,116 @@ export default defineConfig({ }, ], ], + themeConfig: { - repo: 'faker-js/faker', logo: '/logo.svg', - docsDir: 'docs', - docsBranch: 'main', - editLinks: true, - editLinkText: 'Suggest changes to this page', - nav, - sidebar, - algolia, + + editLink: { + pattern: 'https://github.com/faker-js/faker/edit/main/docs/:path', + text: 'Suggest changes to this page', + }, + + socialLinks: [ + { icon: 'twitter', link: 'https://twitter.com/faker_js' }, + { icon: 'discord', link: 'https://chat.fakerjs.dev' }, + { icon: 'github', link: 'https://github.com/faker-js/faker' }, + ], + + algolia: { + apiKey: process.env.API_KEY, + appId: process.env.APP_ID, + indexName: 'fakerjs', + }, + + footer: { + message: 'Released under the MIT License.', + copyright: 'Copyright ยฉ 2022-present Faker.', + }, + + nav: [ + { text: 'Guide', link: '/guide/' }, + // { text: 'Playground', link: '/playground/' }, + { + text: 'Ecosystem', + items: [{ text: 'StackBlitz ', link: 'https://fakerjs.dev/new' }], + }, + { + text: 'About', + items: [ + { + text: 'Announcements', + link: '/about/announcements', + }, + { + text: 'Team', + link: '/about/team', + }, + ], + }, + { + text: currentVersion, + items: [ + { + text: 'Release Notes', + link: 'https://github.com/faker-js/faker/releases', + }, + ...oldVersions.map(({ version, link }) => ({ + text: version, + link, + })), + ], + }, + ], + + sidebar: { + '/guide/': [ + { + text: 'Guide', + items: [ + { + text: 'Getting Started', + link: '/guide/', + }, + ], + }, + { + text: 'API', + items: apiPages, + }, + { + text: 'Migrations', + items: [ + { + text: 'Migrating from Faker v5', + link: '/guide/migration-guide-v5', + }, + ], + }, + ], + '/api/': [ + { + text: 'API', + items: apiPages, + }, + ], + '/about/': [ + { + text: 'About', + items: [ + { + text: 'Announcements', + link: '/about/announcements', + // children: [ + // { text: '2022-01-14', link: '/about/announcements/2022-01-14' }, + // ], + }, + { + text: 'Team', + link: '/about/team', + }, + ], + }, + ], + }, }, }); diff --git a/docs/about/team.md b/docs/about/team.md index 9013ee90db6..a3502b761fd 100644 --- a/docs/about/team.md +++ b/docs/about/team.md @@ -1,9 +1,11 @@ --- +layout: page title: Team +description: The development of Faker is guided by an international team. --- diff --git a/docs/about/team/TeamMember.ts b/docs/about/team/TeamMember.ts deleted file mode 100644 index 01fe3771296..00000000000 --- a/docs/about/team/TeamMember.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface Member { - readonly name: string; - readonly github: string; - readonly gitlab?: string; - readonly twitter?: string; - readonly roles: readonly string[]; -} diff --git a/docs/about/team/TeamMember.vue b/docs/about/team/TeamMember.vue deleted file mode 100644 index 03514a1f1f0..00000000000 --- a/docs/about/team/TeamMember.vue +++ /dev/null @@ -1,76 +0,0 @@ - - - - - diff --git a/docs/about/team/TeamPage.vue b/docs/about/team/TeamPage.vue index 99801f17eba..671719174b3 100644 --- a/docs/about/team/TeamPage.vue +++ b/docs/about/team/TeamPage.vue @@ -1,60 +1,41 @@ - - - + + + + + + + diff --git a/docs/about/team/members.json b/docs/about/team/members.json index 31018175204..7732eab23ab 100644 --- a/docs/about/team/members.json +++ b/docs/about/team/members.json @@ -1,77 +1,141 @@ { "core": [ { + "avatar": "https://github.com/Shinigami92.png", "name": "Christopher Quadflieg", - "github": "Shinigami92", - "twitter": "Shini_92", - "roles": ["Code Maintainer"] + "title": "Code Maintainer", + "org": "Faker", + "orgLink": "https://fakerjs.dev", + "desc": "Passionate TypeScript enthusiast. Also core member of Vite.", + "links": [ + { "icon": "github", "link": "https://github.com/Shinigami92" }, + { "icon": "twitter", "link": "https://twitter.com/Shini_92" } + ], + "sponsor": "https://github.com/sponsors/Shinigami92" }, { + "avatar": "https://github.com/damienwebdev.png", "name": "Damien Retzinger", - "github": "damienwebdev", - "twitter": "damienwebdev", - "roles": ["Advisor"] + "title": "Advisor", + "org": "", + "orgLink": "", + "desc": "", + "links": [ + { "icon": "github", "link": "https://github.com/damienwebdev" }, + { "icon": "twitter", "link": "https://twitter.com/damienwebdev" } + ], + "sponsor": "https://github.com/sponsors/damienwebdev" }, { + "avatar": "https://github.com/prisis.png", "name": "Daniel Bannert", - "github": "prisis", - "twitter": "_prisis_", - "roles": ["Organization Owner"] + "title": "Organization Owner", + "org": "", + "orgLink": "", + "desc": "", + "links": [ + { "icon": "github", "link": "https://github.com/prisis" }, + { "icon": "twitter", "link": "https://twitter.com/_prisis_" } + ], + "sponsor": "https://github.com/sponsors/prisis" }, { + "avatar": "https://github.com/ST-DDT.png", "name": "Daniel Theuke", - "github": "ST-DDT", - "roles": ["Code Maintainer", "Docs Automation"] + "title": "Code Maintainer | Docs Automation", + "org": "", + "orgLink": "", + "desc": "", + "links": [{ "icon": "github", "link": "https://github.com/ST-DDT" }], + "sponsor": "https://github.com/sponsors/ST-DDT" }, { + "avatar": "https://github.com/clarkerican.png", "name": "Erica Clark", - "github": "clarkerican", - "twitter": "clarkerican", - "roles": [] + "title": "", + "org": "", + "orgLink": "", + "desc": "", + "links": [ + { "icon": "github", "link": "https://github.com/clarkerican" }, + { "icon": "twitter", "link": "https://twitter.com/clarkerican" } + ] }, { + "avatar": "https://github.com/griest024.png", "name": "griest", - "github": "griest024", - "gitlab": "griest", - "roles": ["Code Reviewer"] + "title": "Code Reviewer", + "org": "", + "orgLink": "", + "desc": "", + "links": [ + { "icon": "github", "link": "https://github.com/griest024" }, + { "icon": "gitlab", "link": "https://gitlab.com/griest" } + ] }, { + "avatar": "https://github.com/JessicaSachs.png", "name": "Jessica Sachs", - "github": "JessicaSachs", - "twitter": "_JessicaSachs", - "roles": ["Press Officer"] + "title": "Press Officer", + "org": "", + "orgLink": "", + "desc": "", + "links": [ + { "icon": "github", "link": "https://github.com/JessicaSachs" }, + { "icon": "twitter", "link": "https://twitter.com/_JessicaSachs" } + ], + "sponsor": "https://github.com/sponsors/JessicaSachs" } ], "contributors": [ { + "avatar": "https://github.com/import-brain.png", "name": "Eric Cheng", - "github": "import-brain", - "roles": ["Triage", "Contributor"] + "title": "Triage", + "org": "", + "orgLink": "", + "desc": "", + "links": [{ "icon": "github", "link": "https://github.com/import-brain" }] }, { + "avatar": "https://github.com/xDivisionByZerox.png", "name": "Leyla Jรคhnig", - "github": "xDivisionByZerox", - "roles": ["Contributor"] + "title": "Contributor", + "desc": "", + "links": [ + { "icon": "github", "link": "https://github.com/xDivisionByZerox" } + ] }, { + "avatar": "https://github.com/pkuczynski.png", "name": "Piotr Kuczynski", - "github": "pkuczynski", - "twitter": "PiotrKuczynski", - "roles": ["Contributor"] + "title": "Contributor", + "org": "", + "orgLink": "", + "desc": "", + "links": [ + { "icon": "github", "link": "https://github.com/pkuczynski" }, + { "icon": "twitter", "link": "https://twitter.com/PiotrKuczynski" } + ], + "sponsor": "https://github.com/sponsors/pkuczynski" } ], - "previous": [ + "emeriti": [ { + "avatar": "https://github.com/MateusDadalto.png", "name": "Mateus Dadalto", - "github": "MateusDadalto", - "twitter": "MateusD", - "roles": [] + "links": [ + { "icon": "github", "link": "https://github.com/MateusDadalto" }, + { "icon": "twitter", "link": "https://twitter.com/MateusD" } + ] }, { + "avatar": "https://github.com/mmahalwy.png", "name": "Mo Mahallawy", - "github": "mmahalwy", - "twitter": "mmahalwy", - "roles": [] + "links": [ + { "icon": "github", "link": "https://github.com/mmahalwy" }, + { "icon": "twitter", "link": "https://twitter.com/mmahalwy" } + ] } ] } diff --git a/docs/migration-guide-v5/index.md b/docs/guide/migration-guide-v5.md similarity index 100% rename from docs/migration-guide-v5/index.md rename to docs/guide/migration-guide-v5.md diff --git a/docs/index.md b/docs/index.md index 7a4b9300289..8f5f6b552af 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,27 +1,38 @@ --- -home: true -title: 'Faker' -heroImage: /logo.svg -heroAlt: 'Cartoon logo of a panda magician' -heroText: 'Faker' -tagline: 'Generate massive amounts of fake (but realistic) data for testing and development.' -actionText: Get Started -actionLink: /guide/ -altActionText: Star -altActionLink: https://github.com/faker-js/faker +layout: home + +hero: + name: Faker + text: '' + tagline: Generate massive amounts of fake (but realistic) data for testing and development. + image: + src: /logo.svg + alt: Cartoon logo of a panda magician + actions: + - theme: brand + text: Get Started + link: /guide/ + - theme: alt + text: View on GitHub + link: https://github.com/faker-js/faker features: - - title: ๐Ÿ‘  Products + - icon: ๐Ÿ‘  + title: Products details: Generate Prices, Product Names, Adjectives, and Descriptions. - - title: ๐Ÿ’ธ Finance + - icon: ๐Ÿ’ธ + title: Finance details: Create stubbed out Account Details, Transactions, and Crypto Addresses. - - title: ๐Ÿ’Œ Addresses + - icon: ๐Ÿ’Œ + title: Addresses details: Generate valid Addresses, Zip Codes, Street Names, States, and Countries! - - title: ๐Ÿ‘พ Hacker Jargon + - icon: ๐Ÿ‘พ + title: Hacker Jargon details: โ€œTry to reboot the SQL bus, maybe it will bypass the virtual application!โ€ - - title: โฐ Time-based Data + - icon: โฐ + title: Time-based Data details: Past, present, future, recent, soon... whenever! - - title: ๐ŸŒ Localization + - icon: ๐ŸŒ + title: Localization details: Set a locale to generate realistic looking Names, Addresses, and Phone Numbers. -footer: MIT Licensed 2022 --- diff --git a/package.json b/package.json index d8f8a55c393..b0e15e8e861 100644 --- a/package.json +++ b/package.json @@ -93,25 +93,25 @@ ] }, "devDependencies": { - "@algolia/client-search": "~4.14.1", + "@algolia/client-search": "~4.14.2", "@types/markdown-it": "~12.2.3", - "@types/node": "~18.0.6", - "@types/prettier": "~2.6.4", - "@types/react": "~18.0.15", + "@types/node": "~18.6.4", + "@types/prettier": "~2.7.0", + "@types/react": "~18.0.16", "@types/sanitize-html": "~2.6.2", - "@types/validator": "~13.7.4", - "@typescript-eslint/eslint-plugin": "~5.31.0", - "@typescript-eslint/parser": "~5.31.0", - "@vitest/ui": "~0.19.1", + "@types/validator": "~13.7.5", + "@typescript-eslint/eslint-plugin": "~5.32.0", + "@typescript-eslint/parser": "~5.32.0", + "@vitest/ui": "~0.21.0", "c8": "~7.12.0", "conventional-changelog-cli": "~2.2.2", - "cypress": "~10.3.1", - "esbuild": "~0.14.51", - "eslint": "~8.20.0", + "cypress": "~10.4.0", + "esbuild": "~0.14.53", + "eslint": "~8.21.0", "eslint-config-prettier": "~8.5.0", - "eslint-define-config": "~1.5.1", + "eslint-define-config": "~1.6.0", "eslint-gitignore": "~0.1.0", - "eslint-plugin-jsdoc": "~39.3.3", + "eslint-plugin-jsdoc": "~39.3.4", "eslint-plugin-prettier": "~4.2.1", "glob": "~8.0.3", "lint-staged": "~13.0.3", @@ -119,23 +119,23 @@ "npm-run-all": "~4.1.5", "picocolors": "~1.0.0", "prettier": "2.7.1", - "prettier-plugin-organize-imports": "~3.0.0", + "prettier-plugin-organize-imports": "~3.0.2", "react": "~18.2.0", "react-dom": "~18.2.0", "rimraf": "~3.0.2", "sanitize-html": "~2.7.1", "simple-git-hooks": "~2.8.0", "standard-version": "~9.5.0", - "tsx": "~3.8.0", - "typedoc": "~0.23.9", + "tsx": "~3.8.1", + "typedoc": "~0.23.10", "typedoc-plugin-missing-exports": "~0.23.0", "typescript": "~4.7.4", "validator": "~13.7.0", - "vite": "~3.0.3", - "vitepress": "~0.22.4", - "vitest": "~0.19.1" + "vite": "~3.0.4", + "vitepress": "1.0.0-alpha.4", + "vitest": "~0.21.0" }, - "packageManager": "pnpm@7.6.0", + "packageManager": "pnpm@7.9.0", "engines": { "node": ">=14.0.0", "npm": ">=6.0.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d64e2115bf4..8b9285f060a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,25 +1,25 @@ lockfileVersion: 5.4 specifiers: - '@algolia/client-search': ~4.14.1 + '@algolia/client-search': ~4.14.2 '@types/markdown-it': ~12.2.3 - '@types/node': ~18.0.6 - '@types/prettier': ~2.6.4 - '@types/react': ~18.0.15 + '@types/node': ~18.6.4 + '@types/prettier': ~2.7.0 + '@types/react': ~18.0.16 '@types/sanitize-html': ~2.6.2 - '@types/validator': ~13.7.4 - '@typescript-eslint/eslint-plugin': ~5.31.0 - '@typescript-eslint/parser': ~5.31.0 - '@vitest/ui': ~0.19.1 + '@types/validator': ~13.7.5 + '@typescript-eslint/eslint-plugin': ~5.32.0 + '@typescript-eslint/parser': ~5.32.0 + '@vitest/ui': ~0.21.0 c8: ~7.12.0 conventional-changelog-cli: ~2.2.2 - cypress: ~10.3.1 - esbuild: ~0.14.51 - eslint: ~8.20.0 + cypress: ~10.4.0 + esbuild: ~0.14.53 + eslint: ~8.21.0 eslint-config-prettier: ~8.5.0 - eslint-define-config: ~1.5.1 + eslint-define-config: ~1.6.0 eslint-gitignore: ~0.1.0 - eslint-plugin-jsdoc: ~39.3.3 + eslint-plugin-jsdoc: ~39.3.4 eslint-plugin-prettier: ~4.2.1 glob: ~8.0.3 lint-staged: ~13.0.3 @@ -27,64 +27,64 @@ specifiers: npm-run-all: ~4.1.5 picocolors: ~1.0.0 prettier: 2.7.1 - prettier-plugin-organize-imports: ~3.0.0 + prettier-plugin-organize-imports: ~3.0.2 react: ~18.2.0 react-dom: ~18.2.0 rimraf: ~3.0.2 sanitize-html: ~2.7.1 simple-git-hooks: ~2.8.0 standard-version: ~9.5.0 - tsx: ~3.8.0 - typedoc: ~0.23.9 + tsx: ~3.8.1 + typedoc: ~0.23.10 typedoc-plugin-missing-exports: ~0.23.0 typescript: ~4.7.4 validator: ~13.7.0 - vite: ~3.0.3 - vitepress: ~0.22.4 - vitest: ~0.19.1 + vite: ~3.0.4 + vitepress: 1.0.0-alpha.4 + vitest: ~0.21.0 devDependencies: - '@algolia/client-search': 4.14.1 + '@algolia/client-search': 4.14.2 '@types/markdown-it': 12.2.3 - '@types/node': 18.0.6 - '@types/prettier': 2.6.4 - '@types/react': 18.0.15 + '@types/node': 18.6.4 + '@types/prettier': 2.7.0 + '@types/react': 18.0.16 '@types/sanitize-html': 2.6.2 - '@types/validator': 13.7.4 - '@typescript-eslint/eslint-plugin': 5.31.0_d5zwcxr4bwkhmuo464cb3a2puu - '@typescript-eslint/parser': 5.31.0_he2ccbldppg44uulnyq4rwocfa - '@vitest/ui': 0.19.1 + '@types/validator': 13.7.5 + '@typescript-eslint/eslint-plugin': 5.32.0_iosr3hrei2tubxveewluhu5lhy + '@typescript-eslint/parser': 5.32.0_qugx7qdu5zevzvxaiqyxfiwquq + '@vitest/ui': 0.21.0 c8: 7.12.0 conventional-changelog-cli: 2.2.2 - cypress: 10.3.1 - esbuild: 0.14.51 - eslint: 8.20.0 - eslint-config-prettier: 8.5.0_eslint@8.20.0 - eslint-define-config: 1.5.1 - eslint-gitignore: 0.1.0_eslint@8.20.0 - eslint-plugin-jsdoc: 39.3.3_eslint@8.20.0 - eslint-plugin-prettier: 4.2.1_g4fztgbwjyq2fvmcscny2sj6fy + cypress: 10.4.0 + esbuild: 0.14.53 + eslint: 8.21.0 + eslint-config-prettier: 8.5.0_eslint@8.21.0 + eslint-define-config: 1.6.0 + eslint-gitignore: 0.1.0_eslint@8.21.0 + eslint-plugin-jsdoc: 39.3.4_eslint@8.21.0 + eslint-plugin-prettier: 4.2.1_h62lvancfh4b7r6zn2dgodrh5e glob: 8.0.3 lint-staged: 13.0.3 mime-db: 1.52.0 npm-run-all: 4.1.5 picocolors: 1.0.0 prettier: 2.7.1 - prettier-plugin-organize-imports: 3.0.0_gd3y7r3s3evy6b2vthd7dmacga + prettier-plugin-organize-imports: 3.0.2_gd3y7r3s3evy6b2vthd7dmacga react: 18.2.0 react-dom: 18.2.0_react@18.2.0 rimraf: 3.0.2 sanitize-html: 2.7.1 simple-git-hooks: 2.8.0 standard-version: 9.5.0 - tsx: 3.8.0 - typedoc: 0.23.9_typescript@4.7.4 - typedoc-plugin-missing-exports: 0.23.0_typedoc@0.23.9 + tsx: 3.8.1 + typedoc: 0.23.10_typescript@4.7.4 + typedoc-plugin-missing-exports: 0.23.0_typedoc@0.23.10 typescript: 4.7.4 validator: 13.7.0 - vite: 3.0.3 - vitepress: 0.22.4_ju6wpa2hqqdrjfl4p3m6tanjem - vitest: 0.19.1_jcfjdqfldivpyjgll3wfgmwbia + vite: 3.0.4 + vitepress: 1.0.0-alpha.4_zjzrc7rfs5jgdvevvkgm5g7e44 + vitest: 0.21.0_y7ksokcqbrho27xsbc2olnpwva packages: @@ -94,144 +94,109 @@ packages: '@algolia/autocomplete-shared': 1.7.1 dev: true - /@algolia/autocomplete-preset-algolia/1.7.1_peqgqe7uij6smhko32m3outymy: + /@algolia/autocomplete-preset-algolia/1.7.1_qs6lk5nhygj2o3hj4sf6xnr724: resolution: {integrity: sha512-pJwmIxeJCymU1M6cGujnaIYcY3QPOVYZOXhFkWVM7IxKzy272BwCvMFMyc5NpG/QmiObBxjo7myd060OeTNJXg==} peerDependencies: '@algolia/client-search': ^4.9.1 algoliasearch: ^4.9.1 dependencies: '@algolia/autocomplete-shared': 1.7.1 - '@algolia/client-search': 4.14.1 - algoliasearch: 4.13.1 + '@algolia/client-search': 4.14.2 + algoliasearch: 4.14.2 dev: true /@algolia/autocomplete-shared/1.7.1: resolution: {integrity: sha512-eTmGVqY3GeyBTT8IWiB2K5EuURAqhnumfktAEoHxfDY2o7vg2rSnO16ZtIG0fMgt3py28Vwgq42/bVEuaQV7pg==} dev: true - /@algolia/cache-browser-local-storage/4.13.1: - resolution: {integrity: sha512-UAUVG2PEfwd/FfudsZtYnidJ9eSCpS+LW9cQiesePQLz41NAcddKxBak6eP2GErqyFagSlnVXe/w2E9h2m2ttg==} + /@algolia/cache-browser-local-storage/4.14.2: + resolution: {integrity: sha512-FRweBkK/ywO+GKYfAWbrepewQsPTIEirhi1BdykX9mxvBPtGNKccYAxvGdDCumU1jL4r3cayio4psfzKMejBlA==} dependencies: - '@algolia/cache-common': 4.13.1 + '@algolia/cache-common': 4.14.2 dev: true - /@algolia/cache-common/4.13.1: - resolution: {integrity: sha512-7Vaf6IM4L0Jkl3sYXbwK+2beQOgVJ0mKFbz/4qSxKd1iy2Sp77uTAazcX+Dlexekg1fqGUOSO7HS4Sx47ZJmjA==} + /@algolia/cache-common/4.14.2: + resolution: {integrity: sha512-SbvAlG9VqNanCErr44q6lEKD2qoK4XtFNx9Qn8FK26ePCI8I9yU7pYB+eM/cZdS9SzQCRJBbHUumVr4bsQ4uxg==} dev: true - /@algolia/cache-common/4.14.1: - resolution: {integrity: sha512-XhAzm0Sm3D3DuOWUyDoVSXZ/RjYMvI1rbki+QH4ODAVaHDWVhMhg3IJPv3gIbBQnEQdtPdBhsf2hyPxAu28E5w==} - dev: true - - /@algolia/cache-in-memory/4.13.1: - resolution: {integrity: sha512-pZzybCDGApfA/nutsFK1P0Sbsq6fYJU3DwIvyKg4pURerlJM4qZbB9bfLRef0FkzfQu7W11E4cVLCIOWmyZeuQ==} - dependencies: - '@algolia/cache-common': 4.13.1 - dev: true - - /@algolia/client-account/4.13.1: - resolution: {integrity: sha512-TFLiZ1KqMiir3FNHU+h3b0MArmyaHG+eT8Iojio6TdpeFcAQ1Aiy+2gb3SZk3+pgRJa/BxGmDkRUwE5E/lv3QQ==} + /@algolia/cache-in-memory/4.14.2: + resolution: {integrity: sha512-HrOukWoop9XB/VFojPv1R5SVXowgI56T9pmezd/djh2JnVN/vXswhXV51RKy4nCpqxyHt/aGFSq2qkDvj6KiuQ==} dependencies: - '@algolia/client-common': 4.13.1 - '@algolia/client-search': 4.13.1 - '@algolia/transporter': 4.13.1 + '@algolia/cache-common': 4.14.2 dev: true - /@algolia/client-analytics/4.13.1: - resolution: {integrity: sha512-iOS1JBqh7xaL5x00M5zyluZ9+9Uy9GqtYHv/2SMuzNW1qP7/0doz1lbcsP3S7KBbZANJTFHUOfuqyRLPk91iFA==} + /@algolia/client-account/4.14.2: + resolution: {integrity: sha512-WHtriQqGyibbb/Rx71YY43T0cXqyelEU0lB2QMBRXvD2X0iyeGl4qMxocgEIcbHyK7uqE7hKgjT8aBrHqhgc1w==} dependencies: - '@algolia/client-common': 4.13.1 - '@algolia/client-search': 4.13.1 - '@algolia/requester-common': 4.13.1 - '@algolia/transporter': 4.13.1 + '@algolia/client-common': 4.14.2 + '@algolia/client-search': 4.14.2 + '@algolia/transporter': 4.14.2 dev: true - /@algolia/client-common/4.13.1: - resolution: {integrity: sha512-LcDoUE0Zz3YwfXJL6lJ2OMY2soClbjrrAKB6auYVMNJcoKZZ2cbhQoFR24AYoxnGUYBER/8B+9sTBj5bj/Gqbg==} + /@algolia/client-analytics/4.14.2: + resolution: {integrity: sha512-yBvBv2mw+HX5a+aeR0dkvUbFZsiC4FKSnfqk9rrfX+QrlNOKEhCG0tJzjiOggRW4EcNqRmaTULIYvIzQVL2KYQ==} dependencies: - '@algolia/requester-common': 4.13.1 - '@algolia/transporter': 4.13.1 + '@algolia/client-common': 4.14.2 + '@algolia/client-search': 4.14.2 + '@algolia/requester-common': 4.14.2 + '@algolia/transporter': 4.14.2 dev: true - /@algolia/client-common/4.14.1: - resolution: {integrity: sha512-WDwziD7Rt1yCRDfONmeLOfh1Lt8uOy6Vn7dma171KOH9NN3q8yDQpOhPqdFOCz1j3GC1FfIZxaC0YEOIobZ2lg==} + /@algolia/client-common/4.14.2: + resolution: {integrity: sha512-43o4fslNLcktgtDMVaT5XwlzsDPzlqvqesRi4MjQz2x4/Sxm7zYg5LRYFol1BIhG6EwxKvSUq8HcC/KxJu3J0Q==} dependencies: - '@algolia/requester-common': 4.14.1 - '@algolia/transporter': 4.14.1 + '@algolia/requester-common': 4.14.2 + '@algolia/transporter': 4.14.2 dev: true - /@algolia/client-personalization/4.13.1: - resolution: {integrity: sha512-1CqrOW1ypVrB4Lssh02hP//YxluoIYXAQCpg03L+/RiXJlCs+uIqlzC0ctpQPmxSlTK6h07kr50JQoYH/TIM9w==} + /@algolia/client-personalization/4.14.2: + resolution: {integrity: sha512-ACCoLi0cL8CBZ1W/2juehSltrw2iqsQBnfiu/Rbl9W2yE6o2ZUb97+sqN/jBqYNQBS+o0ekTMKNkQjHHAcEXNw==} dependencies: - '@algolia/client-common': 4.13.1 - '@algolia/requester-common': 4.13.1 - '@algolia/transporter': 4.13.1 + '@algolia/client-common': 4.14.2 + '@algolia/requester-common': 4.14.2 + '@algolia/transporter': 4.14.2 dev: true - /@algolia/client-search/4.13.1: - resolution: {integrity: sha512-YQKYA83MNRz3FgTNM+4eRYbSmHi0WWpo019s5SeYcL3HUan/i5R09VO9dk3evELDFJYciiydSjbsmhBzbpPP2A==} + /@algolia/client-search/4.14.2: + resolution: {integrity: sha512-L5zScdOmcZ6NGiVbLKTvP02UbxZ0njd5Vq9nJAmPFtjffUSOGEp11BmD2oMJ5QvARgx2XbX4KzTTNS5ECYIMWw==} dependencies: - '@algolia/client-common': 4.13.1 - '@algolia/requester-common': 4.13.1 - '@algolia/transporter': 4.13.1 - dev: true - - /@algolia/client-search/4.14.1: - resolution: {integrity: sha512-K6XrdIIQq8a3o+kCedj5slUVzA1aKttae4mLzwnY0bS7tYduv1IQggi9Sz8gOG6/MMyKMB4IwYqr47t/0z4Vxw==} - dependencies: - '@algolia/client-common': 4.14.1 - '@algolia/requester-common': 4.14.1 - '@algolia/transporter': 4.14.1 - dev: true - - /@algolia/logger-common/4.13.1: - resolution: {integrity: sha512-L6slbL/OyZaAXNtS/1A8SAbOJeEXD5JcZeDCPYDqSTYScfHu+2ePRTDMgUTY4gQ7HsYZ39N1LujOd8WBTmM2Aw==} + '@algolia/client-common': 4.14.2 + '@algolia/requester-common': 4.14.2 + '@algolia/transporter': 4.14.2 dev: true - /@algolia/logger-common/4.14.1: - resolution: {integrity: sha512-58CK87wTjUWI1QNXc3nFDQ7EXBi28NoLufXE9sMjng2fAL1wPdyO+KFD8KTBoXOZnJWflPj5F7p6jLyGAfgvcQ==} + /@algolia/logger-common/4.14.2: + resolution: {integrity: sha512-/JGlYvdV++IcMHBnVFsqEisTiOeEr6cUJtpjz8zc0A9c31JrtLm318Njc72p14Pnkw3A/5lHHh+QxpJ6WFTmsA==} dev: true - /@algolia/logger-console/4.13.1: - resolution: {integrity: sha512-7jQOTftfeeLlnb3YqF8bNgA2GZht7rdKkJ31OCeSH2/61haO0tWPoNRjZq9XLlgMQZH276pPo0NdiArcYPHjCA==} + /@algolia/logger-console/4.14.2: + resolution: {integrity: sha512-8S2PlpdshbkwlLCSAB5f8c91xyc84VM9Ar9EdfE9UmX+NrKNYnWR1maXXVDQQoto07G1Ol/tYFnFVhUZq0xV/g==} dependencies: - '@algolia/logger-common': 4.13.1 + '@algolia/logger-common': 4.14.2 dev: true - /@algolia/requester-browser-xhr/4.13.1: - resolution: {integrity: sha512-oa0CKr1iH6Nc7CmU6RE7TnXMjHnlyp7S80pP/LvZVABeJHX3p/BcSCKovNYWWltgTxUg0U1o+2uuy8BpMKljwA==} + /@algolia/requester-browser-xhr/4.14.2: + resolution: {integrity: sha512-CEh//xYz/WfxHFh7pcMjQNWgpl4wFB85lUMRyVwaDPibNzQRVcV33YS+63fShFWc2+42YEipFGH2iPzlpszmDw==} dependencies: - '@algolia/requester-common': 4.13.1 + '@algolia/requester-common': 4.14.2 dev: true - /@algolia/requester-common/4.13.1: - resolution: {integrity: sha512-eGVf0ID84apfFEuXsaoSgIxbU3oFsIbz4XiotU3VS8qGCJAaLVUC5BUJEkiFENZIhon7hIB4d0RI13HY4RSA+w==} + /@algolia/requester-common/4.14.2: + resolution: {integrity: sha512-73YQsBOKa5fvVV3My7iZHu1sUqmjjfs9TteFWwPwDmnad7T0VTCopttcsM3OjLxZFtBnX61Xxl2T2gmG2O4ehg==} dev: true - /@algolia/requester-common/4.14.1: - resolution: {integrity: sha512-EbXBKrfYcX5/JJfaw7IZxhWlbUtjd5Chs+Alrfc4tutgRQn4dmImWS07n3iffwJcYdOWY1eRrnfBK5BwopuN5A==} - dev: true - - /@algolia/requester-node-http/4.13.1: - resolution: {integrity: sha512-7C0skwtLdCz5heKTVe/vjvrqgL/eJxmiEjHqXdtypcE5GCQCYI15cb+wC4ytYioZDMiuDGeVYmCYImPoEgUGPw==} - dependencies: - '@algolia/requester-common': 4.13.1 - dev: true - - /@algolia/transporter/4.13.1: - resolution: {integrity: sha512-pICnNQN7TtrcYJqqPEXByV8rJ8ZRU2hCiIKLTLRyNpghtQG3VAFk6fVtdzlNfdUGZcehSKGarPIZEHlQXnKjgw==} + /@algolia/requester-node-http/4.14.2: + resolution: {integrity: sha512-oDbb02kd1o5GTEld4pETlPZLY0e+gOSWjWMJHWTgDXbv9rm/o2cF7japO6Vj1ENnrqWvLBmW1OzV9g6FUFhFXg==} dependencies: - '@algolia/cache-common': 4.13.1 - '@algolia/logger-common': 4.13.1 - '@algolia/requester-common': 4.13.1 + '@algolia/requester-common': 4.14.2 dev: true - /@algolia/transporter/4.14.1: - resolution: {integrity: sha512-xbmoIqszFDOCCZqizBQ2TNHcGtjZX7EkJCzABsrokA0WqtfZzClFmtc+tZYgtEiyAfIF70alTegG19poQGdkvg==} + /@algolia/transporter/4.14.2: + resolution: {integrity: sha512-t89dfQb2T9MFQHidjHcfhh6iGMNwvuKUvojAj+JsrHAGbuSy7yE4BylhLX6R0Q1xYRoC4Vvv+O5qIw/LdnQfsQ==} dependencies: - '@algolia/cache-common': 4.14.1 - '@algolia/logger-common': 4.14.1 - '@algolia/requester-common': 4.14.1 + '@algolia/cache-common': 4.14.2 + '@algolia/logger-common': 4.14.2 + '@algolia/requester-common': 4.14.2 dev: true /@babel/code-frame/7.18.6: @@ -241,6 +206,11 @@ packages: '@babel/highlight': 7.18.6 dev: true + /@babel/helper-string-parser/7.18.10: + resolution: {integrity: sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw==} + engines: {node: '>=6.9.0'} + dev: true + /@babel/helper-validator-identifier/7.18.6: resolution: {integrity: sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==} engines: {node: '>=6.9.0'} @@ -255,18 +225,19 @@ packages: js-tokens: 4.0.0 dev: true - /@babel/parser/7.18.8: - resolution: {integrity: sha512-RSKRfYX20dyH+elbJK2uqAkVyucL+xXzhqlMD5/ZXx+dAAwpyB7HsvnHe/ZUGOF+xLr5Wx9/JoXVTj6BQE2/oA==} + /@babel/parser/7.18.11: + resolution: {integrity: sha512-9JKn5vN+hDt0Hdqn1PiJ2guflwP+B6Ga8qbDuoF0PzzVhrzsKIJo8yGqVk6CmMHiMei9w1C1Bp9IMJSIK+HPIQ==} engines: {node: '>=6.0.0'} hasBin: true dependencies: - '@babel/types': 7.18.8 + '@babel/types': 7.18.10 dev: true - /@babel/types/7.18.8: - resolution: {integrity: sha512-qwpdsmraq0aJ3osLJRApsc2ouSJCdnMeZwB0DhbtHAtRpZNZCdlbRnHIgcRKzdE1g0iOGg644fzjOBcdOz9cPw==} + /@babel/types/7.18.10: + resolution: {integrity: sha512-MJvnbEiiNkpjo+LknnmRrqbY1GPUUggjv+wQVjetM/AONoupqRALB7I6jGqNUAZsKcRIEu2J6FRFvsczljjsaQ==} engines: {node: '>=6.9.0'} dependencies: + '@babel/helper-string-parser': 7.18.10 '@babel/helper-validator-identifier': 7.18.6 to-fast-properties: 2.0.0 dev: true @@ -315,14 +286,14 @@ packages: - supports-color dev: true - /@docsearch/css/3.1.1: - resolution: {integrity: sha512-utLgg7E1agqQeqCJn05DWC7XXMk4tMUUnL7MZupcknRu2OzGN13qwey2qA/0NAKkVBGugiWtON0+rlU0QIPojg==} + /@docsearch/css/3.2.0: + resolution: {integrity: sha512-jnNrO2JVYYhj2pP2FomlHIy6220n6mrLn2t9v2/qc+rM7M/fbIcKMgk9ky4RN+L/maUEmteckzg6/PIYoAAXJg==} dev: true - /@docsearch/js/3.1.1_ju6wpa2hqqdrjfl4p3m6tanjem: - resolution: {integrity: sha512-bt7l2aKRoSnLUuX+s4LVQ1a7AF2c9myiZNv5uvQCePG5tpvVGpwrnMwqVXOUJn9q6FwVVhOrQMO/t+QmnnAEUw==} + /@docsearch/js/3.2.0_zjzrc7rfs5jgdvevvkgm5g7e44: + resolution: {integrity: sha512-FEgXW8a+ZKBjSDteFPsKQ7Hlzk6+18A2Y7NffjV+VTsE7P3uTvHPKHKDCeYMnAgXTatRCGHWCfP7YImTSwEFQA==} dependencies: - '@docsearch/react': 3.1.1_ju6wpa2hqqdrjfl4p3m6tanjem + '@docsearch/react': 3.2.0_zjzrc7rfs5jgdvevvkgm5g7e44 preact: 10.10.0 transitivePeerDependencies: - '@algolia/client-search' @@ -331,18 +302,18 @@ packages: - react-dom dev: true - /@docsearch/react/3.1.1_ju6wpa2hqqdrjfl4p3m6tanjem: - resolution: {integrity: sha512-cfoql4qvtsVRqBMYxhlGNpvyy/KlCoPqjIsJSZYqYf9AplZncKjLBTcwBu6RXFMVCe30cIFljniI4OjqAU67pQ==} + /@docsearch/react/3.2.0_zjzrc7rfs5jgdvevvkgm5g7e44: + resolution: {integrity: sha512-ATS3w5JBgQGQF0kHn5iOAPfnCCaoLouZQMmI7oENV//QMFrYbjhUZxBU9lIwAT7Rzybud+Jtb4nG5IEjBk3Ixw==} peerDependencies: '@types/react': '>= 16.8.0 < 19.0.0' react: '>= 16.8.0 < 19.0.0' react-dom: '>= 16.8.0 < 19.0.0' dependencies: '@algolia/autocomplete-core': 1.7.1 - '@algolia/autocomplete-preset-algolia': 1.7.1_peqgqe7uij6smhko32m3outymy - '@docsearch/css': 3.1.1 - '@types/react': 18.0.15 - algoliasearch: 4.13.1 + '@algolia/autocomplete-preset-algolia': 1.7.1_qs6lk5nhygj2o3hj4sf6xnr724 + '@docsearch/css': 3.2.0 + '@types/react': 18.0.16 + algoliasearch: 4.14.2 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 transitivePeerDependencies: @@ -358,8 +329,8 @@ packages: jsdoc-type-pratt-parser: 3.1.0 dev: true - /@esbuild-kit/cjs-loader/2.3.1: - resolution: {integrity: sha512-ov6ALYD9xZSPoo5mmGOQtEC/b0xXeUlPy65p8aHMHLF4DfBEe8Y+iquH2lTDsy6Iskc1uMTadF+SVADTSTNJMA==} + /@esbuild-kit/cjs-loader/2.3.3: + resolution: {integrity: sha512-Rt4O1mXlPEDVxvjsHLgbtHVdUXYK9C1/6ThpQnt7FaXIjUOsI6qhHYMgALhNnlIMZffag44lXd6Dqgx3xALbpQ==} dependencies: '@esbuild-kit/core-utils': 2.1.0 get-tsconfig: 4.2.0 @@ -368,25 +339,34 @@ packages: /@esbuild-kit/core-utils/2.1.0: resolution: {integrity: sha512-fZirrc2KjeTumVjE4bpleWOk2gD83b7WuGeQqOceKFQL+heNKKkNB5G5pekOUTLzfSBc0hP7hCSBoD9TuR0hLw==} dependencies: - esbuild: 0.14.51 + esbuild: 0.14.53 source-map-support: 0.5.21 dev: true - /@esbuild-kit/esm-loader/2.4.1: - resolution: {integrity: sha512-6x44rygVfNODm27v0RW3wX5y61mqSrXDvB39G0nomgWWqxG3mjiKtPSwrFppdkrA39QIqDgVlD4gJmPOxnleSw==} + /@esbuild-kit/esm-loader/2.4.2: + resolution: {integrity: sha512-N9dPKAj8WOx6djVnStgILWXip4fjDcBk9L7azO0/uQDpu8Ee0eaL78mkN4Acid9BzvNAKWwdYXFJZnsVahNEew==} dependencies: '@esbuild-kit/core-utils': 2.1.0 get-tsconfig: 4.2.0 dev: true + /@esbuild/linux-loong64/0.14.53: + resolution: {integrity: sha512-W2dAL6Bnyn4xa/QRSU3ilIK4EzD5wgYXKXJiS1HDF5vU3675qc2bvFyLwbUcdmssDveyndy7FbitrCoiV/eMLg==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@eslint/eslintrc/1.3.0: resolution: {integrity: sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 debug: 4.3.4 - espree: 9.3.2 - globals: 13.16.0 + espree: 9.3.3 + globals: 13.17.0 ignore: 5.2.0 import-fresh: 3.3.0 js-yaml: 4.1.0 @@ -396,8 +376,8 @@ packages: - supports-color dev: true - /@humanwhocodes/config-array/0.9.5: - resolution: {integrity: sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==} + /@humanwhocodes/config-array/0.10.4: + resolution: {integrity: sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw==} engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 1.2.1 @@ -407,6 +387,10 @@ packages: - supports-color dev: true + /@humanwhocodes/gitignore-to-minimatch/1.0.2: + resolution: {integrity: sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA==} + dev: true + /@humanwhocodes/object-schema/1.2.1: resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} dev: true @@ -499,28 +483,28 @@ packages: resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} dev: true - /@types/node/14.18.22: - resolution: {integrity: sha512-qzaYbXVzin6EPjghf/hTdIbnVW1ErMx8rPzwRNJhlbyJhu2SyqlvjGOY/tbUt6VFyzg56lROcOeSQRInpt63Yw==} + /@types/node/14.18.23: + resolution: {integrity: sha512-MhbCWN18R4GhO8ewQWAFK4TGQdBpXWByukz7cWyJmXhvRuCIaM/oWytGPqVmDzgEnnaIc9ss6HbU5mUi+vyZPA==} dev: true - /@types/node/18.0.6: - resolution: {integrity: sha512-/xUq6H2aQm261exT6iZTMifUySEt4GR5KX8eYyY+C4MSNPqSh9oNIP7tz2GLKTlFaiBbgZNxffoR3CVRG+cljw==} + /@types/node/18.6.4: + resolution: {integrity: sha512-I4BD3L+6AWiUobfxZ49DlU43gtI+FTHSv9pE2Zekg6KjMpre4ByusaljW3vYSLJrvQ1ck1hUaeVu8HVlY3vzHg==} dev: true /@types/normalize-package-data/2.4.1: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} dev: true - /@types/prettier/2.6.4: - resolution: {integrity: sha512-fOwvpvQYStpb/zHMx0Cauwywu9yLDmzWiiQBC7gJyq5tYLUXFZvDG7VK1B7WBxxjBJNKFOZ0zLoOQn8vmATbhw==} + /@types/prettier/2.7.0: + resolution: {integrity: sha512-RI1L7N4JnW5gQw2spvL7Sllfuf1SaHdrZpCHiBlCXjIlufi1SMNnbu2teze3/QE67Fg2tBlH7W+mi4hVNk4p0A==} dev: true /@types/prop-types/15.7.5: resolution: {integrity: sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==} dev: true - /@types/react/18.0.15: - resolution: {integrity: sha512-iz3BtLuIYH1uWdsv6wXYdhozhqj20oD4/Hk2DNXIn1kFsmp9x8d9QB6FnPhfkbhd2PgEONt9Q1x/ebkwjfFLow==} + /@types/react/18.0.16: + resolution: {integrity: sha512-3vX1dzVucqc2nhXtzyaParTIIRZeNbisRqLE7QdeLomVybEyeiuAouzZXgz71P+2kbJOqj3dy0fzoATg2I06GQ==} dependencies: '@types/prop-types': 15.7.5 '@types/scheduler': 0.16.2 @@ -545,20 +529,24 @@ packages: resolution: {integrity: sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ==} dev: true - /@types/validator/13.7.4: - resolution: {integrity: sha512-uAaSWegu2lymY18l+s5nmcXu3sFeeTOl1zhSGoYzcr6T3wz1M+3OcW4UjfPhIhHGd13tIMRDsEpR+d8w/MexwQ==} + /@types/validator/13.7.5: + resolution: {integrity: sha512-9rQHeAqz6Jw3gDhttkmWetoriW5FPbxylv/6h6mXtaj2NKRcOvOmvfcswVdLVpbuy10NrO486K3lCoLgoIhiIA==} + dev: true + + /@types/web-bluetooth/0.0.14: + resolution: {integrity: sha512-5d2RhCard1nQUC3aHcq/gHzWYO6K0WJmAbjO7mQJgCQKtZpgXxv1rOM6O/dBDhDYYVutk1sciOgNSe+5YyfM8A==} dev: true /@types/yauzl/2.10.0: resolution: {integrity: sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==} requiresBuild: true dependencies: - '@types/node': 18.0.6 + '@types/node': 18.6.4 dev: true optional: true - /@typescript-eslint/eslint-plugin/5.31.0_d5zwcxr4bwkhmuo464cb3a2puu: - resolution: {integrity: sha512-VKW4JPHzG5yhYQrQ1AzXgVgX8ZAJEvCz0QI6mLRX4tf7rnFfh5D8SKm0Pq6w5PyNfAWJk6sv313+nEt3ohWMBQ==} + /@typescript-eslint/eslint-plugin/5.32.0_iosr3hrei2tubxveewluhu5lhy: + resolution: {integrity: sha512-CHLuz5Uz7bHP2WgVlvoZGhf0BvFakBJKAD/43Ty0emn4wXWv5k01ND0C0fHcl/Im8Td2y/7h44E9pca9qAu2ew==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: '@typescript-eslint/parser': ^5.0.0 @@ -568,12 +556,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.31.0_he2ccbldppg44uulnyq4rwocfa - '@typescript-eslint/scope-manager': 5.31.0 - '@typescript-eslint/type-utils': 5.31.0_he2ccbldppg44uulnyq4rwocfa - '@typescript-eslint/utils': 5.31.0_he2ccbldppg44uulnyq4rwocfa + '@typescript-eslint/parser': 5.32.0_qugx7qdu5zevzvxaiqyxfiwquq + '@typescript-eslint/scope-manager': 5.32.0 + '@typescript-eslint/type-utils': 5.32.0_qugx7qdu5zevzvxaiqyxfiwquq + '@typescript-eslint/utils': 5.32.0_qugx7qdu5zevzvxaiqyxfiwquq debug: 4.3.4 - eslint: 8.20.0 + eslint: 8.21.0 functional-red-black-tree: 1.0.1 ignore: 5.2.0 regexpp: 3.2.0 @@ -584,8 +572,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser/5.31.0_he2ccbldppg44uulnyq4rwocfa: - resolution: {integrity: sha512-UStjQiZ9OFTFReTrN+iGrC6O/ko9LVDhreEK5S3edmXgR396JGq7CoX2TWIptqt/ESzU2iRKXAHfSF2WJFcWHw==} + /@typescript-eslint/parser/5.32.0_qugx7qdu5zevzvxaiqyxfiwquq: + resolution: {integrity: sha512-IxRtsehdGV9GFQ35IGm5oKKR2OGcazUoiNBxhRV160iF9FoyuXxjY+rIqs1gfnd+4eL98OjeGnMpE7RF/NBb3A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -594,26 +582,26 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.31.0 - '@typescript-eslint/types': 5.31.0 - '@typescript-eslint/typescript-estree': 5.31.0_typescript@4.7.4 + '@typescript-eslint/scope-manager': 5.32.0 + '@typescript-eslint/types': 5.32.0 + '@typescript-eslint/typescript-estree': 5.32.0_typescript@4.7.4 debug: 4.3.4 - eslint: 8.20.0 + eslint: 8.21.0 typescript: 4.7.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/scope-manager/5.31.0: - resolution: {integrity: sha512-8jfEzBYDBG88rcXFxajdVavGxb5/XKXyvWgvD8Qix3EEJLCFIdVloJw+r9ww0wbyNLOTYyBsR+4ALNGdlalLLg==} + /@typescript-eslint/scope-manager/5.32.0: + resolution: {integrity: sha512-KyAE+tUON0D7tNz92p1uetRqVJiiAkeluvwvZOqBmW9z2XApmk5WSMV9FrzOroAcVxJZB3GfUwVKr98Dr/OjOg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.31.0 - '@typescript-eslint/visitor-keys': 5.31.0 + '@typescript-eslint/types': 5.32.0 + '@typescript-eslint/visitor-keys': 5.32.0 dev: true - /@typescript-eslint/type-utils/5.31.0_he2ccbldppg44uulnyq4rwocfa: - resolution: {integrity: sha512-7ZYqFbvEvYXFn9ax02GsPcEOmuWNg+14HIf4q+oUuLnMbpJ6eHAivCg7tZMVwzrIuzX3QCeAOqKoyMZCv5xe+w==} + /@typescript-eslint/type-utils/5.32.0_qugx7qdu5zevzvxaiqyxfiwquq: + resolution: {integrity: sha512-0gSsIhFDduBz3QcHJIp3qRCvVYbqzHg8D6bHFsDMrm0rURYDj+skBK2zmYebdCp+4nrd9VWd13egvhYFJj/wZg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '*' @@ -622,22 +610,22 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/utils': 5.31.0_he2ccbldppg44uulnyq4rwocfa + '@typescript-eslint/utils': 5.32.0_qugx7qdu5zevzvxaiqyxfiwquq debug: 4.3.4 - eslint: 8.20.0 + eslint: 8.21.0 tsutils: 3.21.0_typescript@4.7.4 typescript: 4.7.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/types/5.31.0: - resolution: {integrity: sha512-/f/rMaEseux+I4wmR6mfpM2wvtNZb1p9hAV77hWfuKc3pmaANp5dLAZSiE3/8oXTYTt3uV9KW5yZKJsMievp6g==} + /@typescript-eslint/types/5.32.0: + resolution: {integrity: sha512-EBUKs68DOcT/EjGfzywp+f8wG9Zw6gj6BjWu7KV/IYllqKJFPlZlLSYw/PTvVyiRw50t6wVbgv4p9uE2h6sZrQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree/5.31.0_typescript@4.7.4: - resolution: {integrity: sha512-3S625TMcARX71wBc2qubHaoUwMEn+l9TCsaIzYI/ET31Xm2c9YQ+zhGgpydjorwQO9pLfR/6peTzS/0G3J/hDw==} + /@typescript-eslint/typescript-estree/5.32.0_typescript@4.7.4: + resolution: {integrity: sha512-ZVAUkvPk3ITGtCLU5J4atCw9RTxK+SRc6hXqLtllC2sGSeMFWN+YwbiJR9CFrSFJ3w4SJfcWtDwNb/DmUIHdhg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: typescript: '*' @@ -645,8 +633,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.31.0 - '@typescript-eslint/visitor-keys': 5.31.0 + '@typescript-eslint/types': 5.32.0 + '@typescript-eslint/visitor-keys': 5.32.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -657,29 +645,29 @@ packages: - supports-color dev: true - /@typescript-eslint/utils/5.31.0_he2ccbldppg44uulnyq4rwocfa: - resolution: {integrity: sha512-kcVPdQS6VIpVTQ7QnGNKMFtdJdvnStkqS5LeALr4rcwx11G6OWb2HB17NMPnlRHvaZP38hL9iK8DdE9Fne7NYg==} + /@typescript-eslint/utils/5.32.0_qugx7qdu5zevzvxaiqyxfiwquq: + resolution: {integrity: sha512-W7lYIAI5Zlc5K082dGR27Fczjb3Q57ECcXefKU/f0ajM5ToM0P+N9NmJWip8GmGu/g6QISNT+K6KYB+iSHjXCQ==} 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 - '@typescript-eslint/scope-manager': 5.31.0 - '@typescript-eslint/types': 5.31.0 - '@typescript-eslint/typescript-estree': 5.31.0_typescript@4.7.4 - eslint: 8.20.0 + '@typescript-eslint/scope-manager': 5.32.0 + '@typescript-eslint/types': 5.32.0 + '@typescript-eslint/typescript-estree': 5.32.0_typescript@4.7.4 + eslint: 8.21.0 eslint-scope: 5.1.1 - eslint-utils: 3.0.0_eslint@8.20.0 + eslint-utils: 3.0.0_eslint@8.21.0 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/visitor-keys/5.31.0: - resolution: {integrity: sha512-ZK0jVxSjS4gnPirpVjXHz7mgdOsZUHzNYSfTw2yPa3agfbt9YfqaBiBZFSSxeBWnpWkzCxTfUpnzA3Vily/CSg==} + /@typescript-eslint/visitor-keys/5.32.0: + resolution: {integrity: sha512-S54xOHZgfThiZ38/ZGTgB2rqx51CMJ5MCfVT2IplK4Q7hgzGfe0nLzLCcenDnc/cSjP568hdeKfeDcBgqNHD/g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.31.0 + '@typescript-eslint/types': 5.32.0 eslint-visitor-keys: 3.3.0 dev: true @@ -694,8 +682,8 @@ packages: vue: 3.2.37 dev: true - /@vitest/ui/0.19.1: - resolution: {integrity: sha512-TmbEJmcieK7chFJqdkgni4Lq/2MY6fKoxGPktromnnyabBkQFSGJlAl5vzFMYy8SfCj/zyaZy48FzDdWixziKg==} + /@vitest/ui/0.21.0: + resolution: {integrity: sha512-xhMSwxsuaygIWn1jcTHbAVfNty6D2+hFVq+tvqNuSBE0WI3CWyeSOT1ISQ5urt3j5qoRbEXrZxWLC2dN3QeBSA==} dependencies: sirv: 2.0.2 dev: true @@ -703,7 +691,7 @@ packages: /@vue/compiler-core/3.2.37: resolution: {integrity: sha512-81KhEjo7YAOh0vQJoSmAD68wLfYqJvoiD4ulyedzF+OEk/bk6/hx3fTNVfuzugIIaTrOx4PGx6pAiBRe5e9Zmg==} dependencies: - '@babel/parser': 7.18.8 + '@babel/parser': 7.18.11 '@vue/shared': 3.2.37 estree-walker: 2.0.2 source-map: 0.6.1 @@ -719,7 +707,7 @@ packages: /@vue/compiler-sfc/3.2.37: resolution: {integrity: sha512-+7i/2+9LYlpqDv+KTtWhOZH+pa8/HnX/905MdVmAcI/mPQOBwkHHIzrsEsucyOIZQYMkXUiTkmZq5am/NyXKkg==} dependencies: - '@babel/parser': 7.18.8 + '@babel/parser': 7.18.11 '@vue/compiler-core': 3.2.37 '@vue/compiler-dom': 3.2.37 '@vue/compiler-ssr': 3.2.37 @@ -738,10 +726,14 @@ packages: '@vue/shared': 3.2.37 dev: true + /@vue/devtools-api/6.2.1: + resolution: {integrity: sha512-OEgAMeQXvCoJ+1x8WyQuVZzFo0wcyCmUR3baRVLmKBo1LmYZWMlRiXlux5jd0fqVJu6PfDbOrZItVqUEzLobeQ==} + dev: true + /@vue/reactivity-transform/3.2.37: resolution: {integrity: sha512-IWopkKEb+8qpu/1eMKVeXrK0NLw9HicGviJzhJDEyfxTR9e1WtpnnbYkJWurX6WwoFP0sz10xQg8yL8lgskAZg==} dependencies: - '@babel/parser': 7.18.8 + '@babel/parser': 7.18.11 '@vue/compiler-core': 3.2.37 '@vue/shared': 3.2.37 estree-walker: 2.0.2 @@ -783,6 +775,43 @@ packages: resolution: {integrity: sha512-4rSJemR2NQIo9Klm1vabqWjD8rs/ZaJSzMxkMNeJS6lHiUjjUeYFbooN19NgFjztubEKh3WlZUeOLVdbbUWHsw==} dev: true + /@vueuse/core/8.9.4_vue@3.2.37: + resolution: {integrity: sha512-B/Mdj9TK1peFyWaPof+Zf/mP9XuGAngaJZBwPaXBvU3aCTZlx3ltlrFFFyMV4iGBwsjSCeUCgZrtkEj9dS2Y3Q==} + peerDependencies: + '@vue/composition-api': ^1.1.0 + vue: ^2.6.0 || ^3.2.0 + peerDependenciesMeta: + '@vue/composition-api': + optional: true + vue: + optional: true + dependencies: + '@types/web-bluetooth': 0.0.14 + '@vueuse/metadata': 8.9.4 + '@vueuse/shared': 8.9.4_vue@3.2.37 + vue: 3.2.37 + vue-demi: 0.13.6_vue@3.2.37 + dev: true + + /@vueuse/metadata/8.9.4: + resolution: {integrity: sha512-IwSfzH80bnJMzqhaapqJl9JRIiyQU0zsRGEgnxN6jhq7992cPUJIRfV+JHRIZXjYqbwt07E1gTEp0R0zPJ1aqw==} + dev: true + + /@vueuse/shared/8.9.4_vue@3.2.37: + resolution: {integrity: sha512-wt+T30c4K6dGRMVqPddexEVLa28YwxW5OFIPmzUHICjphfAuBFTTdDoyqREZNDOFJZ44ARH1WWQNCUK8koJ+Ag==} + peerDependencies: + '@vue/composition-api': ^1.1.0 + vue: ^2.6.0 || ^3.2.0 + peerDependenciesMeta: + '@vue/composition-api': + optional: true + vue: + optional: true + dependencies: + vue: 3.2.37 + vue-demi: 0.13.6_vue@3.2.37 + dev: true + /JSONStream/1.3.5: resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==} hasBin: true @@ -791,16 +820,16 @@ packages: through: 2.3.8 dev: true - /acorn-jsx/5.3.2_acorn@8.7.1: + /acorn-jsx/5.3.2_acorn@8.8.0: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - acorn: 8.7.1 + acorn: 8.8.0 dev: true - /acorn/8.7.1: - resolution: {integrity: sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==} + /acorn/8.8.0: + resolution: {integrity: sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==} engines: {node: '>=0.4.0'} hasBin: true dev: true @@ -826,23 +855,23 @@ packages: uri-js: 4.4.1 dev: true - /algoliasearch/4.13.1: - resolution: {integrity: sha512-dtHUSE0caWTCE7liE1xaL+19AFf6kWEcyn76uhcitWpntqvicFHXKFoZe5JJcv9whQOTRM6+B8qJz6sFj+rDJA==} + /algoliasearch/4.14.2: + resolution: {integrity: sha512-ngbEQonGEmf8dyEh5f+uOIihv4176dgbuOZspiuhmTTBRBuzWu3KCGHre6uHj5YyuC7pNvQGzB6ZNJyZi0z+Sg==} dependencies: - '@algolia/cache-browser-local-storage': 4.13.1 - '@algolia/cache-common': 4.13.1 - '@algolia/cache-in-memory': 4.13.1 - '@algolia/client-account': 4.13.1 - '@algolia/client-analytics': 4.13.1 - '@algolia/client-common': 4.13.1 - '@algolia/client-personalization': 4.13.1 - '@algolia/client-search': 4.13.1 - '@algolia/logger-common': 4.13.1 - '@algolia/logger-console': 4.13.1 - '@algolia/requester-browser-xhr': 4.13.1 - '@algolia/requester-common': 4.13.1 - '@algolia/requester-node-http': 4.13.1 - '@algolia/transporter': 4.13.1 + '@algolia/cache-browser-local-storage': 4.14.2 + '@algolia/cache-common': 4.14.2 + '@algolia/cache-in-memory': 4.14.2 + '@algolia/client-account': 4.14.2 + '@algolia/client-analytics': 4.14.2 + '@algolia/client-common': 4.14.2 + '@algolia/client-personalization': 4.14.2 + '@algolia/client-search': 4.14.2 + '@algolia/logger-common': 4.14.2 + '@algolia/logger-console': 4.14.2 + '@algolia/requester-browser-xhr': 4.14.2 + '@algolia/requester-common': 4.14.2 + '@algolia/requester-node-http': 4.14.2 + '@algolia/transporter': 4.14.2 dev: true /ansi-colors/4.1.3: @@ -981,6 +1010,10 @@ packages: resolution: {integrity: sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==} dev: true + /body-scroll-lock/4.0.0-beta.0: + resolution: {integrity: sha512-a7tP5+0Mw3YlUJcGAKUqIBkYYGlYxk2fnCasq/FUph1hadxlTRjF+gAcZksxANnaMnALjxEddmSi/H3OR8ugcQ==} + dev: true + /brace-expansion/1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} dependencies: @@ -1385,8 +1418,8 @@ packages: engines: {node: '>=10'} hasBin: true dependencies: - is-text-path: 1.0.1 JSONStream: 1.3.5 + is-text-path: 1.0.1 lodash: 4.17.21 meow: 8.1.2 split2: 3.2.2 @@ -1450,15 +1483,15 @@ packages: resolution: {integrity: sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==} dev: true - /cypress/10.3.1: - resolution: {integrity: sha512-As9HrExjAgpgjCnbiQCuPdw5sWKx5HUJcK2EOKziu642akwufr/GUeqL5UnCPYXTyyibvEdWT/pSC2qnGW/e5w==} + /cypress/10.4.0: + resolution: {integrity: sha512-OM7F8MRE01SHQRVVzunid1ZK1m90XTxYnl+7uZfIrB4CYqUDCrZEeSyCXzIbsS6qcaijVCAhqDL60SxG8N6hew==} engines: {node: '>=12.0.0'} hasBin: true requiresBuild: true dependencies: '@cypress/request': 2.88.10 '@cypress/xvfb': 1.2.4_supports-color@8.1.1 - '@types/node': 14.18.22 + '@types/node': 14.18.23 '@types/sinonjs__fake-timers': 8.1.1 '@types/sizzle': 2.3.3 arch: 2.2.0 @@ -1472,10 +1505,10 @@ packages: cli-table3: 0.6.2 commander: 5.1.0 common-tags: 1.8.2 - dayjs: 1.11.3 + dayjs: 1.11.4 debug: 4.3.4_supports-color@8.1.1 enquirer: 2.3.6 - eventemitter2: 6.4.6 + eventemitter2: 6.4.7 execa: 4.1.0 executable: 4.1.1 extract-zip: 2.0.1_supports-color@8.1.1 @@ -1516,8 +1549,8 @@ packages: resolution: {integrity: sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==} dev: true - /dayjs/1.11.3: - resolution: {integrity: sha512-xxwlswWOlGhzgQ4TKzASQkUhqERI3egRNqgV4ScR8wlANA/A9tZ7miXa44vTTKEq5l7vWoL5G57bG3zA+Kow0A==} + /dayjs/1.11.4: + resolution: {integrity: sha512-Zj/lPM5hOvQ1Bf7uAvewDaUcsJoI6JmNqmHhHl3nyumwe0XHwt8sWdOVAPACJzCebL8gQCi+K49w7iKWnGwX9g==} dev: true /debug/3.2.7_supports-color@8.1.1: @@ -1751,8 +1784,8 @@ packages: is-symbol: 1.0.4 dev: true - /esbuild-android-64/0.14.51: - resolution: {integrity: sha512-6FOuKTHnC86dtrKDmdSj2CkcKF8PnqkaIXqvgydqfJmqBazCPdw+relrMlhGjkvVdiiGV70rpdnyFmA65ekBCQ==} + /esbuild-android-64/0.14.53: + resolution: {integrity: sha512-fIL93sOTnEU+NrTAVMIKiAw0YH22HWCAgg4N4Z6zov2t0kY9RAJ50zY9ZMCQ+RT6bnOfDt8gCTnt/RaSNA2yRA==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -1760,8 +1793,8 @@ packages: dev: true optional: true - /esbuild-android-arm64/0.14.51: - resolution: {integrity: sha512-vBtp//5VVkZWmYYvHsqBRCMMi1MzKuMIn5XDScmnykMTu9+TD9v0NMEDqQxvtFToeYmojdo5UCV2vzMQWJcJ4A==} + /esbuild-android-arm64/0.14.53: + resolution: {integrity: sha512-PC7KaF1v0h/nWpvlU1UMN7dzB54cBH8qSsm7S9mkwFA1BXpaEOufCg8hdoEI1jep0KeO/rjZVWrsH8+q28T77A==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -1769,8 +1802,8 @@ packages: dev: true optional: true - /esbuild-darwin-64/0.14.51: - resolution: {integrity: sha512-YFmXPIOvuagDcwCejMRtCDjgPfnDu+bNeh5FU2Ryi68ADDVlWEpbtpAbrtf/lvFTWPexbgyKgzppNgsmLPr8PA==} + /esbuild-darwin-64/0.14.53: + resolution: {integrity: sha512-gE7P5wlnkX4d4PKvLBUgmhZXvL7lzGRLri17/+CmmCzfncIgq8lOBvxGMiQ4xazplhxq+72TEohyFMZLFxuWvg==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -1778,8 +1811,8 @@ packages: dev: true optional: true - /esbuild-darwin-arm64/0.14.51: - resolution: {integrity: sha512-juYD0QnSKwAMfzwKdIF6YbueXzS6N7y4GXPDeDkApz/1RzlT42mvX9jgNmyOlWKN7YzQAYbcUEJmZJYQGdf2ow==} + /esbuild-darwin-arm64/0.14.53: + resolution: {integrity: sha512-otJwDU3hnI15Q98PX4MJbknSZ/WSR1I45il7gcxcECXzfN4Mrpft5hBDHXNRnCh+5858uPXBXA1Vaz2jVWLaIA==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -1787,8 +1820,8 @@ packages: dev: true optional: true - /esbuild-freebsd-64/0.14.51: - resolution: {integrity: sha512-cLEI/aXjb6vo5O2Y8rvVSQ7smgLldwYY5xMxqh/dQGfWO+R1NJOFsiax3IS4Ng300SVp7Gz3czxT6d6qf2cw0g==} + /esbuild-freebsd-64/0.14.53: + resolution: {integrity: sha512-WkdJa8iyrGHyKiPF4lk0MiOF87Q2SkE+i+8D4Cazq3/iqmGPJ6u49je300MFi5I2eUsQCkaOWhpCVQMTKGww2w==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -1796,8 +1829,8 @@ packages: dev: true optional: true - /esbuild-freebsd-arm64/0.14.51: - resolution: {integrity: sha512-TcWVw/rCL2F+jUgRkgLa3qltd5gzKjIMGhkVybkjk6PJadYInPtgtUBp1/hG+mxyigaT7ib+od1Xb84b+L+1Mg==} + /esbuild-freebsd-arm64/0.14.53: + resolution: {integrity: sha512-9T7WwCuV30NAx0SyQpw8edbKvbKELnnm1FHg7gbSYaatH+c8WJW10g/OdM7JYnv7qkimw2ZTtSA+NokOLd2ydQ==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -1805,8 +1838,8 @@ packages: dev: true optional: true - /esbuild-linux-32/0.14.51: - resolution: {integrity: sha512-RFqpyC5ChyWrjx8Xj2K0EC1aN0A37H6OJfmUXIASEqJoHcntuV3j2Efr9RNmUhMfNE6yEj2VpYuDteZLGDMr0w==} + /esbuild-linux-32/0.14.53: + resolution: {integrity: sha512-VGanLBg5en2LfGDgLEUxQko2lqsOS7MTEWUi8x91YmsHNyzJVT/WApbFFx3MQGhkf+XdimVhpyo5/G0PBY91zg==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -1814,8 +1847,8 @@ packages: dev: true optional: true - /esbuild-linux-64/0.14.51: - resolution: {integrity: sha512-dxjhrqo5i7Rq6DXwz5v+MEHVs9VNFItJmHBe1CxROWNf4miOGoQhqSG8StStbDkQ1Mtobg6ng+4fwByOhoQoeA==} + /esbuild-linux-64/0.14.53: + resolution: {integrity: sha512-pP/FA55j/fzAV7N9DF31meAyjOH6Bjuo3aSKPh26+RW85ZEtbJv9nhoxmGTd9FOqjx59Tc1ZbrJabuiXlMwuZQ==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -1823,8 +1856,8 @@ packages: dev: true optional: true - /esbuild-linux-arm/0.14.51: - resolution: {integrity: sha512-LsJynDxYF6Neg7ZC7748yweCDD+N8ByCv22/7IAZglIEniEkqdF4HCaa49JNDLw1UQGlYuhOB8ZT/MmcSWzcWg==} + /esbuild-linux-arm/0.14.53: + resolution: {integrity: sha512-/u81NGAVZMopbmzd21Nu/wvnKQK3pT4CrvQ8BTje1STXcQAGnfyKgQlj3m0j2BzYbvQxSy+TMck4TNV2onvoPA==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -1832,8 +1865,8 @@ packages: dev: true optional: true - /esbuild-linux-arm64/0.14.51: - resolution: {integrity: sha512-D9rFxGutoqQX3xJPxqd6o+kvYKeIbM0ifW2y0bgKk5HPgQQOo2k9/2Vpto3ybGYaFPCE5qTGtqQta9PoP6ZEzw==} + /esbuild-linux-arm64/0.14.53: + resolution: {integrity: sha512-GDmWITT+PMsjCA6/lByYk7NyFssW4Q6in32iPkpjZ/ytSyH+xeEx8q7HG3AhWH6heemEYEWpTll/eui3jwlSnw==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -1841,8 +1874,8 @@ packages: dev: true optional: true - /esbuild-linux-mips64le/0.14.51: - resolution: {integrity: sha512-vS54wQjy4IinLSlb5EIlLoln8buh1yDgliP4CuEHumrPk4PvvP4kTRIG4SzMXm6t19N0rIfT4bNdAxzJLg2k6A==} + /esbuild-linux-mips64le/0.14.53: + resolution: {integrity: sha512-d6/XHIQW714gSSp6tOOX2UscedVobELvQlPMkInhx1NPz4ThZI9uNLQ4qQJHGBGKGfu+rtJsxM4NVHLhnNRdWQ==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -1850,8 +1883,8 @@ packages: dev: true optional: true - /esbuild-linux-ppc64le/0.14.51: - resolution: {integrity: sha512-xcdd62Y3VfGoyphNP/aIV9LP+RzFw5M5Z7ja+zdpQHHvokJM7d0rlDRMN+iSSwvUymQkqZO+G/xjb4/75du8BQ==} + /esbuild-linux-ppc64le/0.14.53: + resolution: {integrity: sha512-ndnJmniKPCB52m+r6BtHHLAOXw+xBCWIxNnedbIpuREOcbSU/AlyM/2dA3BmUQhsHdb4w3amD5U2s91TJ3MzzA==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -1859,8 +1892,8 @@ packages: dev: true optional: true - /esbuild-linux-riscv64/0.14.51: - resolution: {integrity: sha512-syXHGak9wkAnFz0gMmRBoy44JV0rp4kVCEA36P5MCeZcxFq8+fllBC2t6sKI23w3qd8Vwo9pTADCgjTSf3L3rA==} + /esbuild-linux-riscv64/0.14.53: + resolution: {integrity: sha512-yG2sVH+QSix6ct4lIzJj329iJF3MhloLE6/vKMQAAd26UVPVkhMFqFopY+9kCgYsdeWvXdPgmyOuKa48Y7+/EQ==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -1868,8 +1901,8 @@ packages: dev: true optional: true - /esbuild-linux-s390x/0.14.51: - resolution: {integrity: sha512-kFAJY3dv+Wq8o28K/C7xkZk/X34rgTwhknSsElIqoEo8armCOjMJ6NsMxm48KaWY2h2RUYGtQmr+RGuUPKBhyw==} + /esbuild-linux-s390x/0.14.53: + resolution: {integrity: sha512-OCJlgdkB+XPYndHmw6uZT7jcYgzmx9K+28PVdOa/eLjdoYkeAFvH5hTwX4AXGLZLH09tpl4bVsEtvuyUldaNCg==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -1877,8 +1910,8 @@ packages: dev: true optional: true - /esbuild-netbsd-64/0.14.51: - resolution: {integrity: sha512-ZZBI7qrR1FevdPBVHz/1GSk1x5GDL/iy42Zy8+neEm/HA7ma+hH/bwPEjeHXKWUDvM36CZpSL/fn1/y9/Hb+1A==} + /esbuild-netbsd-64/0.14.53: + resolution: {integrity: sha512-gp2SB+Efc7MhMdWV2+pmIs/Ja/Mi5rjw+wlDmmbIn68VGXBleNgiEZG+eV2SRS0kJEUyHNedDtwRIMzaohWedQ==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -1886,8 +1919,8 @@ packages: dev: true optional: true - /esbuild-openbsd-64/0.14.51: - resolution: {integrity: sha512-7R1/p39M+LSVQVgDVlcY1KKm6kFKjERSX1lipMG51NPcspJD1tmiZSmmBXoY5jhHIu6JL1QkFDTx94gMYK6vfA==} + /esbuild-openbsd-64/0.14.53: + resolution: {integrity: sha512-eKQ30ZWe+WTZmteDYg8S+YjHV5s4iTxeSGhJKJajFfQx9TLZJvsJX0/paqwP51GicOUruFpSUAs2NCc0a4ivQQ==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -1895,8 +1928,8 @@ packages: dev: true optional: true - /esbuild-sunos-64/0.14.51: - resolution: {integrity: sha512-HoHaCswHxLEYN8eBTtyO0bFEWvA3Kdb++hSQ/lLG7TyKF69TeSG0RNoBRAs45x/oCeWaTDntEZlYwAfQlhEtJA==} + /esbuild-sunos-64/0.14.53: + resolution: {integrity: sha512-OWLpS7a2FrIRukQqcgQqR1XKn0jSJoOdT+RlhAxUoEQM/IpytS3FXzCJM6xjUYtpO5GMY0EdZJp+ur2pYdm39g==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -1904,8 +1937,8 @@ packages: dev: true optional: true - /esbuild-windows-32/0.14.51: - resolution: {integrity: sha512-4rtwSAM35A07CBt1/X8RWieDj3ZUHQqUOaEo5ZBs69rt5WAFjP4aqCIobdqOy4FdhYw1yF8Z0xFBTyc9lgPtEg==} + /esbuild-windows-32/0.14.53: + resolution: {integrity: sha512-m14XyWQP5rwGW0tbEfp95U6A0wY0DYPInWBB7D69FAXUpBpBObRoGTKRv36lf2RWOdE4YO3TNvj37zhXjVL5xg==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -1913,8 +1946,8 @@ packages: dev: true optional: true - /esbuild-windows-64/0.14.51: - resolution: {integrity: sha512-HoN/5HGRXJpWODprGCgKbdMvrC3A2gqvzewu2eECRw2sYxOUoh2TV1tS+G7bHNapPGI79woQJGV6pFH7GH7qnA==} + /esbuild-windows-64/0.14.53: + resolution: {integrity: sha512-s9skQFF0I7zqnQ2K8S1xdLSfZFsPLuOGmSx57h2btSEswv0N0YodYvqLcJMrNMXh6EynOmWD7rz+0rWWbFpIHQ==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -1922,8 +1955,8 @@ packages: dev: true optional: true - /esbuild-windows-arm64/0.14.51: - resolution: {integrity: sha512-JQDqPjuOH7o+BsKMSddMfmVJXrnYZxXDHsoLHc0xgmAZkOOCflRmC43q31pk79F9xuyWY45jDBPolb5ZgGOf9g==} + /esbuild-windows-arm64/0.14.53: + resolution: {integrity: sha512-E+5Gvb+ZWts+00T9II6wp2L3KG2r3iGxByqd/a1RmLmYWVsSVUjkvIxZuJ3hYTIbhLkH5PRwpldGTKYqVz0nzQ==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -1931,32 +1964,33 @@ packages: dev: true optional: true - /esbuild/0.14.51: - resolution: {integrity: sha512-+CvnDitD7Q5sT7F+FM65sWkF8wJRf+j9fPcprxYV4j+ohmzVj2W7caUqH2s5kCaCJAfcAICjSlKhDCcvDpU7nw==} + /esbuild/0.14.53: + resolution: {integrity: sha512-ohO33pUBQ64q6mmheX1mZ8mIXj8ivQY/L4oVuAshr+aJI+zLl+amrp3EodrUNDNYVrKJXGPfIHFGhO8slGRjuw==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - esbuild-android-64: 0.14.51 - esbuild-android-arm64: 0.14.51 - esbuild-darwin-64: 0.14.51 - esbuild-darwin-arm64: 0.14.51 - esbuild-freebsd-64: 0.14.51 - esbuild-freebsd-arm64: 0.14.51 - esbuild-linux-32: 0.14.51 - esbuild-linux-64: 0.14.51 - esbuild-linux-arm: 0.14.51 - esbuild-linux-arm64: 0.14.51 - esbuild-linux-mips64le: 0.14.51 - esbuild-linux-ppc64le: 0.14.51 - esbuild-linux-riscv64: 0.14.51 - esbuild-linux-s390x: 0.14.51 - esbuild-netbsd-64: 0.14.51 - esbuild-openbsd-64: 0.14.51 - esbuild-sunos-64: 0.14.51 - esbuild-windows-32: 0.14.51 - esbuild-windows-64: 0.14.51 - esbuild-windows-arm64: 0.14.51 + '@esbuild/linux-loong64': 0.14.53 + esbuild-android-64: 0.14.53 + esbuild-android-arm64: 0.14.53 + esbuild-darwin-64: 0.14.53 + esbuild-darwin-arm64: 0.14.53 + esbuild-freebsd-64: 0.14.53 + esbuild-freebsd-arm64: 0.14.53 + esbuild-linux-32: 0.14.53 + esbuild-linux-64: 0.14.53 + esbuild-linux-arm: 0.14.53 + esbuild-linux-arm64: 0.14.53 + esbuild-linux-mips64le: 0.14.53 + esbuild-linux-ppc64le: 0.14.53 + esbuild-linux-riscv64: 0.14.53 + esbuild-linux-s390x: 0.14.53 + esbuild-netbsd-64: 0.14.53 + esbuild-openbsd-64: 0.14.53 + esbuild-sunos-64: 0.14.53 + esbuild-windows-32: 0.14.53 + esbuild-windows-64: 0.14.53 + esbuild-windows-arm64: 0.14.53 dev: true /escalade/3.1.1: @@ -1974,21 +2008,21 @@ packages: engines: {node: '>=10'} dev: true - /eslint-config-prettier/8.5.0_eslint@8.20.0: + /eslint-config-prettier/8.5.0_eslint@8.21.0: resolution: {integrity: sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.20.0 + eslint: 8.21.0 dev: true - /eslint-define-config/1.5.1: - resolution: {integrity: sha512-6gxrmN7aKGffaO8dCtMMKyo3IxbWymMQ248p4lf8GbaFRcLsqOXHFdUhhM0Hcy1NudvnpwHcfbDf7Nh9pIm1TA==} + /eslint-define-config/1.6.0: + resolution: {integrity: sha512-3qulYnwDRGYQHXHGdXBSRcfpI7m37ilBoERzTUYI8fBUoK/46yfUVNkGwM9cF/aoBrGgIDcBSz/HyPQJTHI/+w==} engines: {node: '>= 14.6.0', npm: '>= 6.0.0', pnpm: '>= 7.0.0'} dev: true - /eslint-gitignore/0.1.0_eslint@8.20.0: + /eslint-gitignore/0.1.0_eslint@8.21.0: resolution: {integrity: sha512-VFvY5Wyjuz5xXDC/NeONHzsh4YQNok2Gzg4SftAAuhkbrdHv5CChjfiFyLKhRlgOdCJr5kBquaLXHtuDBTW2/Q==} engines: {node: ^10.12.0 || >=12.0.0} peerDependencies: @@ -1996,14 +2030,14 @@ packages: dependencies: array.prototype.flatmap: 1.3.0 debug: 4.3.4 - eslint: 8.20.0 + eslint: 8.21.0 fast-glob: 3.2.11 transitivePeerDependencies: - supports-color dev: true - /eslint-plugin-jsdoc/39.3.3_eslint@8.20.0: - resolution: {integrity: sha512-K/DAjKRUNaUTf0KQhI9PvsF+Y3mGDx/j0pofXsJCQe/tmRsRweBIXR353c8nAro0lytZYEf7l0PluBpzKDiHxw==} + /eslint-plugin-jsdoc/39.3.4_eslint@8.21.0: + resolution: {integrity: sha512-dYWXhMMHJaq++bY2hyByhgiRzt5qQ7XdfQGiHrU9f3APSSVZ/HuOnXuvUUX7W0jO55Udsu4/7iRlpF/yLFQdSA==} engines: {node: ^14 || ^16 || ^17 || ^18} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -2012,7 +2046,7 @@ packages: comment-parser: 1.3.1 debug: 4.3.4 escape-string-regexp: 4.0.0 - eslint: 8.20.0 + eslint: 8.21.0 esquery: 1.4.0 semver: 7.3.7 spdx-expression-parse: 3.0.1 @@ -2020,7 +2054,7 @@ packages: - supports-color dev: true - /eslint-plugin-prettier/4.2.1_g4fztgbwjyq2fvmcscny2sj6fy: + /eslint-plugin-prettier/4.2.1_h62lvancfh4b7r6zn2dgodrh5e: resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} engines: {node: '>=12.0.0'} peerDependencies: @@ -2031,8 +2065,8 @@ packages: eslint-config-prettier: optional: true dependencies: - eslint: 8.20.0 - eslint-config-prettier: 8.5.0_eslint@8.20.0 + eslint: 8.21.0 + eslint-config-prettier: 8.5.0_eslint@8.21.0 prettier: 2.7.1 prettier-linter-helpers: 1.0.0 dev: true @@ -2053,13 +2087,13 @@ packages: estraverse: 5.3.0 dev: true - /eslint-utils/3.0.0_eslint@8.20.0: + /eslint-utils/3.0.0_eslint@8.21.0: resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} peerDependencies: eslint: '>=5' dependencies: - eslint: 8.20.0 + eslint: 8.21.0 eslint-visitor-keys: 2.1.0 dev: true @@ -2073,13 +2107,14 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint/8.20.0: - resolution: {integrity: sha512-d4ixhz5SKCa1D6SCPrivP7yYVi7nyD6A4vs6HIAul9ujBzcEmZVM3/0NN/yu5nKhmO1wjp5xQ46iRfmDGlOviA==} + /eslint/8.21.0: + resolution: {integrity: sha512-/XJ1+Qurf1T9G2M5IHrsjp+xrGT73RZf23xA1z5wB1ZzzEAWSZKvRwhWxTFp1rvkvCfwcvAUNAP31bhKTTGfDA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: '@eslint/eslintrc': 1.3.0 - '@humanwhocodes/config-array': 0.9.5 + '@humanwhocodes/config-array': 0.10.4 + '@humanwhocodes/gitignore-to-minimatch': 1.0.2 ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 @@ -2087,16 +2122,19 @@ packages: doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.1.1 - eslint-utils: 3.0.0_eslint@8.20.0 + eslint-utils: 3.0.0_eslint@8.21.0 eslint-visitor-keys: 3.3.0 - espree: 9.3.2 + espree: 9.3.3 esquery: 1.4.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 file-entry-cache: 6.0.1 + find-up: 5.0.0 functional-red-black-tree: 1.0.1 glob-parent: 6.0.2 - globals: 13.16.0 + globals: 13.17.0 + globby: 11.1.0 + grapheme-splitter: 1.0.4 ignore: 5.2.0 import-fresh: 3.3.0 imurmurhash: 0.1.4 @@ -2117,12 +2155,12 @@ packages: - supports-color dev: true - /espree/9.3.2: - resolution: {integrity: sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==} + /espree/9.3.3: + resolution: {integrity: sha512-ORs1Rt/uQTqUKjDdGCyrtYxbazf5umATSf/K4qxjmZHORR6HJk+2s/2Pqe+Kk49HHINC/xNIrGfgh8sZcll0ng==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - acorn: 8.7.1 - acorn-jsx: 5.3.2_acorn@8.7.1 + acorn: 8.8.0 + acorn-jsx: 5.3.2_acorn@8.8.0 eslint-visitor-keys: 3.3.0 dev: true @@ -2159,8 +2197,8 @@ packages: engines: {node: '>=0.10.0'} dev: true - /eventemitter2/6.4.6: - resolution: {integrity: sha512-OHqo4wbHX5VbvlbB6o6eDwhYmiTjrpWACjF8Pmof/GTD6rdBNdZFNck3xlhqOiQFGCOoq3uzHvA0cQpFHIGVAQ==} + /eventemitter2/6.4.7: + resolution: {integrity: sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==} dev: true /execa/4.1.0: @@ -2532,8 +2570,8 @@ packages: ini: 2.0.0 dev: true - /globals/13.16.0: - resolution: {integrity: sha512-A1lrQfpNF+McdPOnnFqY3kSN0AFTy485bTi1bkLk4mVPODIUEcSfhHgRqA+QdXPksrSTTztYXx37NFV+GpGk3Q==} + /globals/13.17.0: + resolution: {integrity: sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==} engines: {node: '>=8'} dependencies: type-fest: 0.20.2 @@ -2555,6 +2593,10 @@ packages: resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} dev: true + /grapheme-splitter/1.0.4: + resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} + dev: true + /handlebars/4.7.7: resolution: {integrity: sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==} engines: {node: '>=0.4.7'} @@ -2565,7 +2607,7 @@ packages: source-map: 0.6.1 wordwrap: 1.0.0 optionalDependencies: - uglify-js: 3.16.2 + uglify-js: 3.16.3 dev: true /hard-rejection/2.1.0: @@ -2741,8 +2783,8 @@ packages: ci-info: 3.3.2 dev: true - /is-core-module/2.9.0: - resolution: {integrity: sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==} + /is-core-module/2.10.0: + resolution: {integrity: sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==} dependencies: has: 1.0.3 dev: true @@ -3349,7 +3391,7 @@ packages: engines: {node: '>=10'} dependencies: hosted-git-info: 4.1.0 - is-core-module: 2.9.0 + is-core-module: 2.10.0 semver: 7.3.7 validate-npm-package-license: 3.0.4 dev: true @@ -3653,11 +3695,15 @@ packages: fast-diff: 1.2.0 dev: true - /prettier-plugin-organize-imports/3.0.0_gd3y7r3s3evy6b2vthd7dmacga: - resolution: {integrity: sha512-juSCJs5TMOqGGPaN/A/1xzWFzRPH2LG1LPLCr64dzKaVnPafJdtgDNmDVlU+8A4LbQzVJg0DTvgA8swBuIUhlg==} + /prettier-plugin-organize-imports/3.0.2_gd3y7r3s3evy6b2vthd7dmacga: + resolution: {integrity: sha512-cA+Hh8EPNQSLG4hrAzcCwM2PmTjxbWNP3ZRT/Cub7cMHNH1lVaUyNLIHqtiqit6l0T1a0ugjYoRdXa9qpJFYuw==} peerDependencies: + '@volar/vue-typescript': '>=0.39.0' prettier: '>=2.0' typescript: '>=2.9' + peerDependenciesMeta: + '@volar/vue-typescript': + optional: true dependencies: prettier: 2.7.1 typescript: 4.7.4 @@ -3674,17 +3720,12 @@ packages: engines: {node: '>=6'} dev: true - /prismjs/1.28.0: - resolution: {integrity: sha512-8aaXdYvl1F7iC7Xm1spqSaY/OJBpYW3v+KJ+F17iYxvdc8sfjW194COK5wVhMZX45tGteiBQgdvD/nhxcRwylw==} - engines: {node: '>=6'} - dev: true - /process-nextick-args/2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} dev: true /proxy-from-env/1.0.0: - resolution: {integrity: sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A==} + resolution: {integrity: sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4=} dev: true /psl/1.9.0: @@ -3838,7 +3879,7 @@ packages: resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} hasBin: true dependencies: - is-core-module: 2.9.0 + is-core-module: 2.10.0 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 dev: true @@ -3867,8 +3908,8 @@ packages: glob: 7.2.3 dev: true - /rollup/2.77.0: - resolution: {integrity: sha512-vL8xjY4yOQEw79DvyXLijhnhh+R/O9zpF/LEgkCebZFtb6ELeN9H3/2T0r8+mp+fFTBHZ5qGpOpW2ela2zRt3g==} + /rollup/2.77.2: + resolution: {integrity: sha512-m/4YzYgLcpMQbxX3NmAqDvwLATZzxt8bIegO78FZLl+lAgKJBd1DRAOeEiZcKOIOPjxE6ewHWHNgGEalFXuz1g==} engines: {node: '>=10.0.0'} hasBin: true optionalDependencies: @@ -4368,13 +4409,13 @@ packages: typescript: 4.7.4 dev: true - /tsx/3.8.0: - resolution: {integrity: sha512-PcvTwRXTm6hDWfPihA4n5WW/9SmgFNxKaDKqvLLG+FKNEPA4crsipChzC7PVozPtdOaMfR5QctDlkC/hKoIsxw==} + /tsx/3.8.1: + resolution: {integrity: sha512-YA2fDf1V9j/6qX/QSnapMmzulbqlx7FeVL6d9ySHDJoECkslAlZO38UuyFCiNPjam74hbyHbJfUF+n2ZT14KDA==} hasBin: true dependencies: - '@esbuild-kit/cjs-loader': 2.3.1 + '@esbuild-kit/cjs-loader': 2.3.3 '@esbuild-kit/core-utils': 2.1.0 - '@esbuild-kit/esm-loader': 2.4.1 + '@esbuild-kit/esm-loader': 2.4.2 optionalDependencies: fsevents: 2.3.2 dev: true @@ -4430,16 +4471,16 @@ packages: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} dev: true - /typedoc-plugin-missing-exports/0.23.0_typedoc@0.23.9: + /typedoc-plugin-missing-exports/0.23.0_typedoc@0.23.10: resolution: {integrity: sha512-9smahDSsFRno9ZwoEshQDuIYMHWGB1E6LUud5qMxR2wNZ0T4DlZz0QjoK3HzXtX34mUpTH0dYtt7NQUK4D6B6Q==} peerDependencies: typedoc: 0.22.x || 0.23.x dependencies: - typedoc: 0.23.9_typescript@4.7.4 + typedoc: 0.23.10_typescript@4.7.4 dev: true - /typedoc/0.23.9_typescript@4.7.4: - resolution: {integrity: sha512-rvWci2KHwteVUufZjjtIy/4PIHiE66t4VW4Ob6pezV//GHZ9Px0CHE5iq032GZzKONJWnNb+EJsrQv32INRvxA==} + /typedoc/0.23.10_typescript@4.7.4: + resolution: {integrity: sha512-03EUiu/ZuScUBMnY6p0lY+HTH8SwhzvRE3gImoemdPDWXPXlks83UGTx++lyquWeB1MTwm9D9Ca8RIjkK3AFfQ==} engines: {node: '>= 14.14'} hasBin: true peerDependencies: @@ -4458,8 +4499,8 @@ packages: hasBin: true dev: true - /uglify-js/3.16.2: - resolution: {integrity: sha512-AaQNokTNgExWrkEYA24BTNMSjyqEXPSfhqoS0AxmHkCJ4U+Dyy5AvbGV/sqxuxficEfGGoX3zWw9R7QpLFfEsg==} + /uglify-js/3.16.3: + resolution: {integrity: sha512-uVbFqx9vvLhQg0iBaau9Z75AxWJ8tqM9AV890dIZCLApF4rTcyHwmAvLeEdYRs+BzYWu8Iw81F79ah0EfTXbaw==} engines: {node: '>=0.8.0'} hasBin: true requiresBuild: true @@ -4532,7 +4573,7 @@ packages: dev: true /verror/1.10.0: - resolution: {integrity: sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==} + resolution: {integrity: sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=} engines: {'0': node >=0.6.0} dependencies: assert-plus: 1.0.0 @@ -4556,16 +4597,16 @@ packages: stylus: optional: true dependencies: - esbuild: 0.14.51 + esbuild: 0.14.53 postcss: 8.4.14 resolve: 1.22.1 - rollup: 2.77.0 + rollup: 2.77.2 optionalDependencies: fsevents: 2.3.2 dev: true - /vite/3.0.3: - resolution: {integrity: sha512-sDIpIcl3mv1NUaSzZwiXGEy1ZoWwwC2vkxUHY6yiDacR6zf//ZFuBJrozO62gedpE43pmxnLATNR5IYUdAEkMQ==} + /vite/3.0.4: + resolution: {integrity: sha512-NU304nqnBeOx2MkQnskBQxVsa0pRAH5FphokTGmyy8M3oxbvw7qAXts2GORxs+h/2vKsD+osMhZ7An6yK6F1dA==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true peerDependencies: @@ -4583,28 +4624,32 @@ packages: terser: optional: true dependencies: - esbuild: 0.14.51 + esbuild: 0.14.53 postcss: 8.4.14 resolve: 1.22.1 - rollup: 2.77.0 + rollup: 2.77.2 optionalDependencies: fsevents: 2.3.2 dev: true - /vitepress/0.22.4_ju6wpa2hqqdrjfl4p3m6tanjem: - resolution: {integrity: sha512-oZUnLO/SpYdThaBKefDeOiVlr0Rie4Ppx3FzMnMyLtJnI5GlBMNjqYqMy/4+umm/iC+ZDJfI+IlDKxv5fZnYzA==} - engines: {node: '>=14.0.0'} + /vitepress/1.0.0-alpha.4_zjzrc7rfs5jgdvevvkgm5g7e44: + resolution: {integrity: sha512-bOAA4KW6vYGlkbcrPLZLTKWTgXVroObU+o9xj9EENyEl6yg26WWvfN7DGA4BftjdM5O8nR93Z5khPQ3W/tFE7Q==} + engines: {node: '>=14.6.0'} hasBin: true dependencies: - '@docsearch/css': 3.1.1 - '@docsearch/js': 3.1.1_ju6wpa2hqqdrjfl4p3m6tanjem + '@docsearch/css': 3.2.0 + '@docsearch/js': 3.2.0_zjzrc7rfs5jgdvevvkgm5g7e44 '@vitejs/plugin-vue': 2.3.3_vite@2.9.14+vue@3.2.37 - prismjs: 1.28.0 + '@vue/devtools-api': 6.2.1 + '@vueuse/core': 8.9.4_vue@3.2.37 + body-scroll-lock: 4.0.0-beta.0 + shiki: 0.10.1 vite: 2.9.14 vue: 3.2.37 transitivePeerDependencies: - '@algolia/client-search' - '@types/react' + - '@vue/composition-api' - less - react - react-dom @@ -4612,8 +4657,8 @@ packages: - stylus dev: true - /vitest/0.19.1_jcfjdqfldivpyjgll3wfgmwbia: - resolution: {integrity: sha512-E/ZXpFMUahn731wzhMBNzWRp4mGgiZFT0xdHa32cbNO0CSaHpE9hTfteEU247Gi2Dula8uXo5vvrNB6dtszmQA==} + /vitest/0.21.0_y7ksokcqbrho27xsbc2olnpwva: + resolution: {integrity: sha512-+BQB2swk4wQdw5loOoL8esIYh/1ifAliuwj2HWHNE2F8SAl/jF7/aoCJBoXGSf/Ws19k3pH4NrWeVtcSwM0j2w==} engines: {node: '>=v14.16.0'} hasBin: true peerDependencies: @@ -4639,15 +4684,15 @@ packages: dependencies: '@types/chai': 4.3.1 '@types/chai-subset': 1.3.3 - '@types/node': 18.0.6 - '@vitest/ui': 0.19.1 + '@types/node': 18.6.4 + '@vitest/ui': 0.21.0 c8: 7.12.0 chai: 4.3.6 debug: 4.3.4 local-pkg: 0.4.2 tinypool: 0.2.4 tinyspy: 1.0.0 - vite: 3.0.3 + vite: 3.0.4 transitivePeerDependencies: - less - sass @@ -4664,6 +4709,21 @@ packages: resolution: {integrity: sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==} dev: true + /vue-demi/0.13.6_vue@3.2.37: + resolution: {integrity: sha512-02NYpxgyGE2kKGegRPYlNQSL1UWfA/+JqvzhGCOYjhfbLWXU5QQX0+9pAm/R2sCOPKr5NBxVIab7fvFU0B1RxQ==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + peerDependencies: + '@vue/composition-api': ^1.0.0-rc.1 + vue: ^3.0.0-0 || ^2.6.0 + peerDependenciesMeta: + '@vue/composition-api': + optional: true + dependencies: + vue: 3.2.37 + dev: true + /vue/3.2.37: resolution: {integrity: sha512-bOKEZxrm8Eh+fveCqS1/NkG/n6aMidsI6hahas7pa0w/l7jkbssJVsRhVDs07IdDq7h9KHswZOgItnwJAgtVtQ==} dependencies: diff --git a/scripts/apidoc.ts b/scripts/apidoc.ts index d519a320b53..ed6f679f7cb 100644 --- a/scripts/apidoc.ts +++ b/scripts/apidoc.ts @@ -2,12 +2,15 @@ import { resolve } from 'path'; import { writeApiPagesIndex } from './apidoc/apiDocsWriter'; import { processDirectMethods } from './apidoc/directMethods'; import { processModuleMethods } from './apidoc/moduleMethods'; +import { initMarkdownRenderer } from './apidoc/signature'; import type { PageIndex } from './apidoc/utils'; import { newTypeDocApp, patchProject, pathOutputDir } from './apidoc/utils'; const pathOutputJson = resolve(pathOutputDir, 'typedoc.json'); async function build(): Promise { + await initMarkdownRenderer(); + const app = newTypeDocApp(); app.bootstrap({ diff --git a/scripts/apidoc/signature.ts b/scripts/apidoc/signature.ts index dd60a223b26..ce0379883a3 100644 --- a/scripts/apidoc/signature.ts +++ b/scripts/apidoc/signature.ts @@ -1,4 +1,4 @@ -import sanitizeHtml from 'sanitize-html'; +// import sanitizeHtml from 'sanitize-html'; import type { Comment, DeclarationReflection, @@ -10,6 +10,7 @@ import type { Type, } from 'typedoc'; import { ReflectionFlag, ReflectionKind } from 'typedoc'; +import type { MarkdownRenderer } from 'vitepress'; import { createMarkdownRenderer } from 'vitepress'; import type { Method, @@ -38,40 +39,46 @@ export function toBlock(comment?: Comment): string { return joinTagParts(comment?.summary) || 'Missing'; } -const markdown = createMarkdownRenderer( - pathOutputDir, - vitepressConfig.markdown, - '/' -); - -const htmlSanitizeOptions: sanitizeHtml.IOptions = { - allowedTags: ['a', 'code', 'div', 'li', 'span', 'p', 'pre', 'ul'], - allowedAttributes: { - a: ['href', 'target', 'rel'], - div: ['class'], - pre: ['v-pre'], - span: ['class'], - }, - selfClosing: [], -}; +let markdown: MarkdownRenderer; + +export async function initMarkdownRenderer(): Promise { + markdown = await createMarkdownRenderer( + pathOutputDir, + vitepressConfig.markdown, + '/' + ); +} + +// const htmlSanitizeOptions: sanitizeHtml.IOptions = { +// allowedTags: ['a', 'code', 'div', 'li', 'span', 'p', 'pre', 'ul'], +// allowedAttributes: { +// a: ['href', 'target', 'rel'], +// div: ['class'], +// pre: ['v-pre'], +// span: ['class'], +// }, +// selfClosing: [], +// }; function mdToHtml(md: string): string { const rawHtml = markdown.render(md); - const safeHtml: string = sanitizeHtml(rawHtml, htmlSanitizeOptions); - // Revert some escaped characters for comparison. - if (rawHtml.replace(/>/g, '>') === safeHtml.replace(/>/g, '>')) { - return safeHtml; - } else { - console.debug('Rejected unsafe md:', md); - console.error('Rejected unsafe html:', rawHtml.replace(/>/g, '>')); - console.error('Expected safe html:', safeHtml.replace(/>/g, '>')); - throw new Error('Found unsafe html'); - } + // TODO @Shinigami92 2022-06-24: Sanitize html to prevent XSS + return rawHtml; + // const safeHtml: string = sanitizeHtml(rawHtml, htmlSanitizeOptions); + // // Revert some escaped characters for comparison. + // if (rawHtml.replace(/>/g, '>') === safeHtml.replace(/>/g, '>')) { + // return safeHtml; + // } else { + // console.debug('Rejected unsafe md:', md); + // console.error('Rejected unsafe html:', rawHtml.replace(/>/g, '>')); + // console.error('Expected safe html:', safeHtml.replace(/>/g, '>')); + // throw new Error('Found unsafe html'); + // } } export function analyzeSignature( signature: SignatureReflection, - moduleName: string, + moduleName: string | null, methodName: string ): Method { const parameters: MethodParameter[] = []; diff --git a/scripts/verifyCommit.ts b/scripts/verifyCommit.ts index 11f22ab48eb..35510011d88 100644 --- a/scripts/verifyCommit.ts +++ b/scripts/verifyCommit.ts @@ -12,7 +12,7 @@ const msg = readFileSync(msgPath, 'utf-8').trim(); const releaseRE = /^v\d/; const commitRE = - /^(revert: )?(feat|fix|docs|dx|refactor|perf|test|workflow|build|ci|chore|types|wip|release|deps)(\(.+\))?: .{1,50}/; + /^(revert: )?(feat|fix|docs|dx|refactor|perf|test|locale|workflow|build|ci|chore|types|wip|release|deps)(\(.+\))?: .{1,50}/; const isMergeCommit = msg.startsWith('Merge remote-tracking-branch'); diff --git a/src/definitions/animal.ts b/src/definitions/animal.ts index 58e493e5f0b..73f269ff1f3 100644 --- a/src/definitions/animal.ts +++ b/src/definitions/animal.ts @@ -16,6 +16,7 @@ export type AnimalDefinitions = LocaleEntry<{ insect: string[]; lion: string[]; rabbit: string[]; + rodent: string[]; snake: string[]; type: string[]; }>; diff --git a/src/definitions/finance.ts b/src/definitions/finance.ts index 47ea6a96375..89fc51ea278 100644 --- a/src/definitions/finance.ts +++ b/src/definitions/finance.ts @@ -13,7 +13,7 @@ export type FinanceDefinitions = LocaleEntry<{ * The pattern by (lowercase) issuer name used to generate credit card codes. * `L` will be replaced by the check bit. * - * @see Helpers.replaceCreditCardSymbols() + * @see faker.helpers.replaceCreditCardSymbols() */ credit_card: { [issuer: string]: string[] }; diff --git a/src/definitions/hacker.ts b/src/definitions/hacker.ts index 5540a14f573..ed9bdd15ae6 100644 --- a/src/definitions/hacker.ts +++ b/src/definitions/hacker.ts @@ -29,7 +29,7 @@ export type HackerDefinitions = LocaleEntry<{ * May use any of the HackerDefinition keys wrapped in double braces * (e.g. `I'm {{ingverb}} {{adjective}} {{noun}}`). * - * @see Helpers.mustache() + * @see faker.helpers.mustache() */ phrase: string[]; diff --git a/src/definitions/phone_number.ts b/src/definitions/phone_number.ts index 3f805ea72a1..656efd4a2b6 100644 --- a/src/definitions/phone_number.ts +++ b/src/definitions/phone_number.ts @@ -10,7 +10,7 @@ export type PhoneNumberDefinitions = LocaleEntry<{ * `!` will be replaced by a random digit (2-9). * (e.g. `!##-!##-####` -> 272-285-0453) * - * @see Helpers.replaceSymbolWithNumber(format) + * @see faker.helpers.replaceSymbolWithNumber(format) */ formats: string[]; }>; diff --git a/src/index.ts b/src/index.ts index 8a6b7ecc6b6..e3b223b0750 100644 --- a/src/index.ts +++ b/src/index.ts @@ -37,8 +37,8 @@ export type { NumberColorFormat, StringColorFormat, } from './modules/color'; -export { Gender } from './modules/name'; -export type { GenderType } from './modules/name'; +export { Gender, Sex } from './modules/name'; +export type { GenderType, SexType } from './modules/name'; export type { ChemicalElement, Unit } from './modules/science'; export { Faker }; diff --git a/src/locales/af_ZA/address/street.ts b/src/locales/af_ZA/address/street.ts index edc26b85b6c..1a1885b1c4e 100644 --- a/src/locales/af_ZA/address/street.ts +++ b/src/locales/af_ZA/address/street.ts @@ -1,4 +1,4 @@ export default [ - '{{name.firstName}} {{address.streetSuffix}}', - '{{name.lastName}} {{address.streetSuffix}}', + '{{name.firstName}} {{address.street_suffix}}', + '{{name.lastName}} {{address.street_suffix}}', ]; diff --git a/src/locales/de_CH/address/street.ts b/src/locales/de_CH/address/street.ts index edc26b85b6c..1a1885b1c4e 100644 --- a/src/locales/de_CH/address/street.ts +++ b/src/locales/de_CH/address/street.ts @@ -1,4 +1,4 @@ export default [ - '{{name.firstName}} {{address.streetSuffix}}', - '{{name.lastName}} {{address.streetSuffix}}', + '{{name.firstName}} {{address.street_suffix}}', + '{{name.lastName}} {{address.street_suffix}}', ]; diff --git a/src/locales/el/address/street.ts b/src/locales/el/address/street.ts index edc26b85b6c..1a1885b1c4e 100644 --- a/src/locales/el/address/street.ts +++ b/src/locales/el/address/street.ts @@ -1,4 +1,4 @@ export default [ - '{{name.firstName}} {{address.streetSuffix}}', - '{{name.lastName}} {{address.streetSuffix}}', + '{{name.firstName}} {{address.street_suffix}}', + '{{name.lastName}} {{address.street_suffix}}', ]; diff --git a/src/locales/en/animal/index.ts b/src/locales/en/animal/index.ts index da536e8c9ce..393641e0c2a 100644 --- a/src/locales/en/animal/index.ts +++ b/src/locales/en/animal/index.ts @@ -15,6 +15,7 @@ import horse from './horse'; import insect from './insect'; import lion from './lion'; import rabbit from './rabbit'; +import rodent from './rodent'; import snake from './snake'; import type_ from './type'; @@ -31,6 +32,7 @@ const animal: AnimalDefinitions = { insect, lion, rabbit, + rodent, snake, type: type_, }; diff --git a/src/locales/en/animal/rodent.ts b/src/locales/en/animal/rodent.ts new file mode 100644 index 00000000000..38a5325aba8 --- /dev/null +++ b/src/locales/en/animal/rodent.ts @@ -0,0 +1,187 @@ +export default [ + 'Abrocoma', + 'Abrocoma schistacea', + 'Aconaemys', + 'Aconaemys porteri', + 'African brush-tailed porcupine', + 'Andean mountain cavy', + 'Argentine tuco-tuco', + 'Ashy chinchilla rat', + 'Asiatic brush-tailed porcupine', + 'Atherurus', + "Azara's agouti", + "Azara's tuco-tuco", + 'Bahia porcupine', + 'Bathyergus', + 'Bathyergus janetta', + 'Bathyergus suillus', + "Bennett's chinchilla rat", + 'Bicolored-spined porcupine', + 'Black agouti', + 'Black dwarf porcupine', + 'Black-rumped agouti', + 'Black-tailed hairy dwarf porcupine', + 'Bolivian chinchilla rat', + 'Bolivian tuco-tuco', + "Bonetto's tuco-tuco", + "Brandt's yellow-toothed cavy", + 'Brazilian guinea pig', + 'Brazilian porcupine', + 'Brazilian tuco-tuco', + "Bridge's degu", + 'Brown hairy dwarf porcupine', + "Budin's chinchilla rat, A. budini", + 'Cape porcupine', + 'Catamarca tuco-tuco', + 'Cavia', + 'Central American agouti', + 'Chacoan tuco-tuco', + 'Chilean rock rat', + 'Chinchilla', + 'Coendou', + 'Coiban agouti', + "Colburn's tuco-tuco", + 'Collared tuco-tuco', + 'Common degu', + 'Common yellow-toothed cavy', + "Conover's tuco-tuco", + 'Coruro', + 'Crested agouti', + 'Crested porcupine', + 'Cryptomys', + 'Cryptomys bocagei', + 'Cryptomys damarensis', + 'Cryptomys foxi', + 'Cryptomys hottentotus', + 'Cryptomys mechowi', + 'Cryptomys ochraceocinereus', + 'Cryptomys zechi', + 'Ctenomys', + 'Cuniculus', + 'Cuscomys', + 'Cuscomys ashanika', + 'Dactylomys', + 'Dactylomys boliviensis', + 'Dactylomys dactylinus', + 'Dactylomys peruanus', + 'Dasyprocta', + 'Domestic guinea pig', + "Emily's tuco-tuco", + 'Erethizon', + 'Famatina chinchilla rat', + 'Frosted hairy dwarf porcupine', + 'Fukomys', + 'Fukomys amatus', + 'Fukomys anselli', + 'Fukomys bocagei', + 'Fukomys damarensis', + 'Fukomys darlingi', + 'Fukomys foxi', + 'Fukomys ilariae', + 'Fukomys kafuensis', + 'Fukomys mechowii', + 'Fukomys micklemi', + 'Fukomys occlusus', + 'Fukomys ochraceocinereus', + 'Fukomys whytei', + 'Fukomys zechi', + 'Furtive tuco-tuco', + 'Galea', + 'Georychus', + 'Georychus capensis', + 'Golden viscacha-rat', + 'Goya tuco-tuco', + 'Greater guinea pig', + 'Green acouchi', + "Haig's tuco-tuco", + 'Heliophobius', + 'Heliophobius argenteocinereus', + 'Heterocephalus', + 'Heterocephalus glaber', + 'Highland tuco-tuco', + 'Hystrix', + 'Indian porcupine', + 'Isla Mocha degu', + 'Kalinowski agouti', + 'Kannabateomys', + 'Kannabateomys amblyonyx', + 'Lagidium', + 'Lagostomus', + "Lewis' tuco-tuco", + 'Long-tailed chinchilla', + 'Long-tailed porcupine', + "Los Chalchaleros' viscacha-rat", + 'Lowland paca', + 'Magellanic tuco-tuco', + 'Malayan porcupine', + 'Maule tuco-tuco', + 'Mendoza tuco-tuco', + 'Mexican agouti', + 'Mexican hairy dwarf porcupine', + 'Microcavia', + 'Montane guinea pig', + 'Moon-toothed degu', + 'Mottled tuco-tuco', + 'Mountain degu', + 'Mountain paca', + 'Mountain viscacha-rat', + 'Myoprocta', + "Natterer's tuco-tuco", + 'North American porcupine', + 'Northern viscacha', + 'Octodon', + 'Octodontomys', + 'Octomys', + 'Olallamys', + 'Olallamys albicauda', + 'Olallamys edax', + 'Orinoco agouti', + 'Paraguaian hairy dwarf porcupine', + "Pearson's tuco-tuco", + 'Peruvian tuco-tuco', + 'Philippine porcupine', + 'Pipanacoctomys', + 'Plains viscacha', + 'Plains viscacha-rat', + "Porteous' tuco-tuco", + 'Punta de Vacas chinchilla rat', + 'Red acouchi', + 'Red-rumped agouti', + 'Reddish tuco-tuco', + 'Rio Negro tuco-tuco', + 'Robust tuco-tuco', + "Roosmalen's dwarf porcupine", + "Rothschild's porcupine", + 'Ruatan Island agouti', + "Sage's rock rat", + 'Salinoctomys', + 'Salta tuco-tuco', + 'San Luis tuco-tuco', + "Santa Catarina's guinea pig", + 'Shiny guinea pig', + "Shipton's mountain cavy", + 'Short-tailed chinchilla', + 'Silky tuco-tuco', + 'Social tuco-tuco', + 'Southern mountain cavy', + 'Southern tuco-tuco', + 'Southern viscacha', + 'Spalacopus', + "Spix's yellow-toothed cavy", + "Steinbach's tuco-tuco", + 'Streaked dwarf porcupine', + 'Strong tuco-tuco', + 'Stump-tailed porcupine', + 'Sumatran porcupine', + 'Sunda porcupine', + 'Talas tuco-tuco', + 'Tawny tuco-tuco', + 'Thick-spined porcupine', + 'Tiny tuco-tuco', + 'Trichys', + 'Tucuman tuco-tuco', + 'Tympanoctomys', + 'Uspallata chinchilla rat', + 'White-toothed tuco-tuco', + "Wolffsohn's viscacha", +]; diff --git a/src/locales/en/word/conjunction.ts b/src/locales/en/word/conjunction.ts index 8e03623b4fe..e8efddeb9a3 100644 --- a/src/locales/en/word/conjunction.ts +++ b/src/locales/en/word/conjunction.ts @@ -1,64 +1,53 @@ export default [ 'after', - 'after all', 'although', 'and', 'as', - 'as a result', - 'as if', - 'as long as', - 'as much as', - 'as soon as', - 'as though', 'because', 'before', 'but', 'consequently', 'even', - 'even if', - 'even though', 'finally', 'for', - 'for example', 'furthermore', 'hence', + 'how', 'however', 'if', - 'if only', - 'if then', - 'if when', - 'in addition', - 'in fact', - 'in order that', 'inasmuch', 'incidentally', 'indeed', 'instead', - 'just as', 'lest', 'likewise', 'meanwhile', 'nor', 'now', - 'now since', - 'now that', - 'now when', 'once', 'or', 'provided', - 'provided that', - 'rather than', 'since', 'so', - 'so that', 'supposing', + 'than', 'that', 'though', + 'till', + 'unless', 'until', + 'what', + 'when', 'whenever', + 'where', 'whereas', 'wherever', + 'whether', 'which', + 'while', 'who', + 'whoever', + 'whose', + 'why', 'yet', ]; diff --git a/src/locales/en/word/interjection.ts b/src/locales/en/word/interjection.ts index c092f1086ec..5afc4c9bd8d 100644 --- a/src/locales/en/word/interjection.ts +++ b/src/locales/en/word/interjection.ts @@ -7,7 +7,7 @@ export default [ 'whoa', 'yowza', 'huzzah', - 'boo hoo', + 'boohoo', 'fooey', 'geez', 'pfft', @@ -33,7 +33,6 @@ export default [ 'duh', 'ha', 'mmm', - 'tsk tsk', 'ouch', 'phew', 'ack', diff --git a/src/locales/en/word/noun.ts b/src/locales/en/word/noun.ts index 3f5ca896ce0..da46f56e9c4 100644 --- a/src/locales/en/word/noun.ts +++ b/src/locales/en/word/noun.ts @@ -1363,7 +1363,6 @@ export default [ 'consumer', 'consumption', 'contact', - 'contact lens', 'contagion', 'container', 'content', @@ -1507,7 +1506,6 @@ export default [ 'credit', 'creditor', 'creek', - 'creme brulee', 'crepe', 'crest', 'crew', @@ -1962,9 +1960,7 @@ export default [ 'dulcimer', 'dumbwaiter', 'dump', - 'dump truck', 'dune', - 'dune buggy', 'dungarees', 'dungeon', 'duplexer', @@ -1972,7 +1968,6 @@ export default [ 'durian', 'dusk', 'dust', - 'dust storm', 'duster', 'duty', 'dwarf', diff --git a/src/locales/en_AU/address/street.ts b/src/locales/en_AU/address/street.ts index edc26b85b6c..1a1885b1c4e 100644 --- a/src/locales/en_AU/address/street.ts +++ b/src/locales/en_AU/address/street.ts @@ -1,4 +1,4 @@ export default [ - '{{name.firstName}} {{address.streetSuffix}}', - '{{name.lastName}} {{address.streetSuffix}}', + '{{name.firstName}} {{address.street_suffix}}', + '{{name.lastName}} {{address.street_suffix}}', ]; diff --git a/src/locales/en_CA/address/street.ts b/src/locales/en_CA/address/street.ts index edc26b85b6c..1a1885b1c4e 100644 --- a/src/locales/en_CA/address/street.ts +++ b/src/locales/en_CA/address/street.ts @@ -1,4 +1,4 @@ export default [ - '{{name.firstName}} {{address.streetSuffix}}', - '{{name.lastName}} {{address.streetSuffix}}', + '{{name.firstName}} {{address.street_suffix}}', + '{{name.lastName}} {{address.street_suffix}}', ]; diff --git a/src/locales/en_GB/address/street.ts b/src/locales/en_GB/address/street.ts index edc26b85b6c..1a1885b1c4e 100644 --- a/src/locales/en_GB/address/street.ts +++ b/src/locales/en_GB/address/street.ts @@ -1,4 +1,4 @@ export default [ - '{{name.firstName}} {{address.streetSuffix}}', - '{{name.lastName}} {{address.streetSuffix}}', + '{{name.firstName}} {{address.street_suffix}}', + '{{name.lastName}} {{address.street_suffix}}', ]; diff --git a/src/locales/en_IE/address/street.ts b/src/locales/en_IE/address/street.ts index edc26b85b6c..1a1885b1c4e 100644 --- a/src/locales/en_IE/address/street.ts +++ b/src/locales/en_IE/address/street.ts @@ -1,4 +1,4 @@ export default [ - '{{name.firstName}} {{address.streetSuffix}}', - '{{name.lastName}} {{address.streetSuffix}}', + '{{name.firstName}} {{address.street_suffix}}', + '{{name.lastName}} {{address.street_suffix}}', ]; diff --git a/src/locales/en_IND/address/street.ts b/src/locales/en_IND/address/street.ts index edc26b85b6c..1a1885b1c4e 100644 --- a/src/locales/en_IND/address/street.ts +++ b/src/locales/en_IND/address/street.ts @@ -1,4 +1,4 @@ export default [ - '{{name.firstName}} {{address.streetSuffix}}', - '{{name.lastName}} {{address.streetSuffix}}', + '{{name.firstName}} {{address.street_suffix}}', + '{{name.lastName}} {{address.street_suffix}}', ]; diff --git a/src/locales/en_NG/address/street.ts b/src/locales/en_NG/address/street.ts index edc26b85b6c..1a1885b1c4e 100644 --- a/src/locales/en_NG/address/street.ts +++ b/src/locales/en_NG/address/street.ts @@ -1,4 +1,4 @@ export default [ - '{{name.firstName}} {{address.streetSuffix}}', - '{{name.lastName}} {{address.streetSuffix}}', + '{{name.firstName}} {{address.street_suffix}}', + '{{name.lastName}} {{address.street_suffix}}', ]; diff --git a/src/locales/en_US/address/street.ts b/src/locales/en_US/address/street.ts index edc26b85b6c..1a1885b1c4e 100644 --- a/src/locales/en_US/address/street.ts +++ b/src/locales/en_US/address/street.ts @@ -1,4 +1,4 @@ export default [ - '{{name.firstName}} {{address.streetSuffix}}', - '{{name.lastName}} {{address.streetSuffix}}', + '{{name.firstName}} {{address.street_suffix}}', + '{{name.lastName}} {{address.street_suffix}}', ]; diff --git a/src/locales/en_ZA/address/street.ts b/src/locales/en_ZA/address/street.ts index edc26b85b6c..1a1885b1c4e 100644 --- a/src/locales/en_ZA/address/street.ts +++ b/src/locales/en_ZA/address/street.ts @@ -1,4 +1,4 @@ export default [ - '{{name.firstName}} {{address.streetSuffix}}', - '{{name.lastName}} {{address.streetSuffix}}', + '{{name.firstName}} {{address.street_suffix}}', + '{{name.lastName}} {{address.street_suffix}}', ]; diff --git a/src/locales/fr_CA/address/street.ts b/src/locales/fr_CA/address/street.ts index edc26b85b6c..1a1885b1c4e 100644 --- a/src/locales/fr_CA/address/street.ts +++ b/src/locales/fr_CA/address/street.ts @@ -1,4 +1,4 @@ export default [ - '{{name.firstName}} {{address.streetSuffix}}', - '{{name.lastName}} {{address.streetSuffix}}', + '{{name.firstName}} {{address.street_suffix}}', + '{{name.lastName}} {{address.street_suffix}}', ]; diff --git a/src/locales/ja/name/female_first_name.ts b/src/locales/ja/name/female_first_name.ts new file mode 100644 index 00000000000..ea0a7a3cb2f --- /dev/null +++ b/src/locales/ja/name/female_first_name.ts @@ -0,0 +1,147 @@ +export default [ + 'ๅƒไปฃๅญ', + '้™ๅญ', + 'ๆ–‡ๅญ', + 'ใ‚ญใƒจ', + 'ๅƒไปฃ', + 'ใƒใƒซ', + 'ใ‚ญใƒŸ', + 'ไน…ๅญ', + 'ใƒจใ‚ท', + 'ๆธ…ๅญ', + 'ๆญฃๅญ', + '่ฒžๅญ', + 'ๅ…ซ้‡ๅญ', + 'ใใ‚ˆ', + 'ใƒ•ใƒŸ', + 'ใƒใƒŠ', + 'ๅ’Œๅญ', + 'ๆ„›ๅญ', + 'ใใฟ', + 'ใƒˆใƒŸ', + 'ใฏใ‚‹', + 'ใƒžใ‚ต', + '็พŽไปฃๅญ', + 'ๅ…‰ๅญ', + 'ๅนธๅญ', + '็…งๅญ', + '่Šณๅญ', + '็ฏ€ๅญ', + 'ๆ˜ญๅญ', + 'ไฟกๅญ', + 'ๆ•ๅญ', + 'ๅ…ธๅญ', + 'ๅ›ๅญ', + 'ๅผ˜ๅญ', + 'ๆด‹ๅญ', + '็พŽๆ™บๅญ', + 'ไบฌๅญ', + 'ๆ‚ฆๅญ', + 'ๆ „ๅญ', + 'ๅญๅญ', + '่‰ฏๅญ', + 'ๆตๅญ', + 'ๅ‹ๅญ', + '็ด€ๅญ', + 'ๆต็พŽๅญ', + 'ๅ•“ๅญ', + 'ไน…็พŽๅญ', + '็”ฑ็พŽๅญ', + '่ฃ•ๅญ', + '้ †ๅญ', + 'ๆ™บๅญ', + 'ๆ˜Ž็พŽ', + 'ๆ„›', + 'ๆต', + '้บป่กฃ', + '้บป็พŽ', + '้ฆ™็น”', + '็พŽ็ฉ‚', + 'ๅฝฉ', + 'ๆฒ™็น”', + 'ๆ„›็พŽ', + '็ตต็พŽ', + '่ˆž', + 'ๆต็พŽ', + '้™ฝๅญ', + 'ๆˆ็พŽ', + 'ใ‚ใ‚†ใฟ', + '็พŽ้ฆ™', + '็†ๆต', + 'ๅ‹็พŽ', + 'ๆ™บ็พŽ', + 'ๆ˜Žๆ—ฅ้ฆ™', + '็”ฑไฝณ', + '็žณ', + '้บป่กฃๅญ', + 'ๅฝฉ้ฆ™', + '็œŸ็”ฑ็พŽ', + '็ด”ๅญ', + '็›ด็พŽ', + 'ๅ„ชๅญ', + '่ฃ•็พŽ', + '็”ฑ็พŽ', + '็›ดๅญ', + 'ใ‚ใใฟ', + '็พŽ็ด€', + 'ๆตฉๅญ', + 'ใ‚†ใ‹ใ‚Š', + 'ใ•ใใ‚‰', + '็พŽๅ’ฒ', + '้™ฝ่œ', + '่‘ต', + 'ไธƒๆตท', + '็พŽ็พฝ', + '็ต่กฃ', + '็พŽๆœˆ', + 'ๅ‡›', + '็พŽๅ„ช', + 'ๆœชๆฅ', + 'ๅ„ชๅฅˆ', + '่Œ', + 'ๅ„ช่Šฑ', + '็พŽๆกœ', + '่Ž‰ๅญ', + '่œๆœˆ', + '็ตๆ„›', + '็ต่œ', + '่Šฑ้Ÿณ', + 'ๅฟƒๅ„ช', + '็œŸๅคฎ', + '็Žฒๅฅˆ', + 'ใฒใชใŸ', + 'ๅฝฉไนƒ', + 'ๅฝฉ่Šฑ', + 'ๅ„ช่กฃ', + '็ด้Ÿณ', + '็™พ่Šฑ', + '้ฅ', + '้‡Œๅฅˆ', + '่Œœ', + 'ๅƒๅฐ‹', + 'ๆฅ“', + 'ไบœ็พŽ', + 'ไฝณๅฅˆ', + '็œŸ็”ฑ', + 'ๆกƒๅญ', + '่œใ€…ๅญ', + 'ๅƒๅค', + '่œๆ‘˜', + 'ๅฅˆใ€…', + 'ๆ—ฉ็ด€', + 'ๆ', + '้™ฝ่‘ต', + '่Šฝไพ', + '็ตๆœˆ', + 'ๅ’ฒ่‰ฏ', + 'ๅ‡œ', + '็ดฌ', + 'ๅฟƒๆ„›', + '่Šฑ', + 'ๅฟƒๆ˜ฅ', + 'ๆ„›่Ž‰', + 'ๆ„›่œ', + 'ๆกœ', + 'ๅฟƒ็ต', + '็พŽ็ต', +]; diff --git a/src/locales/ja/name/index.ts b/src/locales/ja/name/index.ts index e5ceaf3cd0a..80631e1c77f 100644 --- a/src/locales/ja/name/index.ts +++ b/src/locales/ja/name/index.ts @@ -3,13 +3,17 @@ * Run 'pnpm run generate:locales' to update. */ import type { NameDefinitions } from '../../..'; +import female_first_name from './female_first_name'; import first_name from './first_name'; import last_name from './last_name'; +import male_first_name from './male_first_name'; import name_ from './name'; const name: NameDefinitions = { + female_first_name, first_name, last_name, + male_first_name, name: name_, }; diff --git a/src/locales/ja/name/male_first_name.ts b/src/locales/ja/name/male_first_name.ts new file mode 100644 index 00000000000..fda7e1b96d1 --- /dev/null +++ b/src/locales/ja/name/male_first_name.ts @@ -0,0 +1,137 @@ +export default [ + 'ๆญฃไธ€', + 'ๆญฃไบŒ', + 'ๆญฃไธ‰', + 'ๆธ…', + '่พฐ้›„', + 'ไธ‰้ƒŽ', + 'ๆ˜ญไบŒ', + 'ๆ˜ญไธ‰', + '่Œ‚', + 'ๅ‹‡', + 'ๆ˜Ž', + 'ๅผ˜', + 'ๅ‹', + '็จ”', + 'ๅš', + '้š†', + '่ช ', + 'ๆตฉ', + 'ๅฅไธ€', + 'ๅคง่ผ”', + '้”ไนŸ', + '็ฟ”ๅคช', + 'ๆ‹“ไนŸ', + 'ๅฅๅคช', + 'ๅคง่ผ', + '็ฟ”', + '้งฟ', + '่“ฎ', + 'ๅคง็ฟ”', + '้™ธ', + 'ๆ‚ ็œŸ', + '่’ผ', + 'ๆ˜ญ', + 'ๅฎŸ', + '้€ฒ', + 'ๅ’Œๅคซ', + 'ไฟฎ', + 'ๆตฉไธ€', + 'ๅ“ฒไนŸ', + 'ๅ‰›', + 'ๅคงไป‹', + 'ๆตทๆ–—', + 'ๆ‹“ๆตท', + '้ขฏๅคช', + 'ๆ‚ ๆ–—', + '้™ฝ็ฟ”', + 'ๆนŠ', + 'ๆ–ฐ', + 'ๆจน', + 'ๆญฃ้›„', + 'ๅ‹ๅˆฉ', + '่ฑŠ', + 'ๅ’Œๅฝฆ', + 'ๅญฆ', + '็›ดๆจน', + 'ๅฅๅคช้ƒŽ', + 'ๅคงๅ’Œ', + '้™ฝๅ‘', + '็‘›ๅคช', + '้™ฝๅคช', + 'ๆญฃ', + 'ไธ€้ƒŽ', + 'ๅ‹ฒ', + 'ๅพน', + 'ๆตฉไบŒ', + 'ไบฎ', + 'ๅคงๆจน', + '็ฟผ', + '็พฉ้›„', + 'ๆ˜ญไธ€', + 'ๅŠŸ', + 'ๆญฆ', + 'ๆทณ', + 'ๅ’ŒไนŸ', + 'ๅคงๅœฐ', + 'ๅŒ ', + 'ๆ‚ ไบบ', + 'ๆœ้™ฝ', + 'ๅพ‹', + 'ๆญฆ้›„', + '่‹ฑๆจน', + '็ง€ๆจน', + '็ฅไป‹', + '้›„ๅคช', + '็ฟ”ๅนณ', + 'ๅคง่ฒด', + 'ๅคช้™ฝ', + '้ขฏ', + '้™ฝๆ–—', + '้ขฏ็œŸ', + '่’ผ็ฉบ', + 'ๅ„ชๆ–—', + 'ๆญฃๆฒป', + 'ๆ˜‡', + '็ซœไนŸ', + '่ก', + '่ฒดๅคง', + '็›ดไบบ', + '่ผ', + 'ๅ„ชๅคช', + 'ๆ‚ ๅคช', + '้™ธๆ–—', + 'ๅคชไธ€', + 'ๆ‚ ', + 'ๆตฉไน‹', + 'ๅฅ', + 'ๅšไน‹', + 'ไบฎๅคช', + 'ไธ€่ผ', + '็ฉบ', + '้™ฝๅคง', + 'ๆญฃๅคซ', + '็ง€้›„', + 'ๅนธ้›„', + 'ๅ‹‰', + 'ๅด‡', + 'ๆด‹ๅนณ', + 'ๆ‹“ๅ“‰', + 'ๆถผๅคช', + 'ๅคง้›…', + 'ๆตท็ฟ”', + '้พ็”Ÿ', + '็ต็ฟ”', + 'ๆ‚ ็ฟ”', + '่‘ต', + 'ๆญฃ็”ท', + '่พฐ็”ท', + 'ไธ€็”ท', + 'ๅ„ช', + '้›„ๅคง', + 'ๅบทๅนณ', + 'ๆ™บไนŸ', + '็ซœ', + 'ๆ‚ ๅธŒ', + 'ๆญฉๅคข', +]; diff --git a/src/locales/ne/address/street.ts b/src/locales/ne/address/street.ts index edc26b85b6c..1a1885b1c4e 100644 --- a/src/locales/ne/address/street.ts +++ b/src/locales/ne/address/street.ts @@ -1,4 +1,4 @@ export default [ - '{{name.firstName}} {{address.streetSuffix}}', - '{{name.lastName}} {{address.streetSuffix}}', + '{{name.firstName}} {{address.street_suffix}}', + '{{name.lastName}} {{address.street_suffix}}', ]; diff --git a/src/locales/pl/color/human.ts b/src/locales/pl/color/human.ts index 164d25bb603..4c8db818ac1 100644 --- a/src/locales/pl/color/human.ts +++ b/src/locales/pl/color/human.ts @@ -1,13 +1,15 @@ export default [ - 'czerwony', - 'zielony', - 'niebieski', - 'ลผรณล‚ty', - 'pomaraล„czowy', - 'granatowy', - 'szary', + 'beลผowy', 'biaล‚y', + 'brฤ…zowy', 'czarny', + 'czerwony', 'fioletowy', + 'granatowy', + 'niebieski', + 'pomaraล„czowy', 'rรณลผowy', + 'szary', + 'zielony', + 'ลผรณล‚ty', ]; diff --git a/src/locales/pt_BR/address/street.ts b/src/locales/pt_BR/address/street.ts index edc26b85b6c..1a1885b1c4e 100644 --- a/src/locales/pt_BR/address/street.ts +++ b/src/locales/pt_BR/address/street.ts @@ -1,4 +1,4 @@ export default [ - '{{name.firstName}} {{address.streetSuffix}}', - '{{name.lastName}} {{address.streetSuffix}}', + '{{name.firstName}} {{address.street_suffix}}', + '{{name.lastName}} {{address.street_suffix}}', ]; diff --git a/src/locales/vi/address/street.ts b/src/locales/vi/address/street.ts index edc26b85b6c..1a1885b1c4e 100644 --- a/src/locales/vi/address/street.ts +++ b/src/locales/vi/address/street.ts @@ -1,4 +1,4 @@ export default [ - '{{name.firstName}} {{address.streetSuffix}}', - '{{name.lastName}} {{address.streetSuffix}}', + '{{name.firstName}} {{address.street_suffix}}', + '{{name.lastName}} {{address.street_suffix}}', ]; diff --git a/src/locales/zu_ZA/address/street.ts b/src/locales/zu_ZA/address/street.ts index edc26b85b6c..1a1885b1c4e 100644 --- a/src/locales/zu_ZA/address/street.ts +++ b/src/locales/zu_ZA/address/street.ts @@ -1,4 +1,4 @@ export default [ - '{{name.firstName}} {{address.streetSuffix}}', - '{{name.lastName}} {{address.streetSuffix}}', + '{{name.firstName}} {{address.street_suffix}}', + '{{name.lastName}} {{address.street_suffix}}', ]; diff --git a/src/modules/address/index.ts b/src/modules/address/index.ts index 7c55bb51325..96572cba9b3 100644 --- a/src/modules/address/index.ts +++ b/src/modules/address/index.ts @@ -86,13 +86,13 @@ export class Address { format = this.faker.datatype.number(formats.length - 1); } - return this.faker.fake(formats[format]); + return this.faker.helpers.fake(formats[format]); } /** * Returns a random localized city prefix. * - * @see faker.address.city + * @see faker.address.city() * * @example * faker.address.cityPrefix() // 'East' @@ -115,7 +115,7 @@ export class Address { /** * Returns a random localized city suffix. * - * @see faker.address.city + * @see faker.address.city() * * @example * faker.address.citySuffix() // 'mouth' @@ -171,7 +171,7 @@ export class Address { const format = this.faker.helpers.arrayElement( this.faker.definitions.address.street ); - return this.faker.fake(format); + return this.faker.helpers.fake(format); } /** @@ -212,16 +212,26 @@ export class Address { const formats = this.faker.definitions.address.street_address; const format = formats[useFullAddress ? 'full' : 'normal']; - return this.faker.fake(format); + return this.faker.helpers.fake(format); } /** * Returns a random localized street suffix. * + * @see faker.address.street() + * * @example * faker.address.streetSuffix() // 'Streets' + * + * @deprecated Use faker.address.street() instead. */ streetSuffix(): string { + deprecated({ + deprecated: 'faker.address.streetSuffix()', + proposed: 'faker.address.street()', + since: '7.4', + until: '8.0', + }); return this.faker.helpers.arrayElement( this.faker.definitions.address.street_suffix ); @@ -230,10 +240,20 @@ export class Address { /** * Returns a random localized street prefix. * + * @see faker.address.street() + * * @example * fakerGH.address.streetPrefix() // 'Boame' + * + * @deprecated Use faker.address.street() instead. */ streetPrefix(): string { + deprecated({ + deprecated: 'faker.address.streetPrefix()', + proposed: 'faker.address.street()', + since: '7.4', + until: '8.0', + }); return this.faker.helpers.arrayElement( this.faker.definitions.address.street_prefix ); @@ -445,7 +465,6 @@ export class Address { * faker.address.nearbyGPSCoordinate([33, -170]) // [ '33.0165', '-170.0636' ] * faker.address.nearbyGPSCoordinate([33, -170], 1000, true) // [ '37.9163', '-179.2408' ] */ - // TODO ST-DDT 2022-02-10: Allow coordinate parameter to be [string, string]. nearbyGPSCoordinate( coordinate?: [latitude: number, longitude: number], radius: number = 10, diff --git a/src/modules/animal/index.ts b/src/modules/animal/index.ts index 416fe533a2a..d5d0ef08ae8 100644 --- a/src/modules/animal/index.ts +++ b/src/modules/animal/index.ts @@ -152,6 +152,18 @@ export class Animal { ); } + /** + * Returns a random rodent breed. + * + * @example + * faker.animal.rodent() // 'Cuscomys ashanika' + */ + rodent(): string { + return this.faker.helpers.arrayElement( + this.faker.definitions.animal.rodent + ); + } + /** * Returns a random animal type. * diff --git a/src/modules/company/index.ts b/src/modules/company/index.ts index 968afbbfcbe..0a164fec98b 100644 --- a/src/modules/company/index.ts +++ b/src/modules/company/index.ts @@ -29,7 +29,7 @@ export class Company { /** * Generates a random company name. * - * @param format The optional format index used to select a format. + * @param format The optional format index used to select a format. Deprecated, do not use. * * @example * faker.company.name() // 'Zieme, Hauck and McClure' @@ -41,11 +41,20 @@ export class Company { '{{name.lastName}}, {{name.lastName}} and {{name.lastName}}', ]; + if (format != null) { + deprecated({ + deprecated: 'faker.company.name(format)', + proposed: 'faker.company.name()', + since: '7.4', + until: '8.0', + }); + } + if (typeof format !== 'number') { format = this.faker.datatype.number(formats.length - 1); } - return this.faker.fake(formats[format]); + return this.faker.helpers.fake(formats[format]); } /** @@ -53,7 +62,7 @@ export class Company { * * @param format The optional format index used to select a format. * - * @see faker.company.name + * @see faker.company.name() * * @example * faker.company.companyName() // 'Zieme, Hauck and McClure' @@ -88,9 +97,11 @@ export class Company { * faker.company.catchPhrase() // 'Upgradable systematic flexibility' */ catchPhrase(): string { - return this.faker.fake( - '{{company.catchPhraseAdjective}} {{company.catchPhraseDescriptor}} {{company.catchPhraseNoun}}' - ); + return [ + this.catchPhraseAdjective(), + this.catchPhraseDescriptor(), + this.catchPhraseNoun(), + ].join(' '); } /** @@ -100,9 +111,7 @@ export class Company { * faker.company.bs() // 'cultivate synergistic e-markets' */ bs(): string { - return this.faker.fake( - '{{company.bsBuzz}} {{company.bsAdjective}} {{company.bsNoun}}' - ); + return [this.bsBuzz(), this.bsAdjective(), this.bsNoun()].join(' '); } /** diff --git a/src/modules/fake/index.ts b/src/modules/fake/index.ts index 9dff1c8ec36..a60acd5b05c 100644 --- a/src/modules/fake/index.ts +++ b/src/modules/fake/index.ts @@ -1,8 +1,10 @@ import type { Faker } from '../..'; -import { FakerError } from '../../errors/faker-error'; +import { deprecated } from '../../internal/deprecated'; /** * Generator method for combining faker methods based on string input. + * + * @deprecated */ export class Fake { constructor(private readonly faker: Faker) { @@ -47,6 +49,7 @@ export class Fake { * @param str The template string that will get interpolated. Must not be empty. * * @see faker.helpers.mustache() to use custom functions for resolution. + * @see faker.helpers.fake() * * @example * faker.fake('{{name.lastName}}') // 'Barrows' @@ -55,93 +58,16 @@ export class Fake { * faker.fake('Good Morning {{name.firstName}}!') // 'Good Morning Estelle!' * faker.fake('You can call me at {{phone.number(!## ### #####!)}}.') // 'You can call me at 202 555 973722.' * faker.fake('I flipped the coin an got: {{helpers.arrayElement(["heads", "tails"])}}') // 'I flipped the coin an got: tails' + * + * @deprecated Use faker.helpers.fake() instead. */ fake(str: string): string { - // if incoming str parameter is not provided, return error message - if (typeof str !== 'string' || str.length === 0) { - throw new FakerError('string parameter is required!'); - } - - // find first matching {{ and }} - const start = str.search(/{{[a-z]/); - const end = str.indexOf('}}', start); - - // if no {{ and }} is found, we are done - if (start === -1 || end === -1) { - return str; - } - - // extract method name from between the {{ }} that we found - // for example: {{name.firstName}} - const token = str.substring(start + 2, end + 2); - let method = token.replace('}}', '').replace('{{', ''); - - // extract method parameters - const regExp = /\(([^)]+)\)/; - const matches = regExp.exec(method); - let parameters = ''; - if (matches) { - method = method.replace(regExp, ''); - parameters = matches[1]; - } - - // split the method into module and function - const parts = method.split('.'); - - let currentModuleOrMethod: unknown = this.faker; - let currentDefinitions: unknown = this.faker.definitions; - - // Search for the requested method or definition - for (const part of parts) { - currentModuleOrMethod = currentModuleOrMethod?.[part]; - currentDefinitions = currentDefinitions?.[part]; - } - - // Make method executable - let fn: (args?: unknown) => unknown; - if (typeof currentModuleOrMethod === 'function') { - fn = currentModuleOrMethod as (args?: unknown) => unknown; - } else if (Array.isArray(currentDefinitions)) { - fn = () => - this.faker.helpers.arrayElement(currentDefinitions as unknown[]); - } else { - throw new FakerError(`Invalid module method or definition: ${method} -- faker.${method} is not a function -- faker.definitions.${method} is not an array`); - } - - // assign the function from the module.function namespace - fn = fn.bind(this); - - // If parameters are populated here, they are always going to be of string type - // since we might actually be dealing with an object or array, - // we always attempt to the parse the incoming parameters into JSON - let params: unknown; - // Note: we experience a small performance hit here due to JSON.parse try / catch - // If anyone actually needs to optimize this specific code path, please open a support issue on github - try { - params = JSON.parse(parameters); - } catch (err) { - // since JSON.parse threw an error, assume parameters was actually a string - params = parameters; - } - - let result: string; - if (typeof params === 'string' && params.length === 0) { - result = String(fn()); - } else { - result = String(fn(params)); - } - - // Replace the found tag with the returned fake value - // We cannot use string.replace here because the result might contain evaluated characters - const res = str.substring(0, start) + result + str.substring(end + 2); - - if (res === '') { - return ''; - } - - // return the response recursively until we are done finding all tags - return this.fake(res); + deprecated({ + deprecated: 'faker.fake()', + proposed: 'faker.helpers.fake()', + since: '7.4', + until: '8.0', + }); + return this.faker.helpers.fake(str); } } diff --git a/src/modules/finance/index.ts b/src/modules/finance/index.ts index 5d83963bc07..7085ea3654c 100644 --- a/src/modules/finance/index.ts +++ b/src/modules/finance/index.ts @@ -390,29 +390,25 @@ export class Finance { } /** - * Generates a random bic. + * Generates a random SWIFT/BIC code based on the [ISO-9362](https://en.wikipedia.org/wiki/ISO_9362) format. * * @example * faker.finance.bic() // 'WYAUPGX1432' */ bic(): string { - const vowels = ['A', 'E', 'I', 'O', 'U']; - const prob = this.faker.datatype.number(100); - - return [ - this.faker.helpers.replaceSymbols('???'), - this.faker.helpers.arrayElement(vowels), - this.faker.helpers.arrayElement(iban.iso3166), - this.faker.helpers.replaceSymbols('?'), - '1', - prob < 10 - ? this.faker.helpers.replaceSymbols( - `?${this.faker.helpers.arrayElement(vowels)}?` - ) - : prob < 40 - ? this.faker.helpers.replaceSymbols('###') - : '', - ].join(''); + const bankIdentifier = this.faker.random.alpha({ + count: 4, + casing: 'upper', + }); + const countryCode = this.faker.helpers.arrayElement(iban.iso3166); + const locationCode = this.faker.random.alphaNumeric(2, { casing: 'upper' }); + const branchCode = this.faker.datatype.boolean() + ? this.faker.datatype.boolean() + ? this.faker.random.alphaNumeric(3, { casing: 'upper' }) + : 'XXX' + : ''; + + return `${bankIdentifier}${countryCode}${locationCode}${branchCode}`; } /** diff --git a/src/modules/helpers/index.ts b/src/modules/helpers/index.ts index a68b66ae9de..b4d73b2e934 100644 --- a/src/modules/helpers/index.ts +++ b/src/modules/helpers/index.ts @@ -1,4 +1,5 @@ import type { Faker } from '../..'; +import { FakerError } from '../../errors/faker-error'; import { luhnCheckValue } from './luhn-check'; /** @@ -454,4 +455,134 @@ export class Helpers { return arrayCopy.slice(min); } + + /** + * Generator for combining faker methods based on a static string input. + * + * Note: We recommend using string template literals instead of `fake()`, + * which are faster and strongly typed (if you are using TypeScript), + * e.g. ``const address = `${faker.address.zipCode()} ${faker.address.city()}`;`` + * + * This method is useful if you have to build a random string from a static, non-executable source + * (e.g. string coming from a user, stored in a database or a file). + * + * It checks the given string for placeholders and replaces them by calling faker methods: + * + * ```js + * const hello = faker.helpers.fake('Hi, my name is {{name.firstName}} {{name.lastName}}!') + * ``` + * + * This would use the `faker.name.firstName()` and `faker.name.lastName()` method to resolve the placeholders respectively. + * + * It is also possible to provide parameters. At first, they will be parsed as json, + * and if that isn't possible, we will fall back to string: + * + * ```js + * const message = faker.helpers.fake(`You can call me at {{phone.number(+!# !## #### #####!)}}.') + * ``` + * + * Currently it is not possible to set more than a single parameter. + * + * It is also NOT possible to use any non-faker methods or plain javascript in such templates. + * + * @param str The template string that will get interpolated. Must not be empty. + * + * @see faker.helpers.mustache() to use custom functions for resolution. + * + * @example + * faker.helpers.fake('{{name.lastName}}') // 'Barrows' + * faker.helpers.fake('{{name.lastName}}, {{name.firstName}} {{name.suffix}}') // 'Durgan, Noe MD' + * faker.helpers.fake('This is static test.') // 'This is static test.' + * faker.helpers.fake('Good Morning {{name.firstName}}!') // 'Good Morning Estelle!' + * faker.helpers.fake('You can call me at {{phone.number(!## ### #####!)}}.') // 'You can call me at 202 555 973722.' + * faker.helpers.fake('I flipped the coin an got: {{helpers.arrayElement(["heads", "tails"])}}') // 'I flipped the coin an got: tails' + */ + fake(str: string): string { + // if incoming str parameter is not provided, return error message + if (typeof str !== 'string' || str.length === 0) { + throw new FakerError('string parameter is required!'); + } + + // find first matching {{ and }} + const start = str.search(/{{[a-z]/); + const end = str.indexOf('}}', start); + + // if no {{ and }} is found, we are done + if (start === -1 || end === -1) { + return str; + } + + // extract method name from between the {{ }} that we found + // for example: {{name.firstName}} + const token = str.substring(start + 2, end + 2); + let method = token.replace('}}', '').replace('{{', ''); + + // extract method parameters + const regExp = /\(([^)]+)\)/; + const matches = regExp.exec(method); + let parameters = ''; + if (matches) { + method = method.replace(regExp, ''); + parameters = matches[1]; + } + + // split the method into module and function + const parts = method.split('.'); + + let currentModuleOrMethod: unknown = this.faker; + let currentDefinitions: unknown = this.faker.definitions; + + // Search for the requested method or definition + for (const part of parts) { + currentModuleOrMethod = currentModuleOrMethod?.[part]; + currentDefinitions = currentDefinitions?.[part]; + } + + // Make method executable + let fn: (args?: unknown) => unknown; + if (typeof currentModuleOrMethod === 'function') { + fn = currentModuleOrMethod as (args?: unknown) => unknown; + } else if (Array.isArray(currentDefinitions)) { + fn = () => + this.faker.helpers.arrayElement(currentDefinitions as unknown[]); + } else { + throw new FakerError(`Invalid module method or definition: ${method} +- faker.${method} is not a function +- faker.definitions.${method} is not an array`); + } + + // assign the function from the module.function namespace + fn = fn.bind(this); + + // If parameters are populated here, they are always going to be of string type + // since we might actually be dealing with an object or array, + // we always attempt to the parse the incoming parameters into JSON + let params: unknown; + // Note: we experience a small performance hit here due to JSON.parse try / catch + // If anyone actually needs to optimize this specific code path, please open a support issue on github + try { + params = JSON.parse(parameters); + } catch (err) { + // since JSON.parse threw an error, assume parameters was actually a string + params = parameters; + } + + let result: string; + if (typeof params === 'string' && params.length === 0) { + result = String(fn()); + } else { + result = String(fn(params)); + } + + // Replace the found tag with the returned fake value + // We cannot use string.replace here because the result might contain evaluated characters + const res = str.substring(0, start) + result + str.substring(end + 2); + + if (res === '') { + return ''; + } + + // return the response recursively until we are done finding all tags + return this.fake(res); + } } diff --git a/src/modules/image/providers/unsplash.ts b/src/modules/image/providers/unsplash.ts index 0c1eb7ece59..f682718cf0a 100644 --- a/src/modules/image/providers/unsplash.ts +++ b/src/modules/image/providers/unsplash.ts @@ -35,7 +35,7 @@ export class Unsplash { /** * Returns a random avatar url. * - * @see faker.internet.avatar + * @see faker.internet.avatar() * * @example * faker.internet.avatar() diff --git a/src/modules/internet/user-agent.ts b/src/modules/internet/user-agent.ts index 046758d4821..972b25741e8 100644 --- a/src/modules/internet/user-agent.ts +++ b/src/modules/internet/user-agent.ts @@ -44,58 +44,41 @@ import type { Faker } from '../..'; -export type Arch = 'lin' | 'mac' | 'win'; +type OS = 'lin' | 'mac' | 'win'; -export function generate(faker: Faker): string { - function rnd( - a?: string[] | number | Record, - b?: number - ): string | number { - //calling rnd() with no arguments is identical to rnd(0, 100) - a = a || 0; - b = b || 100; - - if (typeof b === 'number' && typeof a === 'number') { - // 9/2018 - Added faker random to ensure mersenne and seed - return faker.datatype.number({ min: a, max: b }); - } +type Browser = 'chrome' | 'iexplorer' | 'firefox' | 'safari' | 'opera'; - if (Array.isArray(a)) { - //returns a random element from array (a), even weighting - return faker.helpers.arrayElement(a); - } - - if (a && typeof a === 'object') { - //returns a random key from the passed object; keys are weighted by the decimal probability in their value - return ((obj) => { - const rand = (rnd(0, 100) as number) / 100; - let min = 0; - let max = 0; - let return_val: string; +/** + * Generates a random user-agent. + * + * @param faker An existing faker instance. + */ +export function generate(faker: Faker): string { + const weightedKeyFromObject = >( + obj: T + ): keyof T => { + //returns a random key from the passed object; keys are weighted by the decimal probability in their value + const rand = faker.datatype.number({ min: 0, max: 100 }) / 100; + let min = 0; + let max = 0; + let return_val: string; - for (const key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - max = obj[key] + min; - return_val = key; - if (rand >= min && rand <= max) { - break; - } - min = min + obj[key]; - } + for (const key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + max = obj[key] + min; + return_val = key; + if (rand >= min && rand <= max) { + break; } - - return return_val; - })(a); + min = min + obj[key]; + } } - throw new TypeError( - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions - `Invalid arguments passed to rnd. (${b ? `${a}, ${b}` : a})` - ); - } + return return_val; + }; - function randomLang(): string | number { - return rnd([ + const randomLang = (): string => + faker.helpers.arrayElement([ 'AB', 'AF', 'AN', @@ -193,80 +176,113 @@ export function generate(faker: Faker): string { 'YI', 'ZH', ]); - } - function randomBrowserAndOS(): Array { - const browser = rnd({ + const randomBrowserAndOS = (): [Browser, OS] => { + const browser: Browser = weightedKeyFromObject({ chrome: 0.45132810566, iexplorer: 0.27477061836, firefox: 0.19384170608, safari: 0.06186781118, opera: 0.01574236955, }); - const os = { - chrome: { win: 0.89, mac: 0.09, lin: 0.02 }, - firefox: { win: 0.83, mac: 0.16, lin: 0.01 }, - opera: { win: 0.91, mac: 0.03, lin: 0.06 }, - safari: { win: 0.04, mac: 0.96 }, - iexplorer: ['win'], - }; + const os: OS = weightedKeyFromObject( + { + chrome: { win: 0.89, mac: 0.09, lin: 0.02 }, + firefox: { win: 0.83, mac: 0.16, lin: 0.01 }, + opera: { win: 0.91, mac: 0.03, lin: 0.06 }, + safari: { win: 0.04, mac: 0.96 }, + iexplorer: { win: 1 }, + }[browser] + ); - return [browser, rnd(os[browser])]; - } + return [browser, os]; + }; - function randomProc(arch: Arch): string | number { + const randomProc = (arch: OS): string => { const procs = { lin: ['i686', 'x86_64'], mac: { Intel: 0.48, PPC: 0.01, 'U; Intel': 0.48, 'U; PPC': 0.01 }, win: ['', 'WOW64', 'Win64; x64'], }; - return rnd(procs[arch]); - } + const archValue = procs[arch]; + const proc = Array.isArray(archValue) + ? faker.helpers.arrayElement(archValue) + : weightedKeyFromObject(archValue); - function randomRevision(dots: number): string { + return proc; + }; + + const randomRevision = (dots: number): string => { let return_val = ''; //generate a random revision //dots = 2 returns .x.y where x & y are between 0 and 9 for (let x = 0; x < dots; x++) { - return_val += `.${rnd(0, 9)}`; + return_val += `.${faker.datatype.number({ min: 0, max: 9 })}`; } return return_val; - } + }; const version_string = { net() { - return [rnd(1, 4), rnd(0, 9), rnd(10000, 99999), rnd(0, 9)].join('.'); + return [ + faker.datatype.number({ min: 1, max: 4 }), + faker.datatype.number({ min: 0, max: 9 }), + faker.datatype.number({ min: 10000, max: 99999 }), + faker.datatype.number({ min: 0, max: 9 }), + ].join('.'); }, nt() { - return `${rnd(5, 6)}.${rnd(0, 3)}`; + return [ + faker.datatype.number({ min: 5, max: 6 }), + faker.datatype.number({ min: 0, max: 3 }), + ].join('.'); }, ie() { - return rnd(7, 11); + return faker.datatype.number({ min: 7, max: 11 }); }, trident() { - return `${rnd(3, 7)}.${rnd(0, 1)}`; + return [ + faker.datatype.number({ min: 3, max: 7 }), + faker.datatype.number({ min: 0, max: 1 }), + ].join('.'); }, osx(delim?: string) { - return [10, rnd(5, 10), rnd(0, 9)].join(delim || '.'); + return [ + 10, + faker.datatype.number({ min: 5, max: 10 }), + faker.datatype.number({ min: 0, max: 9 }), + ].join(delim || '.'); }, chrome() { - return [rnd(13, 39), 0, rnd(800, 899), 0].join('.'); + return [ + faker.datatype.number({ min: 13, max: 39 }), + 0, + faker.datatype.number({ min: 800, max: 899 }), + 0, + ].join('.'); }, presto() { - return `2.9.${rnd(160, 190)}`; + return `2.9.${faker.datatype.number({ min: 160, max: 190 })}`; }, presto2() { - return `${rnd(10, 12)}.00`; + return `${faker.datatype.number({ min: 10, max: 12 })}.00`; }, safari() { - return `${rnd(531, 538)}.${rnd(0, 2)}.${rnd(0, 2)}`; + return [ + faker.datatype.number({ min: 531, max: 538 }), + faker.datatype.number({ min: 0, max: 2 }), + faker.datatype.number({ min: 0, max: 2 }), + ].join('.'); }, }; - const browser = { - firefox(arch: Arch): string { + const browserMap = { + firefox(arch: OS): string { //https://developer.mozilla.org/en-US/docs/Gecko_user_agent_string_reference - const firefox_ver = `${rnd(5, 15)}${randomRevision(2)}`, + const firefox_ver = `${faker.datatype.number({ + min: 5, + max: 15, + })}${randomRevision(2)}`, gecko_ver = `Gecko/20100101 Firefox/${firefox_ver}`, proc = randomProc(arch), os_ver = @@ -287,19 +303,21 @@ export function generate(faker: Faker): string { if (ver >= 11) { //http://msdn.microsoft.com/en-us/library/ie/hh869301(v=vs.85).aspx - return `Mozilla/5.0 (Windows NT 6.${rnd(1, 3)}; Trident/7.0; ${rnd([ - 'Touch; ', - '', - ])}rv:11.0) like Gecko`; + return `Mozilla/5.0 (Windows NT 6.${faker.datatype.number({ + min: 1, + max: 3, + })}; Trident/7.0; ${ + faker.datatype.boolean() ? 'Touch; ' : '' + }rv:11.0) like Gecko`; } //http://msdn.microsoft.com/en-us/library/ie/ms537503(v=vs.85).aspx return `Mozilla/5.0 (compatible; MSIE ${ver}.0; Windows NT ${version_string.nt()}; Trident/${version_string.trident()}${ - rnd(0, 1) === 1 ? `; .NET CLR ${version_string.net()}` : '' + faker.datatype.boolean() ? `; .NET CLR ${version_string.net()}` : '' })`; }, - opera(arch: Arch): string { + opera(arch: OS): string { //http://www.opera.com/docs/history/ const presto_ver = ` Presto/${version_string.presto()} Version/${version_string.presto2()})`, os_ver = @@ -309,23 +327,38 @@ export function generate(faker: Faker): string { ? `(X11; Linux ${randomProc(arch)}; U; ${randomLang()}${presto_ver}` : `(Macintosh; Intel Mac OS X ${version_string.osx()} U; ${randomLang()} Presto/${version_string.presto()} Version/${version_string.presto2()})`; - return `Opera/${rnd(9, 14)}.${rnd(0, 99)} ${os_ver}`; + return `Opera/${faker.datatype.number({ + min: 9, + max: 14, + })}.${faker.datatype.number({ + min: 0, + max: 99, + })} ${os_ver}`; }, - safari(arch: Arch): string { + safari(arch: OS): string { const safari = version_string.safari(), - ver = `${rnd(4, 7)}.${rnd(0, 1)}.${rnd(0, 10)}`, + ver = `${faker.datatype.number({ + min: 4, + max: 7, + })}.${faker.datatype.number({ + min: 0, + max: 1, + })}.${faker.datatype.number({ min: 0, max: 10 })}`, os_ver = arch === 'mac' ? `(Macintosh; ${randomProc('mac')} Mac OS X ${version_string.osx( '_' - )} rv:${rnd(2, 6)}.0; ${randomLang()}) ` + )} rv:${faker.datatype.number({ + min: 2, + max: 6, + })}.0; ${randomLang()}) ` : `(Windows; U; Windows NT ${version_string.nt()})`; return `Mozilla/5.0 ${os_ver}AppleWebKit/${safari} (KHTML, like Gecko) Version/${ver} Safari/${safari}`; }, - chrome(arch: Arch): string { + chrome(arch: OS): string { const safari = version_string.safari(), os_ver = arch === 'mac' @@ -340,6 +373,6 @@ export function generate(faker: Faker): string { }, }; - const random = randomBrowserAndOS(); - return browser[random[0]](random[1]); + const [browser, arch] = randomBrowserAndOS(); + return browserMap[browser](arch); } diff --git a/src/modules/name/index.ts b/src/modules/name/index.ts index 3ff775e2b9e..0a67c382cda 100644 --- a/src/modules/name/index.ts +++ b/src/modules/name/index.ts @@ -1,30 +1,43 @@ import type { Faker } from '../..'; import { deprecated } from '../../internal/deprecated'; -// disabled until renamed to Sex +/** + * @deprecated Use Sex enum instead. + */ export enum Gender { + // disabled until renamed to Sex // eslint-disable-next-line @typescript-eslint/naming-convention female = 'female', // eslint-disable-next-line @typescript-eslint/naming-convention male = 'male', } -export type GenderType = 'female' | 'male'; +/** + * @deprecated Use SexType instead. + */ +export type GenderType = SexType; + +export enum Sex { + Female = 'female', + Male = 'male', +} + +export type SexType = `${Sex}`; /** - * Select a definition based on given gender. + * Select a definition based on given sex. * * @param faker Faker instance. - * @param gender Gender. + * @param sex Sex. * @param param2 Definitions. - * @param param2.generic Non-gender definitions. + * @param param2.generic Non-sex definitions. * @param param2.female Female definitions. * @param param2.male Male definitions. - * @returns Definition based on given gender. + * @returns Definition based on given sex. */ function selectDefinition( faker: Faker, - gender: GenderType | undefined, + sex: SexType | undefined, // TODO @Shinigami92 2022-03-21: Remove fallback empty object when `strict: true` { generic, @@ -33,13 +46,16 @@ function selectDefinition( }: { generic?: string[]; female?: string[]; male?: string[] } = {} ) { let values: string[] | undefined; - switch (gender) { - case 'female': + + switch (sex) { + case Sex.Female: values = female; break; - case 'male': + + case Sex.Male: values = male; break; + default: values = generic; break; @@ -73,7 +89,7 @@ export class Name { /** * Returns a random first name. * - * @param gender The optional gender to use. + * @param sex The optional sex to use. * Can be either `'female'` or `'male'`. * * @example @@ -81,11 +97,11 @@ export class Name { * faker.name.firstName('female') // 'Victoria' * faker.name.firstName('male') // 'Tom' */ - firstName(gender?: GenderType): string { + firstName(sex?: SexType): string { const { first_name, female_first_name, male_first_name } = this.faker.definitions.name; - return selectDefinition(this.faker, gender, { + return selectDefinition(this.faker, sex, { generic: first_name, female: female_first_name, male: male_first_name, @@ -95,7 +111,7 @@ export class Name { /** * Returns a random last name. * - * @param gender The optional gender to use. + * @param sex The optional sex to use. * Can be either `'female'` or `'male'`. * * @example @@ -103,11 +119,11 @@ export class Name { * faker.name.lastName('female') // 'Grady' * faker.name.lastName('male') // 'Barton' */ - lastName(gender?: GenderType): string { + lastName(sex?: SexType): string { const { last_name, female_last_name, male_last_name } = this.faker.definitions.name; - return selectDefinition(this.faker, gender, { + return selectDefinition(this.faker, sex, { generic: last_name, female: female_last_name, male: male_last_name, @@ -117,7 +133,7 @@ export class Name { /** * Returns a random middle name. * - * @param gender The optional gender to use. + * @param sex The optional sex to use. * Can be either `'female'` or `'male'`. * * @example @@ -125,11 +141,11 @@ export class Name { * faker.name.middleName('female') // 'Eloise' * faker.name.middleName('male') // 'Asher' */ - middleName(gender?: GenderType): string { + middleName(sex?: SexType): string { const { middle_name, female_middle_name, male_middle_name } = this.faker.definitions.name; - return selectDefinition(this.faker, gender, { + return selectDefinition(this.faker, sex, { generic: middle_name, female: female_middle_name, male: male_middle_name, @@ -141,8 +157,7 @@ export class Name { * * @param firstName The optional first name to use. If not specified a random one will be chosen. * @param lastName The optional last name to use. If not specified a random one will be chosen. - * @param gender The optional gender to use. - * Can be either `'female'` or `'male'`. + * @param sex The optional sex to use. Can be either `'female'` or `'male'`. * * @see faker.name.fullName() * @@ -155,14 +170,15 @@ export class Name { * * @deprecated Use faker.name.fullName() instead. */ - findName(firstName?: string, lastName?: string, gender?: GenderType): string { + findName(firstName?: string, lastName?: string, sex?: SexType): string { deprecated({ deprecated: 'faker.name.findName()', proposed: 'faker.name.fullName()', since: '7.4', until: '8.0', }); - return this.fullName({ firstName, lastName, gender }); + + return this.fullName({ firstName, lastName, sex }); } /** @@ -171,33 +187,45 @@ export class Name { * @param options An options object. Defaults to `{}`. * @param options.firstName The optional first name to use. If not specified a random one will be chosen. * @param options.lastName The optional last name to use. If not specified a random one will be chosen. - * @param options.gender The optional gender to use. - * Can be either `'female'` or `'male'`. + * @param options.sex The optional sex to use. Can be either `'female'` or `'male'`. + * @param options.gender Deprecated. Use `sex` instead. * * @example * faker.name.fullName() // 'Allen Brown' - * faker.name.fullName('Joann') // 'Joann Osinski' - * faker.name.fullName('Marcella', '', 'female') // 'Mrs. Marcella Huels' - * faker.name.fullName(undefined, 'Beer') // 'Mr. Alfonso Beer' - * faker.name.fullName(undefined, undefined, 'male') // 'Fernando Schaefer' + * faker.name.fullName({ firstName: 'Joann' }) // 'Joann Osinski' + * faker.name.fullName({ firstName: 'Marcella', sex: 'female' }) // 'Mrs. Marcella Huels' + * faker.name.fullName({ lastName: 'Beer' }) // 'Mr. Alfonso Beer' + * faker.name.fullName({ sex: 'male' }) // 'Fernando Schaefer' */ fullName( options: { firstName?: string; lastName?: string; gender?: GenderType; + sex?: SexType; } = {} ): string { const { - gender = this.faker.helpers.arrayElement(['female', 'male']), - firstName = this.firstName(gender), - lastName = this.lastName(gender), + gender, + sex = gender || this.faker.helpers.arrayElement([Sex.Female, Sex.Male]), + firstName = this.firstName(sex), + lastName = this.lastName(sex), } = options; + if (gender) { + deprecated({ + deprecated: `faker.name.fullName({ gender: '...' })`, + proposed: `faker.name.fullName({ sex: '...' })`, + since: '7.4', + until: '8.0', + }); + } + const nameParts: string[] = []; - const prefix = this.faker.helpers.maybe(() => this.prefix(gender), { + const prefix = this.faker.helpers.maybe(() => this.prefix(sex), { probability: 0.125, }); + if (prefix) { nameParts.push(prefix); } @@ -208,13 +236,12 @@ export class Name { const suffix = this.faker.helpers.maybe(() => this.suffix(), { probability: 0.125, }); + if (suffix) { nameParts.push(suffix); } - const fullName = nameParts.join(' '); - - return fullName; + return nameParts.join(' '); } /** @@ -239,18 +266,17 @@ export class Name { /** * Returns a random name prefix. * - * @param gender The optional gender to use. - * Can be either `'female'` or `'male'`. + * @param sex The optional sex to use. Can be either `'female'` or `'male'`. * * @example * faker.name.prefix() // 'Miss' * faker.name.prefix('female') // 'Ms.' * faker.name.prefix('male') // 'Mr.' */ - prefix(gender?: GenderType): string { + prefix(sex?: SexType): string { const { prefix, female_prefix, male_prefix } = this.faker.definitions.name; - return selectDefinition(this.faker, gender, { + return selectDefinition(this.faker, sex, { generic: prefix, female: female_prefix, male: male_prefix, diff --git a/src/modules/phone/index.ts b/src/modules/phone/index.ts index 08da0821a17..683883d118a 100644 --- a/src/modules/phone/index.ts +++ b/src/modules/phone/index.ts @@ -20,14 +20,14 @@ export class Phone { * * @param format Format of the phone number. Defaults to a random phone number format. * - * @see faker.phone.number + * @see faker.phone.number() * * @example * faker.phone.phoneNumber() // '961-770-7727' * faker.phone.phoneNumber('501-###-###') // '501-039-841' * faker.phone.phoneNumber('+48 91 ### ## ##') // '+48 91 463 61 70' * - * @deprecated + * @deprecated Use faker.phone.number() instead. */ phoneNumber(format?: string): string { deprecated({ @@ -63,8 +63,8 @@ export class Phone { * * @param phoneFormatsArrayIndex Index in the `faker.definitions.phone_number.formats` array. Defaults to `0`. * - * @see faker.phone.phoneNumber - * @see faker.helpers.replaceSymbolWithNumber + * @see faker.phone.phoneNumber() + * @see faker.helpers.replaceSymbolWithNumber() * * @example * faker.phone.phoneNumberFormat() // '943-627-0355' @@ -89,8 +89,8 @@ export class Phone { /** * Returns a random phone number format. * - * @see faker.phone.phoneNumber - * @see faker.definitions.phone_number.formats + * @see faker.phone.phoneNumber() + * @see faker.definitions.phone_number.formats() * * @example * faker.phone.phoneFormats() // '!##.!##.####' diff --git a/src/modules/random/index.ts b/src/modules/random/index.ts index 3071e33e825..94bdcda13aa 100644 --- a/src/modules/random/index.ts +++ b/src/modules/random/index.ts @@ -129,7 +129,6 @@ export class Random { this.faker.company.bsAdjective, this.faker.company.bsBuzz, this.faker.company.bsNoun, - this.faker.address.streetSuffix, this.faker.address.county, this.faker.address.country, this.faker.address.state, diff --git a/src/modules/system/index.ts b/src/modules/system/index.ts index 77be5a8267c..46a12b19156 100644 --- a/src/modules/system/index.ts +++ b/src/modules/system/index.ts @@ -14,6 +14,14 @@ const commonMimeTypes = [ 'text/html', ]; +const commonInterfaceTypes = ['en', 'wl', 'ww'] as const; +const commonInterfaceSchemas = { + index: 'o', + slot: 's', + mac: 'x', + pci: 'p', +} as const; + /** * Generates fake data for many computer systems properties. */ @@ -195,4 +203,65 @@ export class System { this.faker.datatype.number(9), ].join('.'); } + + /** + * Returns a random [network interface](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-understanding_the_predictable_network_interface_device_names). + * + * @param options The options to use. Defaults to `{}`. + * @param options.interfaceType The interface type. Can be one of `en`, `wl`, `ww`. + * @param options.interfaceSchema The interface schema. Can be one of `index`, `slot`, `mac`, `pci`. + * + * @example + * faker.system.networkInterface() // 'enp0s3' + * faker.system.networkInterface({ interfaceType: 'wl' }) // 'wlo1' + * faker.system.networkInterface({ interfaceSchema: 'mac' }) // 'enx000c29c00000' + * faker.system.networkInterface({ interfaceType: 'en', interfaceSchema: 'pci' }) // 'enp5s0f1d0' + */ + networkInterface( + options: { + interfaceType?: typeof commonInterfaceTypes[number]; + interfaceSchema?: keyof typeof commonInterfaceSchemas; + } = {} + ): string { + const { + interfaceType = this.faker.helpers.arrayElement(commonInterfaceTypes), + interfaceSchema = this.faker.helpers.objectKey(commonInterfaceSchemas), + } = options; + + let suffix: string; + let prefix = ''; + switch (interfaceSchema) { + case 'index': + suffix = this.faker.datatype.number(9).toString(); + break; + case 'slot': + suffix = `${this.faker.datatype.number(9)}${ + this.faker.helpers.maybe(() => `f${this.faker.datatype.number(9)}`) ?? + '' + }${ + this.faker.helpers.maybe(() => `d${this.faker.datatype.number(9)}`) ?? + '' + }`; + break; + case 'mac': + suffix = this.faker.internet.mac(''); + break; + case 'pci': + prefix = + this.faker.helpers.maybe(() => `P${this.faker.datatype.number(9)}`) ?? + ''; + suffix = `${this.faker.datatype.number(9)}s${this.faker.datatype.number( + 9 + )}${ + this.faker.helpers.maybe(() => `f${this.faker.datatype.number(9)}`) ?? + '' + }${ + this.faker.helpers.maybe(() => `d${this.faker.datatype.number(9)}`) ?? + '' + }`; + break; + } + + return `${prefix}${interfaceType}${commonInterfaceSchemas[interfaceSchema]}${suffix}`; + } } diff --git a/test/__snapshots__/animal.spec.ts.snap b/test/__snapshots__/animal.spec.ts.snap index 70a079891d5..8035add75fe 100644 --- a/test/__snapshots__/animal.spec.ts.snap +++ b/test/__snapshots__/animal.spec.ts.snap @@ -24,6 +24,8 @@ exports[`animal > 42 > lion 1`] = `"West African Lion"`; exports[`animal > 42 > rabbit 1`] = `"English Spot"`; +exports[`animal > 42 > rodent 1`] = `"Famatina chinchilla rat"`; + exports[`animal > 42 > snake 1`] = `"Grey-banded kingsnake"`; exports[`animal > 42 > type 1`] = `"lion"`; @@ -52,6 +54,8 @@ exports[`animal > 1211 > lion 1`] = `"Cape lion"`; exports[`animal > 1211 > rabbit 1`] = `"Silver Marten"`; +exports[`animal > 1211 > rodent 1`] = `"Strong tuco-tuco"`; + exports[`animal > 1211 > snake 1`] = `"Tiger pit viper"`; exports[`animal > 1211 > type 1`] = `"horse"`; @@ -80,6 +84,8 @@ exports[`animal > 1337 > lion 1`] = `"Barbary Lion"`; exports[`animal > 1337 > rabbit 1`] = `"Cinnamon"`; +exports[`animal > 1337 > rodent 1`] = `"Crested porcupine"`; + exports[`animal > 1337 > snake 1`] = `"Fierce snake"`; exports[`animal > 1337 > type 1`] = `"bear"`; diff --git a/test/__snapshots__/finance.spec.ts.snap b/test/__snapshots__/finance.spec.ts.snap index f45679f49bf..1e7486db53e 100644 --- a/test/__snapshots__/finance.spec.ts.snap +++ b/test/__snapshots__/finance.spec.ts.snap @@ -16,7 +16,7 @@ exports[`finance > 42 > amount > with min 1`] = `"380.79"`; exports[`finance > 42 > amount > with min and max and dec and symbol 1`] = `"$24.98160"`; -exports[`finance > 42 > bic 1`] = `"UYEOSCP1514"`; +exports[`finance > 42 > bic 1`] = `"JUYEPSSLXXX"`; exports[`finance > 42 > bitcoinAddress 1`] = `"3XbJMAAara64sSkA9HD24YHQWd1b"`; @@ -80,7 +80,7 @@ exports[`finance > 1211 > amount > with min 1`] = `"929.24"`; exports[`finance > 1211 > amount > with min and max and dec and symbol 1`] = `"$47.14081"`; -exports[`finance > 1211 > bic 1`] = `"LXUEBTZ1"`; +exports[`finance > 1211 > bic 1`] = `"YLXUDE4Z"`; exports[`finance > 1211 > bitcoinAddress 1`] = `"1TMe8Z3EaFdLqmaGKP1LEEJQVriSZRZdsA"`; @@ -144,7 +144,7 @@ exports[`finance > 1337 > amount > with min 1`] = `"269.40"`; exports[`finance > 1337 > amount > with min and max and dec and symbol 1`] = `"$20.48098"`; -exports[`finance > 1337 > bic 1`] = `"OEFELYL1032"`; +exports[`finance > 1337 > bic 1`] = `"GOEFFIJG"`; exports[`finance > 1337 > bitcoinAddress 1`] = `"3adhxs2jewAgkYgJi7No6Cn8JZa"`; diff --git a/test/__snapshots__/helpers.spec.ts.snap b/test/__snapshots__/helpers.spec.ts.snap index d959cafe430..c79f19c886c 100644 --- a/test/__snapshots__/helpers.spec.ts.snap +++ b/test/__snapshots__/helpers.spec.ts.snap @@ -29,6 +29,10 @@ exports[`helpers > 42 > arrayElements > with array 2`] = ` ] `; +exports[`helpers > 42 > fake > with args 1`] = `"my string: Cky2eiXX/J"`; + +exports[`helpers > 42 > fake > with plain string 1`] = `"my test string"`; + exports[`helpers > 42 > maybe > with only value 1`] = `"Hello World!"`; exports[`helpers > 42 > maybe > with value and probability 1`] = `undefined`; @@ -139,6 +143,10 @@ exports[`helpers > 1211 > arrayElements > with array 2`] = ` ] `; +exports[`helpers > 1211 > fake > with args 1`] = `"my string: wKti5-}$_/"`; + +exports[`helpers > 1211 > fake > with plain string 1`] = `"my test string"`; + exports[`helpers > 1211 > maybe > with only value 1`] = `undefined`; exports[`helpers > 1211 > maybe > with value and probability 1`] = `undefined`; @@ -239,6 +247,10 @@ exports[`helpers > 1337 > arrayElements > with array 2`] = ` ] `; +exports[`helpers > 1337 > fake > with args 1`] = `"my string: 9U/4:SK$>6"`; + +exports[`helpers > 1337 > fake > with plain string 1`] = `"my test string"`; + exports[`helpers > 1337 > maybe > with only value 1`] = `"Hello World!"`; exports[`helpers > 1337 > maybe > with value and probability 1`] = `undefined`; diff --git a/test/__snapshots__/internet.spec.ts.snap b/test/__snapshots__/internet.spec.ts.snap index 75f60a8163a..bf5e94a4bf2 100644 --- a/test/__snapshots__/internet.spec.ts.snap +++ b/test/__snapshots__/internet.spec.ts.snap @@ -6,11 +6,11 @@ exports[`internet > 42 > color > noArgs 1`] = `"#30667a"`; exports[`internet > 42 > color > with color base 1`] = `"#6298ac"`; -exports[`internet > 42 > domainName 1`] = `"harmonious-shift.org"`; +exports[`internet > 42 > domainName 1`] = `"harmonious-shin.org"`; exports[`internet > 42 > domainSuffix 1`] = `"info"`; -exports[`internet > 42 > domainWord 1`] = `"harmonious-shift"`; +exports[`internet > 42 > domainWord 1`] = `"harmonious-shin"`; exports[`internet > 42 > email > noArgs 1`] = `"Peyton73@yahoo.com"`; @@ -52,7 +52,7 @@ exports[`internet > 42 > port 1`] = `24545`; exports[`internet > 42 > protocol 1`] = `"http"`; -exports[`internet > 42 > url 1`] = `"http://stable-vehicle.biz"`; +exports[`internet > 42 > url 1`] = `"http://stable-veil.biz"`; exports[`internet > 42 > userAgent 1`] = `"Mozilla/5.0 (Windows; U; Windows NT 6.2) AppleWebKit/538.0.2 (KHTML, like Gecko) Chrome/29.0.815.0 Safari/538.0.2"`; @@ -66,11 +66,11 @@ exports[`internet > 1211 > color > noArgs 1`] = `"#773a72"`; exports[`internet > 1211 > color > with color base 1`] = `"#a96ca4"`; -exports[`internet > 1211 > domainName 1`] = `"verifiable-infection.org"`; +exports[`internet > 1211 > domainName 1`] = `"verifiable-infix.org"`; exports[`internet > 1211 > domainSuffix 1`] = `"org"`; -exports[`internet > 1211 > domainWord 1`] = `"verifiable-infection"`; +exports[`internet > 1211 > domainWord 1`] = `"verifiable-infix"`; exports[`internet > 1211 > email > noArgs 1`] = `"Jadon.Trantow12@hotmail.com"`; @@ -112,7 +112,7 @@ exports[`internet > 1211 > port 1`] = `60851`; exports[`internet > 1211 > protocol 1`] = `"https"`; -exports[`internet > 1211 > url 1`] = `"https://joyous-temperature.net"`; +exports[`internet > 1211 > url 1`] = `"https://joyous-temple.net"`; exports[`internet > 1211 > userAgent 1`] = `"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6 rv:3.0; PT) AppleWebKit/538.2.0 (KHTML, like Gecko) Version/4.1.0 Safari/538.2.0"`; @@ -126,11 +126,11 @@ exports[`internet > 1337 > color > noArgs 1`] = `"#214814"`; exports[`internet > 1337 > color > with color base 1`] = `"#537a46"`; -exports[`internet > 1337 > domainName 1`] = `"fabulous-might.com"`; +exports[`internet > 1337 > domainName 1`] = `"fabulous-migration.com"`; exports[`internet > 1337 > domainSuffix 1`] = `"biz"`; -exports[`internet > 1337 > domainWord 1`] = `"fabulous-might"`; +exports[`internet > 1337 > domainWord 1`] = `"fabulous-migration"`; exports[`internet > 1337 > email > noArgs 1`] = `"Keith27@gmail.com"`; @@ -172,7 +172,7 @@ exports[`internet > 1337 > port 1`] = `17172`; exports[`internet > 1337 > protocol 1`] = `"http"`; -exports[`internet > 1337 > url 1`] = `"http://neat-chopsticks.biz"`; +exports[`internet > 1337 > url 1`] = `"http://neat-chopstick.biz"`; exports[`internet > 1337 > userAgent 1`] = `"Mozilla/5.0 (Windows; U; Windows NT 6.1) AppleWebKit/532.0.0 (KHTML, like Gecko) Chrome/13.0.832.0 Safari/532.0.0"`; diff --git a/test/__snapshots__/name.spec.ts.snap b/test/__snapshots__/name.spec.ts.snap index dc56d58ea46..39043915c7c 100644 --- a/test/__snapshots__/name.spec.ts.snap +++ b/test/__snapshots__/name.spec.ts.snap @@ -14,7 +14,9 @@ exports[`name > 42 > firstName > with gender 1`] = `"Glen"`; exports[`name > 42 > fullName > noArgs 1`] = `"Sadie Wiegand"`; -exports[`name > 42 > fullName > with all 1`] = `"John Doe"`; +exports[`name > 42 > fullName > with all (gender) 1`] = `"John Doe"`; + +exports[`name > 42 > fullName > with all (sex) 1`] = `"John Doe"`; exports[`name > 42 > fullName > with firstName 1`] = `"John Schinner"`; @@ -22,6 +24,8 @@ exports[`name > 42 > fullName > with gender 1`] = `"Melanie Schinner"`; exports[`name > 42 > fullName > with lastName 1`] = `"Sadie Doe"`; +exports[`name > 42 > fullName > with sex 1`] = `"Melanie Schinner"`; + exports[`name > 42 > gender > noArgs 1`] = `"Gender nonconforming"`; exports[`name > 42 > gender > with gender 1`] = `"Female"`; @@ -64,7 +68,9 @@ exports[`name > 1211 > firstName > with gender 1`] = `"Percy"`; exports[`name > 1211 > fullName > noArgs 1`] = `"Claude Trantow"`; -exports[`name > 1211 > fullName > with all 1`] = `"John Doe"`; +exports[`name > 1211 > fullName > with all (gender) 1`] = `"John Doe"`; + +exports[`name > 1211 > fullName > with all (sex) 1`] = `"John Doe"`; exports[`name > 1211 > fullName > with firstName 1`] = `"John Koch"`; @@ -72,6 +78,8 @@ exports[`name > 1211 > fullName > with gender 1`] = `"Patti Koch"`; exports[`name > 1211 > fullName > with lastName 1`] = `"Claude Doe"`; +exports[`name > 1211 > fullName > with sex 1`] = `"Patti Koch"`; + exports[`name > 1211 > gender > noArgs 1`] = `"Trigender"`; exports[`name > 1211 > gender > with gender 1`] = `"Male"`; @@ -114,7 +122,9 @@ exports[`name > 1337 > firstName > with gender 1`] = `"Ray"`; exports[`name > 1337 > fullName > noArgs 1`] = `"Leona Cronin"`; -exports[`name > 1337 > fullName > with all 1`] = `"John Doe"`; +exports[`name > 1337 > fullName > with all (gender) 1`] = `"John Doe"`; + +exports[`name > 1337 > fullName > with all (sex) 1`] = `"John Doe"`; exports[`name > 1337 > fullName > with firstName 1`] = `"John Macejkovic"`; @@ -122,6 +132,8 @@ exports[`name > 1337 > fullName > with gender 1`] = `"Esther Macejkovic"`; exports[`name > 1337 > fullName > with lastName 1`] = `"Leona Doe"`; +exports[`name > 1337 > fullName > with sex 1`] = `"Esther Macejkovic"`; + exports[`name > 1337 > gender > noArgs 1`] = `"Demigender"`; exports[`name > 1337 > gender > with gender 1`] = `"Female"`; diff --git a/test/__snapshots__/random.spec.ts.snap b/test/__snapshots__/random.spec.ts.snap index b664767a423..fe0e8969f48 100644 --- a/test/__snapshots__/random.spec.ts.snap +++ b/test/__snapshots__/random.spec.ts.snap @@ -14,11 +14,11 @@ exports[`random > 42 > numeric > noArgs 1`] = `"4"`; exports[`random > 42 > numeric > withLength 1`] = `"47917"`; -exports[`random > 42 > word 1`] = `"extend"`; +exports[`random > 42 > word 1`] = `"impactful"`; exports[`random > 42 > words > noArgs 1`] = `"mobile Fish"`; -exports[`random > 42 > words > withLength 1`] = `"extend Directives application Home Dam"`; +exports[`random > 42 > words > withLength 1`] = `"impactful Directives transmit Home initiatives"`; exports[`random > 1211 > alpha > noArgs 1`] = `"y"`; @@ -36,9 +36,9 @@ exports[`random > 1211 > numeric > withLength 1`] = `"94872"`; exports[`random > 1211 > word 1`] = `"Division"`; -exports[`random > 1211 > words > noArgs 1`] = `"Turnpike Frozen Handcrafted"`; +exports[`random > 1211 > words > noArgs 1`] = `"functionalities Frozen Baby"`; -exports[`random > 1211 > words > withLength 1`] = `"Division Forward Supervisor Peso ivory"`; +exports[`random > 1211 > words > withLength 1`] = `"Division Forward purple Supervisor Peso"`; exports[`random > 1337 > alpha > noArgs 1`] = `"g"`; @@ -54,8 +54,8 @@ exports[`random > 1337 > numeric > noArgs 1`] = `"3"`; exports[`random > 1337 > numeric > withLength 1`] = `"35122"`; -exports[`random > 1337 > word 1`] = `"leading"`; +exports[`random > 1337 > word 1`] = `"Organic"`; exports[`random > 1337 > words > noArgs 1`] = `"Delaware"`; -exports[`random > 1337 > words > withLength 1`] = `"leading black Kiribati Garden Indiana"`; +exports[`random > 1337 > words > withLength 1`] = `"Organic Bike interactive core Montenegro"`; diff --git a/test/__snapshots__/system.spec.ts.snap b/test/__snapshots__/system.spec.ts.snap index eb08bcc75e8..f3eda41ad97 100644 --- a/test/__snapshots__/system.spec.ts.snap +++ b/test/__snapshots__/system.spec.ts.snap @@ -18,19 +18,61 @@ exports[`system > 42 > fileName > noArgs 1`] = `"mobile_fish.jxsc"`; exports[`system > 42 > fileName > with extensionCount 1`] = `"mobile_fish.jxsc.jardiff"`; -exports[`system > 42 > filePath 1`] = `"/opt/bin/directives_application_home.ptid"`; +exports[`system > 42 > filePath 1`] = `"/opt/bin/directives_transmit_home.ptid"`; exports[`system > 42 > fileType 1`] = `"image"`; exports[`system > 42 > mimeType 1`] = `"application/vnd.ibm.rights-management"`; +exports[`system > 42 > networkInterface > noArgs 1`] = `"wlp1s7"`; + +exports[`system > 42 > networkInterface > with {"interfaceSchema":"index"} 1`] = `"wlo7"`; + +exports[`system > 42 > networkInterface > with {"interfaceSchema":"mac"} 1`] = `"wlxcf2bc9927210"`; + +exports[`system > 42 > networkInterface > with {"interfaceSchema":"pci"} 1`] = `"wlp9s1"`; + +exports[`system > 42 > networkInterface > with {"interfaceSchema":"slot"} 1`] = `"wls7d7"`; + +exports[`system > 42 > networkInterface > with {"interfaceType":"en","interfaceSchema":"index"} 1`] = `"eno3"`; + +exports[`system > 42 > networkInterface > with {"interfaceType":"en","interfaceSchema":"mac"} 1`] = `"enx5cf2bc992721"`; + +exports[`system > 42 > networkInterface > with {"interfaceType":"en","interfaceSchema":"pci"} 1`] = `"P7enp9s1"`; + +exports[`system > 42 > networkInterface > with {"interfaceType":"en","interfaceSchema":"slot"} 1`] = `"ens3"`; + +exports[`system > 42 > networkInterface > with {"interfaceType":"en"} 1`] = `"ens7d7"`; + +exports[`system > 42 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"index"} 1`] = `"wlo3"`; + +exports[`system > 42 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"mac"} 1`] = `"wlx5cf2bc992721"`; + +exports[`system > 42 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"pci"} 1`] = `"P7wlp9s1"`; + +exports[`system > 42 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"slot"} 1`] = `"wls3"`; + +exports[`system > 42 > networkInterface > with {"interfaceType":"wl"} 1`] = `"wls7d7"`; + +exports[`system > 42 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"index"} 1`] = `"wwo3"`; + +exports[`system > 42 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"mac"} 1`] = `"wwx5cf2bc992721"`; + +exports[`system > 42 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"pci"} 1`] = `"P7wwp9s1"`; + +exports[`system > 42 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"slot"} 1`] = `"wws3"`; + +exports[`system > 42 > networkInterface > with {"interfaceType":"ww"} 1`] = `"wws7d7"`; + +exports[`system > 42 > networkInterface > with {} 1`] = `"wlp1s7"`; + exports[`system > 42 > semver 1`] = `"3.7.9"`; exports[`system > 1211 > commonFileExt 1`] = `"htm"`; -exports[`system > 1211 > commonFileName > noArgs 1`] = `"turnpike_frozen_handcrafted.mp4v"`; +exports[`system > 1211 > commonFileName > noArgs 1`] = `"functionalities_frozen_baby.m2a"`; -exports[`system > 1211 > commonFileName > with extension 1`] = `"turnpike_frozen_handcrafted.ext"`; +exports[`system > 1211 > commonFileName > with extension 1`] = `"functionalities_frozen_baby.ext"`; exports[`system > 1211 > commonFileType 1`] = `"application"`; @@ -40,16 +82,58 @@ exports[`system > 1211 > fileExt > noArgs 1`] = `"dic"`; exports[`system > 1211 > fileExt > with mimeType 1`] = `"map"`; -exports[`system > 1211 > fileName > noArgs 1`] = `"turnpike_frozen_handcrafted.heifs"`; +exports[`system > 1211 > fileName > noArgs 1`] = `"functionalities_frozen_baby.tsd"`; -exports[`system > 1211 > fileName > with extensionCount 1`] = `"turnpike_frozen_handcrafted.heifs.oth"`; +exports[`system > 1211 > fileName > with extensionCount 1`] = `"functionalities_frozen_baby.tsd.xml"`; -exports[`system > 1211 > filePath 1`] = `"/var/log/forward_supervisor.z2"`; +exports[`system > 1211 > filePath 1`] = `"/var/log/forward_purple.avi"`; exports[`system > 1211 > fileType 1`] = `"x-shader"`; exports[`system > 1211 > mimeType 1`] = `"text/vnd.dmclientscript"`; +exports[`system > 1211 > networkInterface > noArgs 1`] = `"wws8d1"`; + +exports[`system > 1211 > networkInterface > with {"interfaceSchema":"index"} 1`] = `"wwo4"`; + +exports[`system > 1211 > networkInterface > with {"interfaceSchema":"mac"} 1`] = `"wwx7ec32f0a2a3c"`; + +exports[`system > 1211 > networkInterface > with {"interfaceSchema":"pci"} 1`] = `"P8wwp7s2f9d6"`; + +exports[`system > 1211 > networkInterface > with {"interfaceSchema":"slot"} 1`] = `"wws4"`; + +exports[`system > 1211 > networkInterface > with {"interfaceType":"en","interfaceSchema":"index"} 1`] = `"eno9"`; + +exports[`system > 1211 > networkInterface > with {"interfaceType":"en","interfaceSchema":"mac"} 1`] = `"enxe7ec32f0a2a3"`; + +exports[`system > 1211 > networkInterface > with {"interfaceType":"en","interfaceSchema":"pci"} 1`] = `"enp4s8d1"`; + +exports[`system > 1211 > networkInterface > with {"interfaceType":"en","interfaceSchema":"slot"} 1`] = `"ens9f8"`; + +exports[`system > 1211 > networkInterface > with {"interfaceType":"en"} 1`] = `"P8enp7s2f9d6"`; + +exports[`system > 1211 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"index"} 1`] = `"wlo9"`; + +exports[`system > 1211 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"mac"} 1`] = `"wlxe7ec32f0a2a3"`; + +exports[`system > 1211 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"pci"} 1`] = `"wlp4s8d1"`; + +exports[`system > 1211 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"slot"} 1`] = `"wls9f8"`; + +exports[`system > 1211 > networkInterface > with {"interfaceType":"wl"} 1`] = `"P8wlp7s2f9d6"`; + +exports[`system > 1211 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"index"} 1`] = `"wwo9"`; + +exports[`system > 1211 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"mac"} 1`] = `"wwxe7ec32f0a2a3"`; + +exports[`system > 1211 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"pci"} 1`] = `"wwp4s8d1"`; + +exports[`system > 1211 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"slot"} 1`] = `"wws9f8"`; + +exports[`system > 1211 > networkInterface > with {"interfaceType":"ww"} 1`] = `"P8wwp7s2f9d6"`; + +exports[`system > 1211 > networkInterface > with {} 1`] = `"wws8d1"`; + exports[`system > 1211 > semver 1`] = `"9.4.8"`; exports[`system > 1337 > commonFileExt 1`] = `"wav"`; @@ -76,6 +160,48 @@ exports[`system > 1337 > fileType 1`] = `"font"`; exports[`system > 1337 > mimeType 1`] = `"application/vnd.chipnuts.karaoke-mmd"`; +exports[`system > 1337 > networkInterface > noArgs 1`] = `"enx234870538945"`; + +exports[`system > 1337 > networkInterface > with {"interfaceSchema":"index"} 1`] = `"eno5"`; + +exports[`system > 1337 > networkInterface > with {"interfaceSchema":"mac"} 1`] = `"enx823487053894"`; + +exports[`system > 1337 > networkInterface > with {"interfaceSchema":"pci"} 1`] = `"enp1s2f5d0"`; + +exports[`system > 1337 > networkInterface > with {"interfaceSchema":"slot"} 1`] = `"ens5f2d5"`; + +exports[`system > 1337 > networkInterface > with {"interfaceType":"en","interfaceSchema":"index"} 1`] = `"eno2"`; + +exports[`system > 1337 > networkInterface > with {"interfaceType":"en","interfaceSchema":"mac"} 1`] = `"enx482348705389"`; + +exports[`system > 1337 > networkInterface > with {"interfaceType":"en","interfaceSchema":"pci"} 1`] = `"P5enp1s2f5d0"`; + +exports[`system > 1337 > networkInterface > with {"interfaceType":"en","interfaceSchema":"slot"} 1`] = `"ens2d2"`; + +exports[`system > 1337 > networkInterface > with {"interfaceType":"en"} 1`] = `"ens5f2d5"`; + +exports[`system > 1337 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"index"} 1`] = `"wlo2"`; + +exports[`system > 1337 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"mac"} 1`] = `"wlx482348705389"`; + +exports[`system > 1337 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"pci"} 1`] = `"P5wlp1s2f5d0"`; + +exports[`system > 1337 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"slot"} 1`] = `"wls2d2"`; + +exports[`system > 1337 > networkInterface > with {"interfaceType":"wl"} 1`] = `"wls5f2d5"`; + +exports[`system > 1337 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"index"} 1`] = `"wwo2"`; + +exports[`system > 1337 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"mac"} 1`] = `"wwx482348705389"`; + +exports[`system > 1337 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"pci"} 1`] = `"P5wwp1s2f5d0"`; + +exports[`system > 1337 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"slot"} 1`] = `"wws2d2"`; + +exports[`system > 1337 > networkInterface > with {"interfaceType":"ww"} 1`] = `"wws5f2d5"`; + +exports[`system > 1337 > networkInterface > with {} 1`] = `"enx234870538945"`; + exports[`system > 1337 > semver 1`] = `"2.5.1"`; exports[`system > seed: 42 > commonFileExt() 1`] = `"png"`; @@ -90,17 +216,19 @@ exports[`system > seed: 42 > fileExt() 1`] = `"lrm"`; exports[`system > seed: 42 > fileName() 1`] = `"mobile_fish.jxsc"`; -exports[`system > seed: 42 > filePath() 1`] = `"/opt/bin/directives_application_home.ptid"`; +exports[`system > seed: 42 > filePath() 1`] = `"/opt/bin/directives_transmit_home.ptid"`; exports[`system > seed: 42 > fileType() 1`] = `"image"`; exports[`system > seed: 42 > mimeType() 1`] = `"application/vnd.ibm.rights-management"`; +exports[`system > seed: 42 > networkInterface() 1`] = `"wlp1s7"`; + exports[`system > seed: 42 > semver() 1`] = `"3.7.9"`; exports[`system > seed: 1211 > commonFileExt() 1`] = `"htm"`; -exports[`system > seed: 1211 > commonFileName() 1`] = `"turnpike_frozen_handcrafted.mp4v"`; +exports[`system > seed: 1211 > commonFileName() 1`] = `"functionalities_frozen_baby.m2a"`; exports[`system > seed: 1211 > commonFileType() 1`] = `"application"`; @@ -108,14 +236,16 @@ exports[`system > seed: 1211 > directoryPath() 1`] = `"/var/log"`; exports[`system > seed: 1211 > fileExt() 1`] = `"dic"`; -exports[`system > seed: 1211 > fileName() 1`] = `"turnpike_frozen_handcrafted.heifs"`; +exports[`system > seed: 1211 > fileName() 1`] = `"functionalities_frozen_baby.tsd"`; -exports[`system > seed: 1211 > filePath() 1`] = `"/var/log/forward_supervisor.z2"`; +exports[`system > seed: 1211 > filePath() 1`] = `"/var/log/forward_purple.avi"`; exports[`system > seed: 1211 > fileType() 1`] = `"x-shader"`; exports[`system > seed: 1211 > mimeType() 1`] = `"text/vnd.dmclientscript"`; +exports[`system > seed: 1211 > networkInterface() 1`] = `"wws8d1"`; + exports[`system > seed: 1211 > semver() 1`] = `"9.4.8"`; exports[`system > seed: 1337 > commonFileExt() 1`] = `"wav"`; @@ -136,4 +266,6 @@ exports[`system > seed: 1337 > fileType() 1`] = `"font"`; exports[`system > seed: 1337 > mimeType() 1`] = `"application/vnd.chipnuts.karaoke-mmd"`; +exports[`system > seed: 1337 > networkInterface() 1`] = `"enx234870538945"`; + exports[`system > seed: 1337 > semver() 1`] = `"2.5.1"`; diff --git a/test/__snapshots__/word.spec.ts.snap b/test/__snapshots__/word.spec.ts.snap index 76ca9d16375..6a3c75754c2 100644 --- a/test/__snapshots__/word.spec.ts.snap +++ b/test/__snapshots__/word.spec.ts.snap @@ -12,11 +12,11 @@ exports[`word > 42 > adverb > with length = 10 1`] = `"generously"`; exports[`word > 42 > adverb > with length = 20 1`] = `"jealously"`; -exports[`word > 42 > conjunction > noArgs 1`] = `"however"`; +exports[`word > 42 > conjunction > noArgs 1`] = `"instead"`; -exports[`word > 42 > conjunction > with length = 10 1`] = `"as much as"`; +exports[`word > 42 > conjunction > with length = 10 1`] = `"instead"`; -exports[`word > 42 > conjunction > with length = 20 1`] = `"however"`; +exports[`word > 42 > conjunction > with length = 20 1`] = `"instead"`; exports[`word > 42 > interjection > noArgs 1`] = `"yahoo"`; @@ -24,11 +24,11 @@ exports[`word > 42 > interjection > with length = 10 1`] = `"yahoo"`; exports[`word > 42 > interjection > with length = 20 1`] = `"yahoo"`; -exports[`word > 42 > noun > noArgs 1`] = `"gale"`; +exports[`word > 42 > noun > noArgs 1`] = `"galley"`; -exports[`word > 42 > noun > with length = 10 1`] = `"exposition"`; +exports[`word > 42 > noun > with length = 10 1`] = `"extinction"`; -exports[`word > 42 > noun > with length = 20 1`] = `"gale"`; +exports[`word > 42 > noun > with length = 20 1`] = `"galley"`; exports[`word > 42 > preposition > noArgs 1`] = `"concerning"`; @@ -54,11 +54,11 @@ exports[`word > 1211 > adverb > with length = 10 1`] = `"unbearably"`; exports[`word > 1211 > adverb > with length = 20 1`] = `"viciously"`; -exports[`word > 1211 > conjunction > noArgs 1`] = `"whereas"`; +exports[`word > 1211 > conjunction > noArgs 1`] = `"whoever"`; -exports[`word > 1211 > conjunction > with length = 10 1`] = `"as soon as"`; +exports[`word > 1211 > conjunction > with length = 10 1`] = `"whoever"`; -exports[`word > 1211 > conjunction > with length = 20 1`] = `"whereas"`; +exports[`word > 1211 > conjunction > with length = 20 1`] = `"whoever"`; exports[`word > 1211 > interjection > noArgs 1`] = `"er"`; @@ -66,11 +66,11 @@ exports[`word > 1211 > interjection > with length = 10 1`] = `"er"`; exports[`word > 1211 > interjection > with length = 20 1`] = `"er"`; -exports[`word > 1211 > noun > noArgs 1`] = `"trick"`; +exports[`word > 1211 > noun > noArgs 1`] = `"trigger"`; exports[`word > 1211 > noun > with length = 10 1`] = `"trafficker"`; -exports[`word > 1211 > noun > with length = 20 1`] = `"trick"`; +exports[`word > 1211 > noun > with length = 20 1`] = `"trigger"`; exports[`word > 1211 > preposition > noArgs 1`] = `"upon"`; @@ -96,11 +96,11 @@ exports[`word > 1337 > adverb > with length = 10 1`] = `"enormously"`; exports[`word > 1337 > adverb > with length = 20 1`] = `"frankly"`; -exports[`word > 1337 > conjunction > noArgs 1`] = `"even if"`; +exports[`word > 1337 > conjunction > noArgs 1`] = `"how"`; -exports[`word > 1337 > conjunction > with length = 10 1`] = `"as long as"`; +exports[`word > 1337 > conjunction > with length = 10 1`] = `"how"`; -exports[`word > 1337 > conjunction > with length = 20 1`] = `"even if"`; +exports[`word > 1337 > conjunction > with length = 20 1`] = `"how"`; exports[`word > 1337 > interjection > noArgs 1`] = `"ew"`; @@ -110,7 +110,7 @@ exports[`word > 1337 > interjection > with length = 20 1`] = `"ew"`; exports[`word > 1337 > noun > noArgs 1`] = `"digit"`; -exports[`word > 1337 > noun > with length = 10 1`] = `"depressive"`; +exports[`word > 1337 > noun > with length = 10 1`] = `"depression"`; exports[`word > 1337 > noun > with length = 20 1`] = `"digit"`; diff --git a/test/all_functional.spec.ts b/test/all_functional.spec.ts index b391b61e86f..f857b84c6de 100644 --- a/test/all_functional.spec.ts +++ b/test/all_functional.spec.ts @@ -99,7 +99,7 @@ describe('functional tests', () => { } }); -describe('faker.fake functional tests', () => { +describe('faker.helpers.fake functional tests', () => { for (const locale in faker.locales) { describe(locale, () => { Object.keys(modules).forEach((module) => { @@ -109,7 +109,7 @@ describe('faker.fake functional tests', () => { faker.locale = locale; // TODO ST-DDT 2022-03-28: Use random seed once there are no more failures faker.seed(1); - const result = faker.fake(`{{${module}.${meth}}}`); + const result = faker.helpers.fake(`{{${module}.${meth}}}`); expect(result).toBeTypeOf('string'); }); diff --git a/test/animal.spec.ts b/test/animal.spec.ts index c21d67768cf..26c01e3132b 100644 --- a/test/animal.spec.ts +++ b/test/animal.spec.ts @@ -17,6 +17,7 @@ const functionNames = [ 'insect', 'lion', 'rabbit', + 'rodent', 'snake', 'type', ] as const; diff --git a/test/finance.spec.ts b/test/finance.spec.ts index b1aed4ad712..afc671a7628 100644 --- a/test/finance.spec.ts +++ b/test/finance.spec.ts @@ -482,15 +482,10 @@ describe('finance', () => { describe('bic()', () => { it('should return a random yet formally correct BIC number', () => { const bic = faker.finance.bic(); - const expr = new RegExp( - `^[A-Z]{4}(${ibanLib.iso3166.join( - '|' - )})[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3})?\$`, - 'i' - ); expect(bic).toBeTypeOf('string'); - expect(bic).toMatch(expr); + expect(bic).toMatch(/^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$/); + expect(ibanLib.iso3166).toContain(bic.substring(4, 6)); }); }); diff --git a/test/helpers.spec.ts b/test/helpers.spec.ts index 6a89667f774..61d742a7118 100644 --- a/test/helpers.spec.ts +++ b/test/helpers.spec.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it } from 'vitest'; -import { faker } from '../src'; +import { faker, FakerError } from '../src'; import { luhnCheck } from '../src/modules/helpers/luhn-check'; import { seededTests } from './support/seededRuns'; @@ -86,6 +86,13 @@ describe('helpers', () => { t.describe('objectValue', (t) => { t.it('simple', { a: 1, b: 2, c: 3 }); }); + + t.describe('fake', (t) => { + t.it('with plain string', 'my test string').it( + 'with args', + 'my string: {{datatype.string}}' + ); + }); }); describe(`random seeded tests for seed ${faker.seed()}`, () => { @@ -477,6 +484,130 @@ describe('helpers', () => { expect(actual).toBeUndefined(); }); }); + + describe('fake()', () => { + it('replaces a token with a random value for a method with no parameters', () => { + const name = faker.helpers.fake('{{phone.number}}'); + expect(name).toMatch(/\d/); + }); + + it('replaces multiple tokens with random values for methods with no parameters', () => { + const name = faker.helpers.fake( + '{{helpers.arrayElement}}{{helpers.arrayElement}}{{helpers.arrayElement}}' + ); + expect(name).toMatch(/[abc]{3}/); + }); + + it('replaces a token with a random value for a methods with a simple parameter', () => { + const random = faker.helpers.fake( + '{{helpers.slugify("Will This Work")}}' + ); + expect(random).toBe('Will-This-Work'); + }); + + it('replaces a token with a random value for a method with an array parameter', () => { + const arr = ['one', 'two', 'three']; + const random = faker.helpers.fake( + '{{helpers.arrayElement(["one", "two", "three"])}}' + ); + expect(arr).toContain(random); + }); + + it('does not allow undefined parameters', () => { + expect(() => + // @ts-expect-error: The parameter is required + faker.helpers.fake() + ).toThrowError(new FakerError('string parameter is required!')); + }); + + it('does not allow invalid module name', () => { + expect(() => faker.helpers.fake('{{foo.bar}}')).toThrowError( + new FakerError(`Invalid module method or definition: foo.bar +- faker.foo.bar is not a function +- faker.definitions.foo.bar is not an array`) + ); + }); + + it('does not allow missing method name', () => { + expect(() => faker.helpers.fake('{{address}}')).toThrowError( + new FakerError(`Invalid module method or definition: address +- faker.address is not a function +- faker.definitions.address is not an array`) + ); + }); + + it('does not allow invalid method name', () => { + expect(() => faker.helpers.fake('{{address.foo}}')).toThrowError( + new FakerError(`Invalid module method or definition: address.foo +- faker.address.foo is not a function +- faker.definitions.address.foo is not an array`) + ); + }); + + it('does not allow invalid definitions data', () => { + expect(() => + faker.helpers.fake('{{finance.credit_card}}') + ).toThrowError( + new FakerError(`Invalid module method or definition: finance.credit_card +- faker.finance.credit_card is not a function +- faker.definitions.finance.credit_card is not an array`) + ); + }); + + it('should be able to return empty strings', () => { + expect(faker.helpers.fake('{{helpers.repeatString}}')).toBe(''); + }); + + it('should be able to return locale definition strings', () => { + expect(faker.definitions.cell_phone.formats).toContain( + faker.helpers.fake('{{cell_phone.formats}}') + ); + }); + + it('should be able to return locale definition strings that starts with the name of an existing module', () => { + expect(faker.definitions.address.city_name).toContain( + faker.helpers.fake('{{address.city_name}}') + ); + }); + + it('should be able to handle only {{ brackets', () => { + expect(faker.helpers.fake('{{hello')).toBe('{{hello'); + expect(faker.helpers.fake('hello{{')).toBe('hello{{'); + }); + + it('should be able to handle only }} brackets', () => { + expect(faker.helpers.fake('hello}}')).toBe('hello}}'); + expect(faker.helpers.fake('}}hello')).toBe('}}hello'); + }); + + it('should be able to handle inverted brackets', () => { + expect(faker.helpers.fake('}}hello{{')).toBe('}}hello{{'); + }); + + it('should be able to handle random }} brackets', () => { + expect(faker.helpers.fake('}}hello{{random.alpha}}')).toMatch( + /^}}hello[a-z]$/ + ); + }); + + it('should be able to handle connected brackets', () => { + expect(faker.helpers.fake('{{{random.alpha}}}')).toMatch(/^{[a-z]}$/); + }); + + it('should be able to handle empty brackets', () => { + expect(faker.helpers.fake('{{}}')).toBe('{{}}'); + }); + + it('should be able to handle special replacement patterns', () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (faker.random as any).special = () => '$&'; + + expect(faker.helpers.fake('{{random.special}}')).toBe('$&'); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + delete (faker.random as any).special; + }); + }); } }); }); diff --git a/test/name.spec.ts b/test/name.spec.ts index 92dfe0929c7..a8ef5687571 100644 --- a/test/name.spec.ts +++ b/test/name.spec.ts @@ -33,11 +33,18 @@ describe('name', () => { t.it('noArgs') .it('with firstName', { firstName: 'John' }) .it('with lastName', { lastName: 'Doe' }) - .it('with gender', { gender: 'female' }) - .it('with all', { + .it('with gender', { gender: 'female' }) // deprecated + .it('with sex', { sex: 'female' }) + .it('with all (gender)', { firstName: 'John', lastName: 'Doe', + // deprecated gender: 'female', + }) + .it('with all (sex)', { + firstName: 'John', + lastName: 'Doe', + sex: 'female', }); }); }); @@ -57,7 +64,7 @@ describe('name', () => { expect(first_name.length).toBeGreaterThan(0); }); - it('should return a gender-specific first name', () => { + it('should return a sex-specific first name', () => { let name = faker.name.firstName('female'); expect(faker.definitions.name.female_first_name).toContain(name); @@ -65,7 +72,7 @@ describe('name', () => { expect(faker.definitions.name.male_first_name).toContain(name); }); - it('should return a gender-specific first name when no gender-specific first name was defined', () => { + it('should return a sex-specific first name when no sex-specific first name was defined', () => { faker.locale = 'az'; faker.localeFallback = 'az'; @@ -90,7 +97,7 @@ describe('name', () => { expect(last_name.length).toBeGreaterThan(0); }); - it('should return a gender-specific last name', () => { + it('should return a sex-specific last name', () => { faker.locale = 'az'; let name = faker.name.lastName('female'); @@ -127,7 +134,7 @@ describe('name', () => { expect(faker.definitions.name.male_middle_name).toContain(name); }); - it('should return a gender-specific middle name', () => { + it('should return a sex-specific middle name', () => { faker.locale = 'uk'; let name = faker.name.middleName('female'); @@ -151,7 +158,7 @@ describe('name', () => { expect(fullName).toContain(' '); }); - it('should return a female gender-specific name with firstName and lastName', () => { + it('should return a female sex-specific name with firstName and lastName', () => { faker.locale = 'mk'; const female_specific = [ @@ -169,7 +176,7 @@ describe('name', () => { } }); - it('should return a male gender-specific name with firstName and lastName', () => { + it('should return a male sex-specific name with firstName and lastName', () => { faker.locale = 'mk'; const male_specific = [ @@ -187,7 +194,7 @@ describe('name', () => { } }); - it('should return a female gender-specific name with given firstName and lastName', () => { + it('should return a female sex-specific name with given firstName and lastName', () => { faker.locale = 'mk'; const male_specific = [ @@ -209,7 +216,7 @@ describe('name', () => { } }); - it('should return a male gender-specific name with given firstName and lastName', () => { + it('should return a male sex-specific name with given firstName and lastName', () => { faker.locale = 'mk'; const male_specific = [ diff --git a/test/scripts/apidoc/examplesAndDeprecations.spec.ts b/test/scripts/apidoc/examplesAndDeprecations.spec.ts index 314e72d4b42..5709189a7f0 100644 --- a/test/scripts/apidoc/examplesAndDeprecations.spec.ts +++ b/test/scripts/apidoc/examplesAndDeprecations.spec.ts @@ -6,6 +6,7 @@ import type { SpyInstance } from 'vitest'; import { afterAll, beforeEach, describe, expect, it, vi } from 'vitest'; import { extractRawExamples, + extractTagContent, isDeprecated, } from '../../../scripts/apidoc/utils'; import { faker } from '../../../src'; @@ -101,11 +102,24 @@ describe('examples and deprecations', () => { const deprecatedFlag = isDeprecated(signature); if (deprecatedFlag) { expect(consoleSpies[1]).toHaveBeenCalled(); + expect( + extractTagContent('@deprecated', signature).join(''), + '@deprecated tag without message' + ).not.toBe(''); } else { for (const spy of consoleSpies) { expect(spy).not.toHaveBeenCalled(); } } + + // Verify @see tag + extractTagContent('@see', signature).forEach((link) => { + if (link.startsWith('faker')) { + // Expected @see faker.xxx.yyy() + expect(link, 'Expect method reference to contain ()').toContain('('); + expect(link, 'Expect method reference to contain ()').toContain(')'); + } + }); }); }); }); diff --git a/test/scripts/apidoc/signature.expected.json b/test/scripts/apidoc/signature.expected.json index f576a342e53..fc948e55037 100644 --- a/test/scripts/apidoc/signature.expected.json +++ b/test/scripts/apidoc/signature.expected.json @@ -12,7 +12,7 @@ } ], "returns": "number", - "examples": "
faker.defaultBooleanParamMethod(c: boolean = true): number\n
\n
", + "examples": "
faker.defaultBooleanParamMethod(c: boolean = true): number\n
\n
", "deprecated": false, "seeAlsos": [] }, @@ -28,7 +28,7 @@ } ], "returns": "number", - "examples": "
faker.functionParamMethod(fn: (a: string) => number): number\n
\n
", + "examples": "
faker.functionParamMethod(fn: (a: string) => number): number\n
\n
", "deprecated": false, "seeAlsos": [] }, @@ -44,7 +44,7 @@ } ], "returns": "string", - "examples": "
faker.literalUnionParamMethod(value: 'a' | 'b' | string): string\n
\n
", + "examples": "
faker.literalUnionParamMethod(value: 'a' | 'b' | string): string\n
\n
", "deprecated": false, "seeAlsos": [] }, @@ -54,7 +54,7 @@ "description": "

Test with deprecated and see marker.

\n", "parameters": [], "returns": "number", - "examples": "
faker.methodWithDeprecated(): number\n
\n
", + "examples": "
faker.methodWithDeprecated(): number\n
\n
", "deprecated": true, "seeAlsos": ["test.apidoc.methodWithExample()"] }, @@ -64,7 +64,7 @@ "description": "

Test with example marker.

\n", "parameters": [], "returns": "number", - "examples": "
faker.methodWithExample(): number\ntest.apidoc.methodWithExample() // 0\n
\n
", + "examples": "
faker.methodWithExample(): number\ntest.apidoc.methodWithExample() // 0\n
\n
", "deprecated": false, "seeAlsos": [] }, @@ -91,7 +91,7 @@ } ], "returns": "number", - "examples": "
faker.multiParamMethod(a: number, b?: string, c: boolean = true): number\n
\n
", + "examples": "
faker.multiParamMethod(a: number, b?: string, c: boolean = true): number\n
\n
", "deprecated": false, "seeAlsos": [] }, @@ -101,7 +101,7 @@ "description": "

Test with no parameters.

\n", "parameters": [], "returns": "number", - "examples": "
faker.noParamMethod(): number\n
\n
", + "examples": "
faker.noParamMethod(): number\n
\n
", "deprecated": false, "seeAlsos": [] }, @@ -117,7 +117,7 @@ } ], "returns": "number", - "examples": "
faker.optionalStringParamMethod(b?: string): number\n
\n
", + "examples": "
faker.optionalStringParamMethod(b?: string): number\n
\n
", "deprecated": false, "seeAlsos": [] }, @@ -161,7 +161,7 @@ } ], "returns": "number", - "examples": "
faker.optionsInlineParamMethodWithDefaults(a: {\n  value: number\n} = { value: 1 }, b: {\n  value: number\n} = { value: 1 }, c: {\n  value: number\n}): number\n
\n
", + "examples": "
faker.optionsInlineParamMethodWithDefaults(a: {\n  value: number\n} = { value: 1 }, b: {\n  value: number\n} = { value: 1 }, c: {\n  value: number\n}): number\n
\n
", "deprecated": false, "seeAlsos": [] }, @@ -189,7 +189,7 @@ } ], "returns": "number", - "examples": "
faker.optionsInterfaceParamMethodWithDefaults(a: ParameterOptionsInterfaceA = { value: 1 }, b: ParameterOptionsInterfaceB = { value: 1 }, c: ParameterOptionsInterfaceC): number\n
\n
", + "examples": "
faker.optionsInterfaceParamMethodWithDefaults(a: ParameterOptionsInterfaceA = { value: 1 }, b: ParameterOptionsInterfaceB = { value: 1 }, c: ParameterOptionsInterfaceC): number\n
\n
", "deprecated": false, "seeAlsos": [] }, @@ -225,7 +225,7 @@ } ], "returns": "number", - "examples": "
faker.optionsParamMethod(options: {\n  a: number,\n  b: string,\n  c: boolean,\n  d: () => string\n}): number\n
\n
", + "examples": "
faker.optionsParamMethod(options: {\n  a: number,\n  b: string,\n  c: boolean,\n  d: () => string\n}): number\n
\n
", "deprecated": false, "seeAlsos": [] }, @@ -253,7 +253,7 @@ } ], "returns": "number", - "examples": "
faker.optionsTypeParamMethodWithDefaults(a: ParameterOptionsTypeA = { value: 1 }, b: ParameterOptionsTypeB = { value: 1 }, c: ParameterOptionsTypeC): number\n
\n
", + "examples": "
faker.optionsTypeParamMethodWithDefaults(a: ParameterOptionsTypeA = { value: 1 }, b: ParameterOptionsTypeB = { value: 1 }, c: ParameterOptionsTypeC): number\n
\n
", "deprecated": false, "seeAlsos": [] }, @@ -269,7 +269,7 @@ } ], "returns": "number", - "examples": "
faker.requiredNumberParamMethod(a: number): number\n
\n
", + "examples": "
faker.requiredNumberParamMethod(a: number): number\n
\n
", "deprecated": false, "seeAlsos": [] }, @@ -285,7 +285,7 @@ } ], "returns": "string", - "examples": "
faker.stringUnionParamMethod(value: 'a' | 'b'): string\n
\n
", + "examples": "
faker.stringUnionParamMethod(value: 'a' | 'b'): string\n
\n
", "deprecated": false, "seeAlsos": [] } diff --git a/test/scripts/apidoc/signature.spec.ts b/test/scripts/apidoc/signature.spec.ts index 427ed923987..f55c10f8d0a 100644 --- a/test/scripts/apidoc/signature.spec.ts +++ b/test/scripts/apidoc/signature.spec.ts @@ -1,8 +1,11 @@ import { writeFileSync } from 'fs'; import { resolve } from 'path'; -import { afterAll, describe, expect, it } from 'vitest'; +import { afterAll, beforeAll, describe, expect, it } from 'vitest'; import type { Method } from '../../../docs/.vitepress/components/api-docs/method'; -import { analyzeSignature } from '../../../scripts/apidoc/signature'; +import { + analyzeSignature, + initMarkdownRenderer, +} from '../../../scripts/apidoc/signature'; import { SignatureTest } from './signature.example'; import expected_ from './signature.expected.json'; import { loadExampleMethods } from './utils'; @@ -18,6 +21,10 @@ describe('signature', () => { const actuals = {}; const methods = loadExampleMethods(); + beforeAll(async () => { + await initMarkdownRenderer(); + }); + it('dummy dependency to rerun the test if the example changes', () => { expect(new SignatureTest()).toBeTruthy(); }); diff --git a/test/system.spec.ts b/test/system.spec.ts index 8a44201d902..05e2c53daba 100644 --- a/test/system.spec.ts +++ b/test/system.spec.ts @@ -16,6 +16,7 @@ const functionNames = [ 'filePath', 'fileType', 'mimeType', + 'networkInterface', 'semver', ]; @@ -46,6 +47,24 @@ describe('system', () => { t.describe('fileExt', (t) => { t.it('noArgs').it('with mimeType', 'application/json'); }); + + t.describe('networkInterface', (t) => { + t.it('noArgs'); + for (const interfaceSchema of [ + undefined, + 'index', + 'slot', + 'mac', + 'pci', + ] as const) { + for (const interfaceType of [undefined, 'en', 'wl', 'ww'] as const) { + t.it(`with ${JSON.stringify({ interfaceType, interfaceSchema })}`, { + interfaceType, + interfaceSchema, + }); + } + } + }); }); for (const seed of seededRuns) { @@ -76,6 +95,7 @@ describe('system', () => { 'jpg', 'm1v', 'm2a', + 'm1v', 'm2v', 'm3a', 'mp2', @@ -283,6 +303,88 @@ describe('system', () => { ).toSatisfy(validator.isSemVer); }); }); + + describe('networkInterface()', () => { + it('should return network interface', () => { + const networkInterface = faker.system.networkInterface(); + + expect( + networkInterface, + `generated network interface should be valid network interface.` + ).toMatch( + /^(?:P\d)?(?:en|wl|ww)(?:o\d|s\d(?:f\d)?(?:d\d)?|x[a-f\d]{12}|p\ds\d(?:f\d)?(?:d\d)?)$/ + ); + }); + + it('should return a network interface with a given type', () => { + const networkInterface = faker.system.networkInterface({ + interfaceType: 'wl', + }); + + expect( + networkInterface, + `generated network interface should be valid network interface.` + ).toMatch( + /^(?:P\d)?wl(?:o\d|s\d(?:f\d)?(?:d\d)?|x[a-f\d]{12}|p\ds\d(?:f\d)?(?:d\d)?)$/ + ); + }); + + it('should return a network interface with an index schema', () => { + const networkInterface = faker.system.networkInterface({ + interfaceSchema: 'index', + }); + + expect( + networkInterface, + `generated network interface should be valid network interface.` + ).toMatch(/^(?:en|wl|ww)o\d$/); + }); + + it('should return a network interface with a slot schema', () => { + const networkInterface = faker.system.networkInterface({ + interfaceSchema: 'slot', + }); + + expect( + networkInterface, + `generated network interface should be valid network interface.` + ).toMatch(/^(?:en|wl|ww)s\d(?:f\d)?(?:d\d)?$/); + }); + + it('should return a network interface with a mac schema', () => { + const networkInterface = faker.system.networkInterface({ + interfaceSchema: 'mac', + }); + + expect( + networkInterface, + `generated network interface should be valid network interface.` + ).toMatch(/^(?:en|wl|ww)x[a-f\d]{12}$/); + }); + + it('should return a network interface with a pci schema', () => { + const networkInterface = faker.system.networkInterface({ + interfaceSchema: 'pci', + }); + + expect( + networkInterface, + `generated network interface should be valid network interface.` + ).toMatch(/^(?:P\d)?(?:en|wl|ww)p\ds\d(?:f\d)?(?:d\d)?$/); + }); + + it('should return a network interface with a given type and schema', () => { + const networkInterface = faker.system.networkInterface({ + interfaceType: 'en', + interfaceSchema: 'mac', + }); + + expect( + networkInterface, + `generated network interface should be valid network interface.` + ).toMatch(/^enx[a-f\d]{12}$/); + }); + }); } });