diff --git a/docs/.vitepress/components/api-docs/method.ts b/docs/.vitepress/components/api-docs/method.ts index 6601a5ca047..3c1b9b9577e 100644 --- a/docs/.vitepress/components/api-docs/method.ts +++ b/docs/.vitepress/components/api-docs/method.ts @@ -8,6 +8,7 @@ export interface Method { readonly since: string; readonly sourcePath: string; // URL-Suffix readonly seeAlsos: string[]; + readonly throws?: string; // HTML } export interface MethodParameter { diff --git a/docs/.vitepress/components/api-docs/method.vue b/docs/.vitepress/components/api-docs/method.vue index 38d105868ce..2b3f0c5b7a0 100644 --- a/docs/.vitepress/components/api-docs/method.vue +++ b/docs/.vitepress/components/api-docs/method.vue @@ -36,6 +36,10 @@ function seeAlsoToUrl(see: string): string {

Returns: {{ props.method.returns }}

+

+ Throws: +

+
diff --git a/scripts/apidoc/signature.ts b/scripts/apidoc/signature.ts index 3d8fd6f7c6c..8b5083ae7d6 100644 --- a/scripts/apidoc/signature.ts +++ b/scripts/apidoc/signature.ts @@ -25,6 +25,7 @@ import { extractSeeAlsos, extractSince, extractSourcePath, + extractThrows, joinTagParts, } from './typedoc'; import { pathOutputDir } from './utils'; @@ -160,12 +161,16 @@ export function analyzeSignature( const deprecated = deprecatedMessage ? mdToHtml(deprecatedMessage) : undefined; + const throwsMessage = extractThrows(signature); + const throws = throwsMessage ? mdToHtml(throwsMessage, true) : undefined; + return { name: methodName, description: mdToHtml(toBlock(signature.comment)), parameters: parameters, since: extractSince(signature), sourcePath: extractSourcePath(signature), + throws, returns: typeToText(signature.type), examples: mdToHtml(`${code}ts\n${examples}${code}`), deprecated, diff --git a/scripts/apidoc/typedoc.ts b/scripts/apidoc/typedoc.ts index 7fc1450bbdb..858171ac22d 100644 --- a/scripts/apidoc/typedoc.ts +++ b/scripts/apidoc/typedoc.ts @@ -286,6 +286,18 @@ export function extractDeprecated( return deprecated.length === 0 ? undefined : deprecated; } +/** + * Extracts the "throws" tag from the provided signature. + * + * @param reflection The reflection to check. + * + * @returns The message explaining the conditions when this method throws. Or `undefined` if it does not throw. + */ +export function extractThrows(reflection?: CommentHolder): string | undefined { + const throws = extractTagContent('@throws', reflection).join().trim(); + return throws.length === 0 ? undefined : throws; +} + /** * Extracts the "since" tag from the provided signature. * diff --git a/scripts/generateLocales.ts b/scripts/generateLocales.ts index 2af0c46a287..f92bc508db5 100644 --- a/scripts/generateLocales.ts +++ b/scripts/generateLocales.ts @@ -126,7 +126,7 @@ function generateLocaleFile(locale: string): void { } } - // TODO christopher 2023-03-07: Remove 'en' fallback in a separate PR + // TODO @Shinigami92 2023-03-07: Remove 'en' fallback in a separate PR if (locales[locales.length - 1] !== 'en' && locale !== 'base') { locales.push('en'); } diff --git a/src/definitions/company.ts b/src/definitions/company.ts index 257a2912292..6823125d601 100644 --- a/src/definitions/company.ts +++ b/src/definitions/company.ts @@ -32,7 +32,7 @@ export type CompanyDefinitions = LocaleEntry<{ /** * A list of patterns used to generate company names. */ - name_patterns: string[]; + name_pattern: string[]; /** * Catchphrase nouns that can be displayed to an end user. diff --git a/src/definitions/person.ts b/src/definitions/person.ts index 7b54860c28e..9cc86d3a20a 100644 --- a/src/definitions/person.ts +++ b/src/definitions/person.ts @@ -33,11 +33,11 @@ export type PersonDefinitions = LocaleEntry<{ /** * A weighted list of patterns used to generate last names. */ - last_name_patterns?: Array<{ value: string; weight: number }>; - male_last_name_patterns?: Array<{ value: string; weight: number }>; - female_last_name_patterns?: Array<{ value: string; weight: number }>; + last_name_pattern?: Array<{ value: string; weight: number }>; + male_last_name_pattern?: Array<{ value: string; weight: number }>; + female_last_name_pattern?: Array<{ value: string; weight: number }>; - bio_patterns?: string[]; + bio_pattern?: string[]; title: PersonTitleDefinitions; diff --git a/src/faker.ts b/src/faker.ts index 3d93009e61c..a694fcc2c60 100644 --- a/src/faker.ts +++ b/src/faker.ts @@ -46,7 +46,6 @@ import { mergeLocales } from './utils/merge-locales'; * * faker.person.firstName(); // 'John' * faker.person.lastName(); // 'Doe' - * * @example * import { Faker, es } from '@faker-js/faker'; * // const { Faker, es } = require('@faker-js/faker'); @@ -347,6 +346,7 @@ export class Faker { * by logging the result and explicitly setting it if needed. * * @param seed The seed to use. Defaults to a random number. + * * @returns The seed that was set. * * @see [Reproducible Results](https://next.fakerjs.dev/guide/usage.html#reproducible-results) @@ -381,6 +381,7 @@ export class Faker { * by logging the result and explicitly setting it if needed. * * @param seedArray The seed array to use. + * * @returns The seed array that was set. * * @see [Reproducible Results](https://next.fakerjs.dev/guide/usage.html#reproducible-results) @@ -415,6 +416,7 @@ export class Faker { * by logging the result and explicitly setting it if needed. * * @param seed The seed or seed array to use. + * * @returns The seed that was set. * * @see [Reproducible Results](https://next.fakerjs.dev/guide/usage.html#reproducible-results) diff --git a/src/locales/af_ZA/person/index.ts b/src/locales/af_ZA/person/index.ts index 3b898ef83ff..c8cf328dfc4 100644 --- a/src/locales/af_ZA/person/index.ts +++ b/src/locales/af_ZA/person/index.ts @@ -6,14 +6,14 @@ import type { PersonDefinitions } from '../../..'; import female_first_name from './female_first_name'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; const person: PersonDefinitions = { female_first_name, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, }; diff --git a/src/locales/af_ZA/person/last_name_patterns.ts b/src/locales/af_ZA/person/last_name_pattern.ts similarity index 100% rename from src/locales/af_ZA/person/last_name_patterns.ts rename to src/locales/af_ZA/person/last_name_pattern.ts diff --git a/src/locales/ar/person/index.ts b/src/locales/ar/person/index.ts index 96cc5d1e442..6b647dea041 100644 --- a/src/locales/ar/person/index.ts +++ b/src/locales/ar/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -20,7 +20,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/ar/person/last_name_patterns.ts b/src/locales/ar/person/last_name_pattern.ts similarity index 100% rename from src/locales/ar/person/last_name_patterns.ts rename to src/locales/ar/person/last_name_pattern.ts diff --git a/src/locales/az/company/index.ts b/src/locales/az/company/index.ts index 4e399166244..cd2cb5aadef 100644 --- a/src/locales/az/company/index.ts +++ b/src/locales/az/company/index.ts @@ -3,12 +3,12 @@ * Run 'pnpm run generate:locales' to update. */ import type { CompanyDefinitions } from '../../..'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import prefix from './prefix'; import suffix from './suffix'; const company: CompanyDefinitions = { - name_patterns, + name_pattern, prefix, suffix, }; diff --git a/src/locales/az/company/name_patterns.ts b/src/locales/az/company/name_pattern.ts similarity index 100% rename from src/locales/az/company/name_patterns.ts rename to src/locales/az/company/name_pattern.ts diff --git a/src/locales/az/person/female_last_name_patterns.ts b/src/locales/az/person/female_last_name_pattern.ts similarity index 100% rename from src/locales/az/person/female_last_name_patterns.ts rename to src/locales/az/person/female_last_name_pattern.ts diff --git a/src/locales/az/person/index.ts b/src/locales/az/person/index.ts index ff3e0f9d026..26ed59819c0 100644 --- a/src/locales/az/person/index.ts +++ b/src/locales/az/person/index.ts @@ -5,12 +5,12 @@ import type { PersonDefinitions } from '../../..'; import female_first_name from './female_first_name'; import female_last_name from './female_last_name'; -import female_last_name_patterns from './female_last_name_patterns'; +import female_last_name_pattern from './female_last_name_pattern'; import female_prefix from './female_prefix'; import first_name from './first_name'; import male_first_name from './male_first_name'; import male_last_name from './male_last_name'; -import male_last_name_patterns from './male_last_name_patterns'; +import male_last_name_pattern from './male_last_name_pattern'; import male_prefix from './male_prefix'; import name_ from './name'; import prefix from './prefix'; @@ -19,12 +19,12 @@ import suffix from './suffix'; const person: PersonDefinitions = { female_first_name, female_last_name, - female_last_name_patterns, + female_last_name_pattern, female_prefix, first_name, male_first_name, male_last_name, - male_last_name_patterns, + male_last_name_pattern, male_prefix, name: name_, prefix, diff --git a/src/locales/az/person/male_last_name_patterns.ts b/src/locales/az/person/male_last_name_pattern.ts similarity index 100% rename from src/locales/az/person/male_last_name_patterns.ts rename to src/locales/az/person/male_last_name_pattern.ts diff --git a/src/locales/cs_CZ/company/index.ts b/src/locales/cs_CZ/company/index.ts index 94e1daa3406..ca8066865e2 100644 --- a/src/locales/cs_CZ/company/index.ts +++ b/src/locales/cs_CZ/company/index.ts @@ -3,11 +3,11 @@ * Run 'pnpm run generate:locales' to update. */ import type { CompanyDefinitions } from '../../..'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import suffix from './suffix'; const company: CompanyDefinitions = { - name_patterns, + name_pattern, suffix, }; diff --git a/src/locales/cs_CZ/company/name_patterns.ts b/src/locales/cs_CZ/company/name_pattern.ts similarity index 100% rename from src/locales/cs_CZ/company/name_patterns.ts rename to src/locales/cs_CZ/company/name_pattern.ts diff --git a/src/locales/cs_CZ/person/female_last_name_patterns.ts b/src/locales/cs_CZ/person/female_last_name_pattern.ts similarity index 100% rename from src/locales/cs_CZ/person/female_last_name_patterns.ts rename to src/locales/cs_CZ/person/female_last_name_pattern.ts diff --git a/src/locales/cs_CZ/person/index.ts b/src/locales/cs_CZ/person/index.ts index 80ee56cc540..2e9383902f5 100644 --- a/src/locales/cs_CZ/person/index.ts +++ b/src/locales/cs_CZ/person/index.ts @@ -5,13 +5,13 @@ import type { PersonDefinitions } from '../../..'; import female_first_name from './female_first_name'; import female_last_name from './female_last_name'; -import female_last_name_patterns from './female_last_name_patterns'; +import female_last_name_pattern from './female_last_name_pattern'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; import male_first_name from './male_first_name'; import male_last_name from './male_last_name'; -import male_last_name_patterns from './male_last_name_patterns'; +import male_last_name_pattern from './male_last_name_pattern'; import male_prefix from './male_prefix'; import name_ from './name'; import prefix from './prefix'; @@ -21,13 +21,13 @@ import title from './title'; const person: PersonDefinitions = { female_first_name, female_last_name, - female_last_name_patterns, + female_last_name_pattern, female_prefix, first_name, last_name, male_first_name, male_last_name, - male_last_name_patterns, + male_last_name_pattern, male_prefix, name: name_, prefix, diff --git a/src/locales/cs_CZ/person/male_last_name_patterns.ts b/src/locales/cs_CZ/person/male_last_name_pattern.ts similarity index 100% rename from src/locales/cs_CZ/person/male_last_name_patterns.ts rename to src/locales/cs_CZ/person/male_last_name_pattern.ts diff --git a/src/locales/de/company/index.ts b/src/locales/de/company/index.ts index 453ccf5fe20..6b0e931f2dc 100644 --- a/src/locales/de/company/index.ts +++ b/src/locales/de/company/index.ts @@ -4,12 +4,12 @@ */ import type { CompanyDefinitions } from '../../..'; import legal_form from './legal_form'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import suffix from './suffix'; const company: CompanyDefinitions = { legal_form, - name_patterns, + name_pattern, suffix, }; diff --git a/src/locales/de/company/name_patterns.ts b/src/locales/de/company/name_pattern.ts similarity index 100% rename from src/locales/de/company/name_patterns.ts rename to src/locales/de/company/name_pattern.ts diff --git a/src/locales/de/person/index.ts b/src/locales/de/person/index.ts index 23ce464d846..1779b8d15a6 100644 --- a/src/locales/de/person/index.ts +++ b/src/locales/de/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -20,7 +20,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/de/person/last_name_patterns.ts b/src/locales/de/person/last_name_pattern.ts similarity index 100% rename from src/locales/de/person/last_name_patterns.ts rename to src/locales/de/person/last_name_pattern.ts diff --git a/src/locales/de_AT/company/index.ts b/src/locales/de_AT/company/index.ts index 453ccf5fe20..6b0e931f2dc 100644 --- a/src/locales/de_AT/company/index.ts +++ b/src/locales/de_AT/company/index.ts @@ -4,12 +4,12 @@ */ import type { CompanyDefinitions } from '../../..'; import legal_form from './legal_form'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import suffix from './suffix'; const company: CompanyDefinitions = { legal_form, - name_patterns, + name_pattern, suffix, }; diff --git a/src/locales/de_AT/company/name_patterns.ts b/src/locales/de_AT/company/name_pattern.ts similarity index 100% rename from src/locales/de_AT/company/name_patterns.ts rename to src/locales/de_AT/company/name_pattern.ts diff --git a/src/locales/de_AT/person/index.ts b/src/locales/de_AT/person/index.ts index c8b0620438b..e9c84f7b2cc 100644 --- a/src/locales/de_AT/person/index.ts +++ b/src/locales/de_AT/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -19,7 +19,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/de_AT/person/last_name_patterns.ts b/src/locales/de_AT/person/last_name_pattern.ts similarity index 100% rename from src/locales/de_AT/person/last_name_patterns.ts rename to src/locales/de_AT/person/last_name_pattern.ts diff --git a/src/locales/de_CH/company/index.ts b/src/locales/de_CH/company/index.ts index 94e1daa3406..ca8066865e2 100644 --- a/src/locales/de_CH/company/index.ts +++ b/src/locales/de_CH/company/index.ts @@ -3,11 +3,11 @@ * Run 'pnpm run generate:locales' to update. */ import type { CompanyDefinitions } from '../../..'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import suffix from './suffix'; const company: CompanyDefinitions = { - name_patterns, + name_pattern, suffix, }; diff --git a/src/locales/de_CH/company/name_patterns.ts b/src/locales/de_CH/company/name_pattern.ts similarity index 100% rename from src/locales/de_CH/company/name_patterns.ts rename to src/locales/de_CH/company/name_pattern.ts diff --git a/src/locales/de_CH/person/index.ts b/src/locales/de_CH/person/index.ts index 83b511ea248..d22a45c2a5e 100644 --- a/src/locales/de_CH/person/index.ts +++ b/src/locales/de_CH/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -18,7 +18,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/de_CH/person/last_name_patterns.ts b/src/locales/de_CH/person/last_name_pattern.ts similarity index 100% rename from src/locales/de_CH/person/last_name_patterns.ts rename to src/locales/de_CH/person/last_name_pattern.ts diff --git a/src/locales/dv/company/index.ts b/src/locales/dv/company/index.ts index 67d294c9e4c..2ef456a79ec 100644 --- a/src/locales/dv/company/index.ts +++ b/src/locales/dv/company/index.ts @@ -4,13 +4,13 @@ */ import type { CompanyDefinitions } from '../../..'; import adjective from './adjective'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import noun from './noun'; import suffix from './suffix'; const company: CompanyDefinitions = { adjective, - name_patterns, + name_pattern, noun, suffix, }; diff --git a/src/locales/dv/company/name_patterns.ts b/src/locales/dv/company/name_pattern.ts similarity index 100% rename from src/locales/dv/company/name_patterns.ts rename to src/locales/dv/company/name_pattern.ts diff --git a/src/locales/dv/person/female_last_name_patterns.ts b/src/locales/dv/person/female_last_name_pattern.ts similarity index 100% rename from src/locales/dv/person/female_last_name_patterns.ts rename to src/locales/dv/person/female_last_name_pattern.ts diff --git a/src/locales/dv/person/index.ts b/src/locales/dv/person/index.ts index 781ce39a85f..9f48f9ddc9f 100644 --- a/src/locales/dv/person/index.ts +++ b/src/locales/dv/person/index.ts @@ -5,13 +5,13 @@ import type { PersonDefinitions } from '../../..'; import female_first_name from './female_first_name'; import female_last_name from './female_last_name'; -import female_last_name_patterns from './female_last_name_patterns'; +import female_last_name_pattern from './female_last_name_pattern'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; import male_first_name from './male_first_name'; import male_last_name from './male_last_name'; -import male_last_name_patterns from './male_last_name_patterns'; +import male_last_name_pattern from './male_last_name_pattern'; import male_prefix from './male_prefix'; import name_ from './name'; import prefix from './prefix'; @@ -20,13 +20,13 @@ import sex from './sex'; const person: PersonDefinitions = { female_first_name, female_last_name, - female_last_name_patterns, + female_last_name_pattern, female_prefix, first_name, last_name, male_first_name, male_last_name, - male_last_name_patterns, + male_last_name_pattern, male_prefix, name: name_, prefix, diff --git a/src/locales/dv/person/male_last_name_patterns.ts b/src/locales/dv/person/male_last_name_pattern.ts similarity index 100% rename from src/locales/dv/person/male_last_name_patterns.ts rename to src/locales/dv/person/male_last_name_pattern.ts diff --git a/src/locales/el/company/index.ts b/src/locales/el/company/index.ts index ad4d1c3bbdb..1f229c919e4 100644 --- a/src/locales/el/company/index.ts +++ b/src/locales/el/company/index.ts @@ -8,7 +8,7 @@ import buzz_adjective from './buzz_adjective'; import buzz_noun from './buzz_noun'; import buzz_verb from './buzz_verb'; import descriptor from './descriptor'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import noun from './noun'; import suffix from './suffix'; @@ -18,7 +18,7 @@ const company: CompanyDefinitions = { buzz_noun, buzz_verb, descriptor, - name_patterns, + name_pattern, noun, suffix, }; diff --git a/src/locales/el/company/name_patterns.ts b/src/locales/el/company/name_pattern.ts similarity index 100% rename from src/locales/el/company/name_patterns.ts rename to src/locales/el/company/name_pattern.ts diff --git a/src/locales/el/person/index.ts b/src/locales/el/person/index.ts index b12b544e80d..0284b3386de 100644 --- a/src/locales/el/person/index.ts +++ b/src/locales/el/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -19,7 +19,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/el/person/last_name_patterns.ts b/src/locales/el/person/last_name_pattern.ts similarity index 100% rename from src/locales/el/person/last_name_patterns.ts rename to src/locales/el/person/last_name_pattern.ts diff --git a/src/locales/en/company/index.ts b/src/locales/en/company/index.ts index ad4d1c3bbdb..1f229c919e4 100644 --- a/src/locales/en/company/index.ts +++ b/src/locales/en/company/index.ts @@ -8,7 +8,7 @@ import buzz_adjective from './buzz_adjective'; import buzz_noun from './buzz_noun'; import buzz_verb from './buzz_verb'; import descriptor from './descriptor'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import noun from './noun'; import suffix from './suffix'; @@ -18,7 +18,7 @@ const company: CompanyDefinitions = { buzz_noun, buzz_verb, descriptor, - name_patterns, + name_pattern, noun, suffix, }; diff --git a/src/locales/en/company/name_patterns.ts b/src/locales/en/company/name_pattern.ts similarity index 100% rename from src/locales/en/company/name_patterns.ts rename to src/locales/en/company/name_pattern.ts diff --git a/src/locales/en/person/bio_patterns.ts b/src/locales/en/person/bio_pattern.ts similarity index 100% rename from src/locales/en/person/bio_patterns.ts rename to src/locales/en/person/bio_pattern.ts diff --git a/src/locales/en/person/index.ts b/src/locales/en/person/index.ts index 6932c2e5322..3c9d1967d6a 100644 --- a/src/locales/en/person/index.ts +++ b/src/locales/en/person/index.ts @@ -4,7 +4,7 @@ */ import type { PersonDefinitions } from '../../..'; import bio_part from './bio_part'; -import bio_patterns from './bio_patterns'; +import bio_pattern from './bio_pattern'; import bio_supporter from './bio_supporter'; import female_first_name from './female_first_name'; import female_middle_name from './female_middle_name'; @@ -12,7 +12,7 @@ import female_prefix from './female_prefix'; import first_name from './first_name'; import gender from './gender'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_middle_name from './male_middle_name'; import male_prefix from './male_prefix'; @@ -26,7 +26,7 @@ import western_zodiac_sign from './western_zodiac_sign'; const person: PersonDefinitions = { bio_part, - bio_patterns, + bio_pattern, bio_supporter, female_first_name, female_middle_name, @@ -34,7 +34,7 @@ const person: PersonDefinitions = { first_name, gender, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_middle_name, male_prefix, diff --git a/src/locales/en/person/last_name_patterns.ts b/src/locales/en/person/last_name_pattern.ts similarity index 100% rename from src/locales/en/person/last_name_patterns.ts rename to src/locales/en/person/last_name_pattern.ts diff --git a/src/locales/en_AU/person/index.ts b/src/locales/en_AU/person/index.ts index 3b898ef83ff..c8cf328dfc4 100644 --- a/src/locales/en_AU/person/index.ts +++ b/src/locales/en_AU/person/index.ts @@ -6,14 +6,14 @@ import type { PersonDefinitions } from '../../..'; import female_first_name from './female_first_name'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; const person: PersonDefinitions = { female_first_name, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, }; diff --git a/src/locales/en_AU/person/last_name_patterns.ts b/src/locales/en_AU/person/last_name_pattern.ts similarity index 100% rename from src/locales/en_AU/person/last_name_patterns.ts rename to src/locales/en_AU/person/last_name_pattern.ts diff --git a/src/locales/en_AU_ocker/person/index.ts b/src/locales/en_AU_ocker/person/index.ts index 73ca4443ddd..eb94c7c34ce 100644 --- a/src/locales/en_AU_ocker/person/index.ts +++ b/src/locales/en_AU_ocker/person/index.ts @@ -5,13 +5,13 @@ import type { PersonDefinitions } from '../../..'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import ocker_first_name from './ocker_first_name'; const person: PersonDefinitions = { first_name, last_name, - last_name_patterns, + last_name_pattern, ocker_first_name, }; diff --git a/src/locales/en_AU_ocker/person/last_name_patterns.ts b/src/locales/en_AU_ocker/person/last_name_pattern.ts similarity index 100% rename from src/locales/en_AU_ocker/person/last_name_patterns.ts rename to src/locales/en_AU_ocker/person/last_name_pattern.ts diff --git a/src/locales/en_BORK/person/index.ts b/src/locales/en_BORK/person/index.ts index 3b369d02c46..7b53e032107 100644 --- a/src/locales/en_BORK/person/index.ts +++ b/src/locales/en_BORK/person/index.ts @@ -3,10 +3,10 @@ * Run 'pnpm run generate:locales' to update. */ import type { PersonDefinitions } from '../../..'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; const person: PersonDefinitions = { - last_name_patterns, + last_name_pattern, }; export default person; diff --git a/src/locales/en_BORK/person/last_name_patterns.ts b/src/locales/en_BORK/person/last_name_pattern.ts similarity index 100% rename from src/locales/en_BORK/person/last_name_patterns.ts rename to src/locales/en_BORK/person/last_name_pattern.ts diff --git a/src/locales/en_CA/person/index.ts b/src/locales/en_CA/person/index.ts index 3b369d02c46..7b53e032107 100644 --- a/src/locales/en_CA/person/index.ts +++ b/src/locales/en_CA/person/index.ts @@ -3,10 +3,10 @@ * Run 'pnpm run generate:locales' to update. */ import type { PersonDefinitions } from '../../..'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; const person: PersonDefinitions = { - last_name_patterns, + last_name_pattern, }; export default person; diff --git a/src/locales/en_CA/person/last_name_patterns.ts b/src/locales/en_CA/person/last_name_pattern.ts similarity index 100% rename from src/locales/en_CA/person/last_name_patterns.ts rename to src/locales/en_CA/person/last_name_pattern.ts diff --git a/src/locales/en_GB/person/index.ts b/src/locales/en_GB/person/index.ts index e76a78a79a8..7fbd03ad40b 100644 --- a/src/locales/en_GB/person/index.ts +++ b/src/locales/en_GB/person/index.ts @@ -3,11 +3,11 @@ * Run 'pnpm run generate:locales' to update. */ import type { PersonDefinitions } from '../../..'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import name_ from './name'; const person: PersonDefinitions = { - last_name_patterns, + last_name_pattern, name: name_, }; diff --git a/src/locales/en_GB/person/last_name_patterns.ts b/src/locales/en_GB/person/last_name_pattern.ts similarity index 100% rename from src/locales/en_GB/person/last_name_patterns.ts rename to src/locales/en_GB/person/last_name_pattern.ts diff --git a/src/locales/en_GH/company/index.ts b/src/locales/en_GH/company/index.ts index 94e1daa3406..ca8066865e2 100644 --- a/src/locales/en_GH/company/index.ts +++ b/src/locales/en_GH/company/index.ts @@ -3,11 +3,11 @@ * Run 'pnpm run generate:locales' to update. */ import type { CompanyDefinitions } from '../../..'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import suffix from './suffix'; const company: CompanyDefinitions = { - name_patterns, + name_pattern, suffix, }; diff --git a/src/locales/en_GH/company/name_patterns.ts b/src/locales/en_GH/company/name_pattern.ts similarity index 100% rename from src/locales/en_GH/company/name_patterns.ts rename to src/locales/en_GH/company/name_pattern.ts diff --git a/src/locales/en_GH/person/index.ts b/src/locales/en_GH/person/index.ts index 89be81cc292..6260df3aece 100644 --- a/src/locales/en_GH/person/index.ts +++ b/src/locales/en_GH/person/index.ts @@ -6,7 +6,7 @@ import type { PersonDefinitions } from '../../..'; import female_first_name from './female_first_name'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import name_ from './name'; @@ -14,7 +14,7 @@ const person: PersonDefinitions = { female_first_name, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, name: name_, }; diff --git a/src/locales/en_GH/person/last_name_patterns.ts b/src/locales/en_GH/person/last_name_pattern.ts similarity index 100% rename from src/locales/en_GH/person/last_name_patterns.ts rename to src/locales/en_GH/person/last_name_pattern.ts diff --git a/src/locales/en_IE/person/index.ts b/src/locales/en_IE/person/index.ts index 3b369d02c46..7b53e032107 100644 --- a/src/locales/en_IE/person/index.ts +++ b/src/locales/en_IE/person/index.ts @@ -3,10 +3,10 @@ * Run 'pnpm run generate:locales' to update. */ import type { PersonDefinitions } from '../../..'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; const person: PersonDefinitions = { - last_name_patterns, + last_name_pattern, }; export default person; diff --git a/src/locales/en_IE/person/last_name_patterns.ts b/src/locales/en_IE/person/last_name_pattern.ts similarity index 100% rename from src/locales/en_IE/person/last_name_patterns.ts rename to src/locales/en_IE/person/last_name_pattern.ts diff --git a/src/locales/en_IN/person/index.ts b/src/locales/en_IN/person/index.ts index 3b898ef83ff..c8cf328dfc4 100644 --- a/src/locales/en_IN/person/index.ts +++ b/src/locales/en_IN/person/index.ts @@ -6,14 +6,14 @@ import type { PersonDefinitions } from '../../..'; import female_first_name from './female_first_name'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; const person: PersonDefinitions = { female_first_name, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, }; diff --git a/src/locales/en_IN/person/last_name_patterns.ts b/src/locales/en_IN/person/last_name_pattern.ts similarity index 100% rename from src/locales/en_IN/person/last_name_patterns.ts rename to src/locales/en_IN/person/last_name_pattern.ts diff --git a/src/locales/en_NG/person/index.ts b/src/locales/en_NG/person/index.ts index 89be81cc292..6260df3aece 100644 --- a/src/locales/en_NG/person/index.ts +++ b/src/locales/en_NG/person/index.ts @@ -6,7 +6,7 @@ import type { PersonDefinitions } from '../../..'; import female_first_name from './female_first_name'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import name_ from './name'; @@ -14,7 +14,7 @@ const person: PersonDefinitions = { female_first_name, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, name: name_, }; diff --git a/src/locales/en_NG/person/last_name_patterns.ts b/src/locales/en_NG/person/last_name_pattern.ts similarity index 100% rename from src/locales/en_NG/person/last_name_patterns.ts rename to src/locales/en_NG/person/last_name_pattern.ts diff --git a/src/locales/en_US/person/index.ts b/src/locales/en_US/person/index.ts index 3b369d02c46..7b53e032107 100644 --- a/src/locales/en_US/person/index.ts +++ b/src/locales/en_US/person/index.ts @@ -3,10 +3,10 @@ * Run 'pnpm run generate:locales' to update. */ import type { PersonDefinitions } from '../../..'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; const person: PersonDefinitions = { - last_name_patterns, + last_name_pattern, }; export default person; diff --git a/src/locales/en_US/person/last_name_patterns.ts b/src/locales/en_US/person/last_name_pattern.ts similarity index 100% rename from src/locales/en_US/person/last_name_patterns.ts rename to src/locales/en_US/person/last_name_pattern.ts diff --git a/src/locales/en_ZA/person/index.ts b/src/locales/en_ZA/person/index.ts index 89be81cc292..6260df3aece 100644 --- a/src/locales/en_ZA/person/index.ts +++ b/src/locales/en_ZA/person/index.ts @@ -6,7 +6,7 @@ import type { PersonDefinitions } from '../../..'; import female_first_name from './female_first_name'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import name_ from './name'; @@ -14,7 +14,7 @@ const person: PersonDefinitions = { female_first_name, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, name: name_, }; diff --git a/src/locales/en_ZA/person/last_name_patterns.ts b/src/locales/en_ZA/person/last_name_pattern.ts similarity index 100% rename from src/locales/en_ZA/person/last_name_patterns.ts rename to src/locales/en_ZA/person/last_name_pattern.ts diff --git a/src/locales/es/company/index.ts b/src/locales/es/company/index.ts index 8b8ebbc4bad..d6456084d60 100644 --- a/src/locales/es/company/index.ts +++ b/src/locales/es/company/index.ts @@ -5,14 +5,14 @@ import type { CompanyDefinitions } from '../../..'; import adjective from './adjective'; import descriptor from './descriptor'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import noun from './noun'; import suffix from './suffix'; const company: CompanyDefinitions = { adjective, descriptor, - name_patterns, + name_pattern, noun, suffix, }; diff --git a/src/locales/es/company/name_patterns.ts b/src/locales/es/company/name_pattern.ts similarity index 100% rename from src/locales/es/company/name_patterns.ts rename to src/locales/es/company/name_pattern.ts diff --git a/src/locales/es/person/index.ts b/src/locales/es/person/index.ts index 96cc5d1e442..6b647dea041 100644 --- a/src/locales/es/person/index.ts +++ b/src/locales/es/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -20,7 +20,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/es/person/last_name_patterns.ts b/src/locales/es/person/last_name_pattern.ts similarity index 100% rename from src/locales/es/person/last_name_patterns.ts rename to src/locales/es/person/last_name_pattern.ts diff --git a/src/locales/es_MX/company/index.ts b/src/locales/es_MX/company/index.ts index ad4d1c3bbdb..1f229c919e4 100644 --- a/src/locales/es_MX/company/index.ts +++ b/src/locales/es_MX/company/index.ts @@ -8,7 +8,7 @@ import buzz_adjective from './buzz_adjective'; import buzz_noun from './buzz_noun'; import buzz_verb from './buzz_verb'; import descriptor from './descriptor'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import noun from './noun'; import suffix from './suffix'; @@ -18,7 +18,7 @@ const company: CompanyDefinitions = { buzz_noun, buzz_verb, descriptor, - name_patterns, + name_pattern, noun, suffix, }; diff --git a/src/locales/es_MX/company/name_patterns.ts b/src/locales/es_MX/company/name_pattern.ts similarity index 100% rename from src/locales/es_MX/company/name_patterns.ts rename to src/locales/es_MX/company/name_pattern.ts diff --git a/src/locales/es_MX/person/index.ts b/src/locales/es_MX/person/index.ts index 96cc5d1e442..6b647dea041 100644 --- a/src/locales/es_MX/person/index.ts +++ b/src/locales/es_MX/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -20,7 +20,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/es_MX/person/last_name_patterns.ts b/src/locales/es_MX/person/last_name_pattern.ts similarity index 100% rename from src/locales/es_MX/person/last_name_patterns.ts rename to src/locales/es_MX/person/last_name_pattern.ts diff --git a/src/locales/fa/company/index.ts b/src/locales/fa/company/index.ts index ad4d1c3bbdb..1f229c919e4 100644 --- a/src/locales/fa/company/index.ts +++ b/src/locales/fa/company/index.ts @@ -8,7 +8,7 @@ import buzz_adjective from './buzz_adjective'; import buzz_noun from './buzz_noun'; import buzz_verb from './buzz_verb'; import descriptor from './descriptor'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import noun from './noun'; import suffix from './suffix'; @@ -18,7 +18,7 @@ const company: CompanyDefinitions = { buzz_noun, buzz_verb, descriptor, - name_patterns, + name_pattern, noun, suffix, }; diff --git a/src/locales/fa/company/name_patterns.ts b/src/locales/fa/company/name_pattern.ts similarity index 100% rename from src/locales/fa/company/name_patterns.ts rename to src/locales/fa/company/name_pattern.ts diff --git a/src/locales/fa/person/index.ts b/src/locales/fa/person/index.ts index b12b544e80d..0284b3386de 100644 --- a/src/locales/fa/person/index.ts +++ b/src/locales/fa/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -19,7 +19,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/fa/person/last_name_patterns.ts b/src/locales/fa/person/last_name_pattern.ts similarity index 100% rename from src/locales/fa/person/last_name_patterns.ts rename to src/locales/fa/person/last_name_pattern.ts diff --git a/src/locales/fi/person/index.ts b/src/locales/fi/person/index.ts index 89be81cc292..6260df3aece 100644 --- a/src/locales/fi/person/index.ts +++ b/src/locales/fi/person/index.ts @@ -6,7 +6,7 @@ import type { PersonDefinitions } from '../../..'; import female_first_name from './female_first_name'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import name_ from './name'; @@ -14,7 +14,7 @@ const person: PersonDefinitions = { female_first_name, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, name: name_, }; diff --git a/src/locales/fi/person/last_name_patterns.ts b/src/locales/fi/person/last_name_pattern.ts similarity index 100% rename from src/locales/fi/person/last_name_patterns.ts rename to src/locales/fi/person/last_name_pattern.ts diff --git a/src/locales/fr/company/index.ts b/src/locales/fr/company/index.ts index 94e1daa3406..ca8066865e2 100644 --- a/src/locales/fr/company/index.ts +++ b/src/locales/fr/company/index.ts @@ -3,11 +3,11 @@ * Run 'pnpm run generate:locales' to update. */ import type { CompanyDefinitions } from '../../..'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import suffix from './suffix'; const company: CompanyDefinitions = { - name_patterns, + name_pattern, suffix, }; diff --git a/src/locales/fr/company/name_patterns.ts b/src/locales/fr/company/name_pattern.ts similarity index 100% rename from src/locales/fr/company/name_patterns.ts rename to src/locales/fr/company/name_pattern.ts diff --git a/src/locales/fr/person/index.ts b/src/locales/fr/person/index.ts index 6de80ccc1fc..676a76a6570 100644 --- a/src/locales/fr/person/index.ts +++ b/src/locales/fr/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -20,7 +20,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/fr/person/last_name_patterns.ts b/src/locales/fr/person/last_name_pattern.ts similarity index 100% rename from src/locales/fr/person/last_name_patterns.ts rename to src/locales/fr/person/last_name_pattern.ts diff --git a/src/locales/fr_BE/person/index.ts b/src/locales/fr_BE/person/index.ts index ae2a2209696..bccd272f60e 100644 --- a/src/locales/fr_BE/person/index.ts +++ b/src/locales/fr_BE/person/index.ts @@ -8,7 +8,7 @@ import female_prefix from './female_prefix'; import first_name from './first_name'; import gender from './gender'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -22,7 +22,7 @@ const person: PersonDefinitions = { first_name, gender, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/fr_BE/person/last_name_patterns.ts b/src/locales/fr_BE/person/last_name_pattern.ts similarity index 100% rename from src/locales/fr_BE/person/last_name_patterns.ts rename to src/locales/fr_BE/person/last_name_pattern.ts diff --git a/src/locales/fr_CA/person/index.ts b/src/locales/fr_CA/person/index.ts index 3b369d02c46..7b53e032107 100644 --- a/src/locales/fr_CA/person/index.ts +++ b/src/locales/fr_CA/person/index.ts @@ -3,10 +3,10 @@ * Run 'pnpm run generate:locales' to update. */ import type { PersonDefinitions } from '../../..'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; const person: PersonDefinitions = { - last_name_patterns, + last_name_pattern, }; export default person; diff --git a/src/locales/fr_CA/person/last_name_patterns.ts b/src/locales/fr_CA/person/last_name_pattern.ts similarity index 100% rename from src/locales/fr_CA/person/last_name_patterns.ts rename to src/locales/fr_CA/person/last_name_pattern.ts diff --git a/src/locales/fr_CH/person/index.ts b/src/locales/fr_CH/person/index.ts index 6de80ccc1fc..676a76a6570 100644 --- a/src/locales/fr_CH/person/index.ts +++ b/src/locales/fr_CH/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -20,7 +20,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/fr_CH/person/last_name_patterns.ts b/src/locales/fr_CH/person/last_name_pattern.ts similarity index 100% rename from src/locales/fr_CH/person/last_name_patterns.ts rename to src/locales/fr_CH/person/last_name_pattern.ts diff --git a/src/locales/fr_LU/person/index.ts b/src/locales/fr_LU/person/index.ts index 3b369d02c46..7b53e032107 100644 --- a/src/locales/fr_LU/person/index.ts +++ b/src/locales/fr_LU/person/index.ts @@ -3,10 +3,10 @@ * Run 'pnpm run generate:locales' to update. */ import type { PersonDefinitions } from '../../..'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; const person: PersonDefinitions = { - last_name_patterns, + last_name_pattern, }; export default person; diff --git a/src/locales/fr_LU/person/last_name_patterns.ts b/src/locales/fr_LU/person/last_name_pattern.ts similarity index 100% rename from src/locales/fr_LU/person/last_name_patterns.ts rename to src/locales/fr_LU/person/last_name_pattern.ts diff --git a/src/locales/he/person/index.ts b/src/locales/he/person/index.ts index b12b544e80d..0284b3386de 100644 --- a/src/locales/he/person/index.ts +++ b/src/locales/he/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -19,7 +19,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/he/person/last_name_patterns.ts b/src/locales/he/person/last_name_pattern.ts similarity index 100% rename from src/locales/he/person/last_name_patterns.ts rename to src/locales/he/person/last_name_pattern.ts diff --git a/src/locales/hr/person/index.ts b/src/locales/hr/person/index.ts index 96cc5d1e442..6b647dea041 100644 --- a/src/locales/hr/person/index.ts +++ b/src/locales/hr/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -20,7 +20,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/hr/person/last_name_patterns.ts b/src/locales/hr/person/last_name_pattern.ts similarity index 100% rename from src/locales/hr/person/last_name_patterns.ts rename to src/locales/hr/person/last_name_pattern.ts diff --git a/src/locales/hu/company/index.ts b/src/locales/hu/company/index.ts index 94e1daa3406..ca8066865e2 100644 --- a/src/locales/hu/company/index.ts +++ b/src/locales/hu/company/index.ts @@ -3,11 +3,11 @@ * Run 'pnpm run generate:locales' to update. */ import type { CompanyDefinitions } from '../../..'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import suffix from './suffix'; const company: CompanyDefinitions = { - name_patterns, + name_pattern, suffix, }; diff --git a/src/locales/hu/company/name_patterns.ts b/src/locales/hu/company/name_pattern.ts similarity index 100% rename from src/locales/hu/company/name_patterns.ts rename to src/locales/hu/company/name_pattern.ts diff --git a/src/locales/hu/person/index.ts b/src/locales/hu/person/index.ts index 83b511ea248..d22a45c2a5e 100644 --- a/src/locales/hu/person/index.ts +++ b/src/locales/hu/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -18,7 +18,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/hu/person/last_name_patterns.ts b/src/locales/hu/person/last_name_pattern.ts similarity index 100% rename from src/locales/hu/person/last_name_patterns.ts rename to src/locales/hu/person/last_name_pattern.ts diff --git a/src/locales/hy/person/index.ts b/src/locales/hy/person/index.ts index 89be81cc292..6260df3aece 100644 --- a/src/locales/hy/person/index.ts +++ b/src/locales/hy/person/index.ts @@ -6,7 +6,7 @@ import type { PersonDefinitions } from '../../..'; import female_first_name from './female_first_name'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import name_ from './name'; @@ -14,7 +14,7 @@ const person: PersonDefinitions = { female_first_name, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, name: name_, }; diff --git a/src/locales/hy/person/last_name_patterns.ts b/src/locales/hy/person/last_name_pattern.ts similarity index 100% rename from src/locales/hy/person/last_name_patterns.ts rename to src/locales/hy/person/last_name_pattern.ts diff --git a/src/locales/id_ID/company/index.ts b/src/locales/id_ID/company/index.ts index 4e399166244..cd2cb5aadef 100644 --- a/src/locales/id_ID/company/index.ts +++ b/src/locales/id_ID/company/index.ts @@ -3,12 +3,12 @@ * Run 'pnpm run generate:locales' to update. */ import type { CompanyDefinitions } from '../../..'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import prefix from './prefix'; import suffix from './suffix'; const company: CompanyDefinitions = { - name_patterns, + name_pattern, prefix, suffix, }; diff --git a/src/locales/id_ID/company/name_patterns.ts b/src/locales/id_ID/company/name_pattern.ts similarity index 100% rename from src/locales/id_ID/company/name_patterns.ts rename to src/locales/id_ID/company/name_pattern.ts diff --git a/src/locales/id_ID/person/female_last_name_patterns.ts b/src/locales/id_ID/person/female_last_name_pattern.ts similarity index 100% rename from src/locales/id_ID/person/female_last_name_patterns.ts rename to src/locales/id_ID/person/female_last_name_pattern.ts diff --git a/src/locales/id_ID/person/index.ts b/src/locales/id_ID/person/index.ts index f1fd7c8804d..1aa1369a8a5 100644 --- a/src/locales/id_ID/person/index.ts +++ b/src/locales/id_ID/person/index.ts @@ -5,13 +5,13 @@ import type { PersonDefinitions } from '../../..'; import female_first_name from './female_first_name'; import female_last_name from './female_last_name'; -import female_last_name_patterns from './female_last_name_patterns'; +import female_last_name_pattern from './female_last_name_pattern'; import female_prefix from './female_prefix'; import female_title from './female_title'; import first_name from './first_name'; import male_first_name from './male_first_name'; import male_last_name from './male_last_name'; -import male_last_name_patterns from './male_last_name_patterns'; +import male_last_name_pattern from './male_last_name_pattern'; import male_prefix from './male_prefix'; import male_title from './male_title'; import name_ from './name'; @@ -21,13 +21,13 @@ import suffix from './suffix'; const person: PersonDefinitions = { female_first_name, female_last_name, - female_last_name_patterns, + female_last_name_pattern, female_prefix, female_title, first_name, male_first_name, male_last_name, - male_last_name_patterns, + male_last_name_pattern, male_prefix, male_title, name: name_, diff --git a/src/locales/id_ID/person/male_last_name_patterns.ts b/src/locales/id_ID/person/male_last_name_pattern.ts similarity index 100% rename from src/locales/id_ID/person/male_last_name_patterns.ts rename to src/locales/id_ID/person/male_last_name_pattern.ts diff --git a/src/locales/it/company/index.ts b/src/locales/it/company/index.ts index ad4d1c3bbdb..1f229c919e4 100644 --- a/src/locales/it/company/index.ts +++ b/src/locales/it/company/index.ts @@ -8,7 +8,7 @@ import buzz_adjective from './buzz_adjective'; import buzz_noun from './buzz_noun'; import buzz_verb from './buzz_verb'; import descriptor from './descriptor'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import noun from './noun'; import suffix from './suffix'; @@ -18,7 +18,7 @@ const company: CompanyDefinitions = { buzz_noun, buzz_verb, descriptor, - name_patterns, + name_pattern, noun, suffix, }; diff --git a/src/locales/it/company/name_patterns.ts b/src/locales/it/company/name_pattern.ts similarity index 100% rename from src/locales/it/company/name_patterns.ts rename to src/locales/it/company/name_pattern.ts diff --git a/src/locales/it/person/index.ts b/src/locales/it/person/index.ts index c54bfc4e322..9a52c4798ac 100644 --- a/src/locales/it/person/index.ts +++ b/src/locales/it/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -19,7 +19,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/it/person/last_name_patterns.ts b/src/locales/it/person/last_name_pattern.ts similarity index 100% rename from src/locales/it/person/last_name_patterns.ts rename to src/locales/it/person/last_name_pattern.ts diff --git a/src/locales/ja/company/index.ts b/src/locales/ja/company/index.ts index eef08ee20cc..2d64004f86c 100644 --- a/src/locales/ja/company/index.ts +++ b/src/locales/ja/company/index.ts @@ -4,12 +4,12 @@ */ import type { CompanyDefinitions } from '../../..'; import category from './category'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import type_ from './type'; const company: CompanyDefinitions = { category, - name_patterns, + name_pattern, type: type_, }; diff --git a/src/locales/ja/company/name_patterns.ts b/src/locales/ja/company/name_pattern.ts similarity index 100% rename from src/locales/ja/company/name_patterns.ts rename to src/locales/ja/company/name_pattern.ts diff --git a/src/locales/ja/person/index.ts b/src/locales/ja/person/index.ts index 89be81cc292..6260df3aece 100644 --- a/src/locales/ja/person/index.ts +++ b/src/locales/ja/person/index.ts @@ -6,7 +6,7 @@ import type { PersonDefinitions } from '../../..'; import female_first_name from './female_first_name'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import name_ from './name'; @@ -14,7 +14,7 @@ const person: PersonDefinitions = { female_first_name, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, name: name_, }; diff --git a/src/locales/ja/person/last_name_patterns.ts b/src/locales/ja/person/last_name_pattern.ts similarity index 100% rename from src/locales/ja/person/last_name_patterns.ts rename to src/locales/ja/person/last_name_pattern.ts diff --git a/src/locales/ka_GE/company/index.ts b/src/locales/ka_GE/company/index.ts index 4e399166244..cd2cb5aadef 100644 --- a/src/locales/ka_GE/company/index.ts +++ b/src/locales/ka_GE/company/index.ts @@ -3,12 +3,12 @@ * Run 'pnpm run generate:locales' to update. */ import type { CompanyDefinitions } from '../../..'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import prefix from './prefix'; import suffix from './suffix'; const company: CompanyDefinitions = { - name_patterns, + name_pattern, prefix, suffix, }; diff --git a/src/locales/ka_GE/company/name_patterns.ts b/src/locales/ka_GE/company/name_pattern.ts similarity index 100% rename from src/locales/ka_GE/company/name_patterns.ts rename to src/locales/ka_GE/company/name_pattern.ts diff --git a/src/locales/ka_GE/person/index.ts b/src/locales/ka_GE/person/index.ts index 0a75e8212a2..c2996892289 100644 --- a/src/locales/ka_GE/person/index.ts +++ b/src/locales/ka_GE/person/index.ts @@ -6,7 +6,7 @@ import type { PersonDefinitions } from '../../..'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_prefix from './male_prefix'; import name_ from './name'; import prefix from './prefix'; @@ -16,7 +16,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_prefix, name: name_, prefix, diff --git a/src/locales/ka_GE/person/last_name_patterns.ts b/src/locales/ka_GE/person/last_name_pattern.ts similarity index 100% rename from src/locales/ka_GE/person/last_name_patterns.ts rename to src/locales/ka_GE/person/last_name_pattern.ts diff --git a/src/locales/ko/company/index.ts b/src/locales/ko/company/index.ts index 4e399166244..cd2cb5aadef 100644 --- a/src/locales/ko/company/index.ts +++ b/src/locales/ko/company/index.ts @@ -3,12 +3,12 @@ * Run 'pnpm run generate:locales' to update. */ import type { CompanyDefinitions } from '../../..'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import prefix from './prefix'; import suffix from './suffix'; const company: CompanyDefinitions = { - name_patterns, + name_pattern, prefix, suffix, }; diff --git a/src/locales/ko/company/name_patterns.ts b/src/locales/ko/company/name_pattern.ts similarity index 100% rename from src/locales/ko/company/name_patterns.ts rename to src/locales/ko/company/name_pattern.ts diff --git a/src/locales/ko/person/index.ts b/src/locales/ko/person/index.ts index 05178280a32..fcfc8c6a483 100644 --- a/src/locales/ko/person/index.ts +++ b/src/locales/ko/person/index.ts @@ -5,13 +5,13 @@ import type { PersonDefinitions } from '../../..'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import name_ from './name'; const person: PersonDefinitions = { first_name, last_name, - last_name_patterns, + last_name_pattern, name: name_, }; diff --git a/src/locales/ko/person/last_name_patterns.ts b/src/locales/ko/person/last_name_pattern.ts similarity index 100% rename from src/locales/ko/person/last_name_patterns.ts rename to src/locales/ko/person/last_name_pattern.ts diff --git a/src/locales/lv/company/index.ts b/src/locales/lv/company/index.ts index 4e399166244..cd2cb5aadef 100644 --- a/src/locales/lv/company/index.ts +++ b/src/locales/lv/company/index.ts @@ -3,12 +3,12 @@ * Run 'pnpm run generate:locales' to update. */ import type { CompanyDefinitions } from '../../..'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import prefix from './prefix'; import suffix from './suffix'; const company: CompanyDefinitions = { - name_patterns, + name_pattern, prefix, suffix, }; diff --git a/src/locales/lv/company/name_patterns.ts b/src/locales/lv/company/name_pattern.ts similarity index 100% rename from src/locales/lv/company/name_patterns.ts rename to src/locales/lv/company/name_pattern.ts diff --git a/src/locales/lv/person/female_last_name_patterns.ts b/src/locales/lv/person/female_last_name_pattern.ts similarity index 100% rename from src/locales/lv/person/female_last_name_patterns.ts rename to src/locales/lv/person/female_last_name_pattern.ts diff --git a/src/locales/lv/person/index.ts b/src/locales/lv/person/index.ts index ac331974baf..8bb5cf7682a 100644 --- a/src/locales/lv/person/index.ts +++ b/src/locales/lv/person/index.ts @@ -5,12 +5,12 @@ import type { PersonDefinitions } from '../../..'; import female_first_name from './female_first_name'; import female_last_name from './female_last_name'; -import female_last_name_patterns from './female_last_name_patterns'; +import female_last_name_pattern from './female_last_name_pattern'; import female_prefix from './female_prefix'; import first_name from './first_name'; import male_first_name from './male_first_name'; import male_last_name from './male_last_name'; -import male_last_name_patterns from './male_last_name_patterns'; +import male_last_name_pattern from './male_last_name_pattern'; import male_prefix from './male_prefix'; import name_ from './name'; import prefix from './prefix'; @@ -20,12 +20,12 @@ import title from './title'; const person: PersonDefinitions = { female_first_name, female_last_name, - female_last_name_patterns, + female_last_name_pattern, female_prefix, first_name, male_first_name, male_last_name, - male_last_name_patterns, + male_last_name_pattern, male_prefix, name: name_, prefix, diff --git a/src/locales/lv/person/male_last_name_patterns.ts b/src/locales/lv/person/male_last_name_pattern.ts similarity index 100% rename from src/locales/lv/person/male_last_name_patterns.ts rename to src/locales/lv/person/male_last_name_pattern.ts diff --git a/src/locales/mk/company/index.ts b/src/locales/mk/company/index.ts index 94e1daa3406..ca8066865e2 100644 --- a/src/locales/mk/company/index.ts +++ b/src/locales/mk/company/index.ts @@ -3,11 +3,11 @@ * Run 'pnpm run generate:locales' to update. */ import type { CompanyDefinitions } from '../../..'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import suffix from './suffix'; const company: CompanyDefinitions = { - name_patterns, + name_pattern, suffix, }; diff --git a/src/locales/mk/company/name_patterns.ts b/src/locales/mk/company/name_pattern.ts similarity index 100% rename from src/locales/mk/company/name_patterns.ts rename to src/locales/mk/company/name_pattern.ts diff --git a/src/locales/mk/person/female_last_name_patterns.ts b/src/locales/mk/person/female_last_name_pattern.ts similarity index 100% rename from src/locales/mk/person/female_last_name_patterns.ts rename to src/locales/mk/person/female_last_name_pattern.ts diff --git a/src/locales/mk/person/index.ts b/src/locales/mk/person/index.ts index 80ee56cc540..2e9383902f5 100644 --- a/src/locales/mk/person/index.ts +++ b/src/locales/mk/person/index.ts @@ -5,13 +5,13 @@ import type { PersonDefinitions } from '../../..'; import female_first_name from './female_first_name'; import female_last_name from './female_last_name'; -import female_last_name_patterns from './female_last_name_patterns'; +import female_last_name_pattern from './female_last_name_pattern'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; import male_first_name from './male_first_name'; import male_last_name from './male_last_name'; -import male_last_name_patterns from './male_last_name_patterns'; +import male_last_name_pattern from './male_last_name_pattern'; import male_prefix from './male_prefix'; import name_ from './name'; import prefix from './prefix'; @@ -21,13 +21,13 @@ import title from './title'; const person: PersonDefinitions = { female_first_name, female_last_name, - female_last_name_patterns, + female_last_name_pattern, female_prefix, first_name, last_name, male_first_name, male_last_name, - male_last_name_patterns, + male_last_name_pattern, male_prefix, name: name_, prefix, diff --git a/src/locales/mk/person/male_last_name_patterns.ts b/src/locales/mk/person/male_last_name_pattern.ts similarity index 100% rename from src/locales/mk/person/male_last_name_patterns.ts rename to src/locales/mk/person/male_last_name_pattern.ts diff --git a/src/locales/nb_NO/company/index.ts b/src/locales/nb_NO/company/index.ts index 94e1daa3406..ca8066865e2 100644 --- a/src/locales/nb_NO/company/index.ts +++ b/src/locales/nb_NO/company/index.ts @@ -3,11 +3,11 @@ * Run 'pnpm run generate:locales' to update. */ import type { CompanyDefinitions } from '../../..'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import suffix from './suffix'; const company: CompanyDefinitions = { - name_patterns, + name_pattern, suffix, }; diff --git a/src/locales/nb_NO/company/name_patterns.ts b/src/locales/nb_NO/company/name_pattern.ts similarity index 100% rename from src/locales/nb_NO/company/name_patterns.ts rename to src/locales/nb_NO/company/name_pattern.ts diff --git a/src/locales/nb_NO/person/index.ts b/src/locales/nb_NO/person/index.ts index c54bfc4e322..9a52c4798ac 100644 --- a/src/locales/nb_NO/person/index.ts +++ b/src/locales/nb_NO/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -19,7 +19,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/nb_NO/person/last_name_patterns.ts b/src/locales/nb_NO/person/last_name_pattern.ts similarity index 100% rename from src/locales/nb_NO/person/last_name_patterns.ts rename to src/locales/nb_NO/person/last_name_pattern.ts diff --git a/src/locales/ne/person/index.ts b/src/locales/ne/person/index.ts index 3b898ef83ff..c8cf328dfc4 100644 --- a/src/locales/ne/person/index.ts +++ b/src/locales/ne/person/index.ts @@ -6,14 +6,14 @@ import type { PersonDefinitions } from '../../..'; import female_first_name from './female_first_name'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; const person: PersonDefinitions = { female_first_name, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, }; diff --git a/src/locales/ne/person/last_name_patterns.ts b/src/locales/ne/person/last_name_pattern.ts similarity index 100% rename from src/locales/ne/person/last_name_patterns.ts rename to src/locales/ne/person/last_name_pattern.ts diff --git a/src/locales/nl/person/index.ts b/src/locales/nl/person/index.ts index c54bfc4e322..9a52c4798ac 100644 --- a/src/locales/nl/person/index.ts +++ b/src/locales/nl/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -19,7 +19,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/nl/person/last_name_patterns.ts b/src/locales/nl/person/last_name_pattern.ts similarity index 100% rename from src/locales/nl/person/last_name_patterns.ts rename to src/locales/nl/person/last_name_pattern.ts diff --git a/src/locales/nl_BE/person/index.ts b/src/locales/nl_BE/person/index.ts index c54bfc4e322..9a52c4798ac 100644 --- a/src/locales/nl_BE/person/index.ts +++ b/src/locales/nl_BE/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -19,7 +19,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/nl_BE/person/last_name_patterns.ts b/src/locales/nl_BE/person/last_name_pattern.ts similarity index 100% rename from src/locales/nl_BE/person/last_name_patterns.ts rename to src/locales/nl_BE/person/last_name_pattern.ts diff --git a/src/locales/pl/company/index.ts b/src/locales/pl/company/index.ts index 94e1daa3406..ca8066865e2 100644 --- a/src/locales/pl/company/index.ts +++ b/src/locales/pl/company/index.ts @@ -3,11 +3,11 @@ * Run 'pnpm run generate:locales' to update. */ import type { CompanyDefinitions } from '../../..'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import suffix from './suffix'; const company: CompanyDefinitions = { - name_patterns, + name_pattern, suffix, }; diff --git a/src/locales/pl/company/name_patterns.ts b/src/locales/pl/company/name_pattern.ts similarity index 100% rename from src/locales/pl/company/name_patterns.ts rename to src/locales/pl/company/name_pattern.ts diff --git a/src/locales/pl/person/index.ts b/src/locales/pl/person/index.ts index 58a5e8d6e85..2a877d358e9 100644 --- a/src/locales/pl/person/index.ts +++ b/src/locales/pl/person/index.ts @@ -8,7 +8,7 @@ import female_prefix from './female_prefix'; import first_name from './first_name'; import gender from './gender'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -22,7 +22,7 @@ const person: PersonDefinitions = { first_name, gender, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/pl/person/last_name_patterns.ts b/src/locales/pl/person/last_name_pattern.ts similarity index 100% rename from src/locales/pl/person/last_name_patterns.ts rename to src/locales/pl/person/last_name_pattern.ts diff --git a/src/locales/pt_BR/company/index.ts b/src/locales/pt_BR/company/index.ts index 94e1daa3406..ca8066865e2 100644 --- a/src/locales/pt_BR/company/index.ts +++ b/src/locales/pt_BR/company/index.ts @@ -3,11 +3,11 @@ * Run 'pnpm run generate:locales' to update. */ import type { CompanyDefinitions } from '../../..'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import suffix from './suffix'; const company: CompanyDefinitions = { - name_patterns, + name_pattern, suffix, }; diff --git a/src/locales/pt_BR/company/name_patterns.ts b/src/locales/pt_BR/company/name_pattern.ts similarity index 100% rename from src/locales/pt_BR/company/name_patterns.ts rename to src/locales/pt_BR/company/name_pattern.ts diff --git a/src/locales/pt_BR/person/index.ts b/src/locales/pt_BR/person/index.ts index f1580215c65..5610a639eba 100644 --- a/src/locales/pt_BR/person/index.ts +++ b/src/locales/pt_BR/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -22,7 +22,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/pt_BR/person/last_name_patterns.ts b/src/locales/pt_BR/person/last_name_pattern.ts similarity index 100% rename from src/locales/pt_BR/person/last_name_patterns.ts rename to src/locales/pt_BR/person/last_name_pattern.ts diff --git a/src/locales/pt_PT/person/index.ts b/src/locales/pt_PT/person/index.ts index c54bfc4e322..9a52c4798ac 100644 --- a/src/locales/pt_PT/person/index.ts +++ b/src/locales/pt_PT/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -19,7 +19,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/pt_PT/person/last_name_patterns.ts b/src/locales/pt_PT/person/last_name_pattern.ts similarity index 100% rename from src/locales/pt_PT/person/last_name_patterns.ts rename to src/locales/pt_PT/person/last_name_pattern.ts diff --git a/src/locales/ro/person/index.ts b/src/locales/ro/person/index.ts index c54bfc4e322..9a52c4798ac 100644 --- a/src/locales/ro/person/index.ts +++ b/src/locales/ro/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -19,7 +19,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/ro/person/last_name_patterns.ts b/src/locales/ro/person/last_name_pattern.ts similarity index 100% rename from src/locales/ro/person/last_name_patterns.ts rename to src/locales/ro/person/last_name_pattern.ts diff --git a/src/locales/ru/company/index.ts b/src/locales/ru/company/index.ts index 4e399166244..cd2cb5aadef 100644 --- a/src/locales/ru/company/index.ts +++ b/src/locales/ru/company/index.ts @@ -3,12 +3,12 @@ * Run 'pnpm run generate:locales' to update. */ import type { CompanyDefinitions } from '../../..'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import prefix from './prefix'; import suffix from './suffix'; const company: CompanyDefinitions = { - name_patterns, + name_pattern, prefix, suffix, }; diff --git a/src/locales/ru/company/name_patterns.ts b/src/locales/ru/company/name_pattern.ts similarity index 100% rename from src/locales/ru/company/name_patterns.ts rename to src/locales/ru/company/name_pattern.ts diff --git a/src/locales/ru/person/female_last_name_patterns.ts b/src/locales/ru/person/female_last_name_pattern.ts similarity index 100% rename from src/locales/ru/person/female_last_name_patterns.ts rename to src/locales/ru/person/female_last_name_pattern.ts diff --git a/src/locales/ru/person/index.ts b/src/locales/ru/person/index.ts index bf7566b403f..507a451a60f 100644 --- a/src/locales/ru/person/index.ts +++ b/src/locales/ru/person/index.ts @@ -5,13 +5,13 @@ import type { PersonDefinitions } from '../../..'; import female_first_name from './female_first_name'; import female_last_name from './female_last_name'; -import female_last_name_patterns from './female_last_name_patterns'; +import female_last_name_pattern from './female_last_name_pattern'; import female_middle_name from './female_middle_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import male_first_name from './male_first_name'; import male_last_name from './male_last_name'; -import male_last_name_patterns from './male_last_name_patterns'; +import male_last_name_pattern from './male_last_name_pattern'; import male_middle_name from './male_middle_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -22,13 +22,13 @@ import title from './title'; const person: PersonDefinitions = { female_first_name, female_last_name, - female_last_name_patterns, + female_last_name_pattern, female_middle_name, female_prefix, first_name, male_first_name, male_last_name, - male_last_name_patterns, + male_last_name_pattern, male_middle_name, male_prefix, name: name_, diff --git a/src/locales/ru/person/male_last_name_patterns.ts b/src/locales/ru/person/male_last_name_pattern.ts similarity index 100% rename from src/locales/ru/person/male_last_name_patterns.ts rename to src/locales/ru/person/male_last_name_pattern.ts diff --git a/src/locales/sk/company/index.ts b/src/locales/sk/company/index.ts index 94e1daa3406..ca8066865e2 100644 --- a/src/locales/sk/company/index.ts +++ b/src/locales/sk/company/index.ts @@ -3,11 +3,11 @@ * Run 'pnpm run generate:locales' to update. */ import type { CompanyDefinitions } from '../../..'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import suffix from './suffix'; const company: CompanyDefinitions = { - name_patterns, + name_pattern, suffix, }; diff --git a/src/locales/sk/company/name_patterns.ts b/src/locales/sk/company/name_pattern.ts similarity index 100% rename from src/locales/sk/company/name_patterns.ts rename to src/locales/sk/company/name_pattern.ts diff --git a/src/locales/sk/person/female_last_name_patterns.ts b/src/locales/sk/person/female_last_name_pattern.ts similarity index 100% rename from src/locales/sk/person/female_last_name_patterns.ts rename to src/locales/sk/person/female_last_name_pattern.ts diff --git a/src/locales/sk/person/index.ts b/src/locales/sk/person/index.ts index ac331974baf..8bb5cf7682a 100644 --- a/src/locales/sk/person/index.ts +++ b/src/locales/sk/person/index.ts @@ -5,12 +5,12 @@ import type { PersonDefinitions } from '../../..'; import female_first_name from './female_first_name'; import female_last_name from './female_last_name'; -import female_last_name_patterns from './female_last_name_patterns'; +import female_last_name_pattern from './female_last_name_pattern'; import female_prefix from './female_prefix'; import first_name from './first_name'; import male_first_name from './male_first_name'; import male_last_name from './male_last_name'; -import male_last_name_patterns from './male_last_name_patterns'; +import male_last_name_pattern from './male_last_name_pattern'; import male_prefix from './male_prefix'; import name_ from './name'; import prefix from './prefix'; @@ -20,12 +20,12 @@ import title from './title'; const person: PersonDefinitions = { female_first_name, female_last_name, - female_last_name_patterns, + female_last_name_pattern, female_prefix, first_name, male_first_name, male_last_name, - male_last_name_patterns, + male_last_name_pattern, male_prefix, name: name_, prefix, diff --git a/src/locales/sk/person/male_last_name_patterns.ts b/src/locales/sk/person/male_last_name_pattern.ts similarity index 100% rename from src/locales/sk/person/male_last_name_patterns.ts rename to src/locales/sk/person/male_last_name_pattern.ts diff --git a/src/locales/sv/company/index.ts b/src/locales/sv/company/index.ts index 94e1daa3406..ca8066865e2 100644 --- a/src/locales/sv/company/index.ts +++ b/src/locales/sv/company/index.ts @@ -3,11 +3,11 @@ * Run 'pnpm run generate:locales' to update. */ import type { CompanyDefinitions } from '../../..'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import suffix from './suffix'; const company: CompanyDefinitions = { - name_patterns, + name_pattern, suffix, }; diff --git a/src/locales/sv/company/name_patterns.ts b/src/locales/sv/company/name_pattern.ts similarity index 100% rename from src/locales/sv/company/name_patterns.ts rename to src/locales/sv/company/name_pattern.ts diff --git a/src/locales/sv/person/index.ts b/src/locales/sv/person/index.ts index b12b544e80d..0284b3386de 100644 --- a/src/locales/sv/person/index.ts +++ b/src/locales/sv/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -19,7 +19,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/sv/person/last_name_patterns.ts b/src/locales/sv/person/last_name_pattern.ts similarity index 100% rename from src/locales/sv/person/last_name_patterns.ts rename to src/locales/sv/person/last_name_pattern.ts diff --git a/src/locales/tr/person/index.ts b/src/locales/tr/person/index.ts index 83b511ea248..d22a45c2a5e 100644 --- a/src/locales/tr/person/index.ts +++ b/src/locales/tr/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -18,7 +18,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/tr/person/last_name_patterns.ts b/src/locales/tr/person/last_name_pattern.ts similarity index 100% rename from src/locales/tr/person/last_name_patterns.ts rename to src/locales/tr/person/last_name_pattern.ts diff --git a/src/locales/uk/company/index.ts b/src/locales/uk/company/index.ts index 4e399166244..cd2cb5aadef 100644 --- a/src/locales/uk/company/index.ts +++ b/src/locales/uk/company/index.ts @@ -3,12 +3,12 @@ * Run 'pnpm run generate:locales' to update. */ import type { CompanyDefinitions } from '../../..'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import prefix from './prefix'; import suffix from './suffix'; const company: CompanyDefinitions = { - name_patterns, + name_pattern, prefix, suffix, }; diff --git a/src/locales/uk/company/name_patterns.ts b/src/locales/uk/company/name_pattern.ts similarity index 100% rename from src/locales/uk/company/name_patterns.ts rename to src/locales/uk/company/name_pattern.ts diff --git a/src/locales/uk/person/female_last_name_patterns.ts b/src/locales/uk/person/female_last_name_pattern.ts similarity index 100% rename from src/locales/uk/person/female_last_name_patterns.ts rename to src/locales/uk/person/female_last_name_pattern.ts diff --git a/src/locales/uk/person/index.ts b/src/locales/uk/person/index.ts index bf7566b403f..507a451a60f 100644 --- a/src/locales/uk/person/index.ts +++ b/src/locales/uk/person/index.ts @@ -5,13 +5,13 @@ import type { PersonDefinitions } from '../../..'; import female_first_name from './female_first_name'; import female_last_name from './female_last_name'; -import female_last_name_patterns from './female_last_name_patterns'; +import female_last_name_pattern from './female_last_name_pattern'; import female_middle_name from './female_middle_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import male_first_name from './male_first_name'; import male_last_name from './male_last_name'; -import male_last_name_patterns from './male_last_name_patterns'; +import male_last_name_pattern from './male_last_name_pattern'; import male_middle_name from './male_middle_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -22,13 +22,13 @@ import title from './title'; const person: PersonDefinitions = { female_first_name, female_last_name, - female_last_name_patterns, + female_last_name_pattern, female_middle_name, female_prefix, first_name, male_first_name, male_last_name, - male_last_name_patterns, + male_last_name_pattern, male_middle_name, male_prefix, name: name_, diff --git a/src/locales/uk/person/male_last_name_patterns.ts b/src/locales/uk/person/male_last_name_pattern.ts similarity index 100% rename from src/locales/uk/person/male_last_name_patterns.ts rename to src/locales/uk/person/male_last_name_pattern.ts diff --git a/src/locales/ur/person/index.ts b/src/locales/ur/person/index.ts index f3d560fd76f..1919cc045db 100644 --- a/src/locales/ur/person/index.ts +++ b/src/locales/ur/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -21,7 +21,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/ur/person/last_name_patterns.ts b/src/locales/ur/person/last_name_pattern.ts similarity index 100% rename from src/locales/ur/person/last_name_patterns.ts rename to src/locales/ur/person/last_name_pattern.ts diff --git a/src/locales/vi/company/index.ts b/src/locales/vi/company/index.ts index ff850f20334..c7ef5912dc5 100644 --- a/src/locales/vi/company/index.ts +++ b/src/locales/vi/company/index.ts @@ -3,11 +3,11 @@ * Run 'pnpm run generate:locales' to update. */ import type { CompanyDefinitions } from '../../..'; -import name_patterns from './name_patterns'; +import name_pattern from './name_pattern'; import prefix from './prefix'; const company: CompanyDefinitions = { - name_patterns, + name_pattern, prefix, }; diff --git a/src/locales/vi/company/name_patterns.ts b/src/locales/vi/company/name_pattern.ts similarity index 100% rename from src/locales/vi/company/name_patterns.ts rename to src/locales/vi/company/name_pattern.ts diff --git a/src/locales/vi/person/index.ts b/src/locales/vi/person/index.ts index 89be81cc292..6260df3aece 100644 --- a/src/locales/vi/person/index.ts +++ b/src/locales/vi/person/index.ts @@ -6,7 +6,7 @@ import type { PersonDefinitions } from '../../..'; import female_first_name from './female_first_name'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import name_ from './name'; @@ -14,7 +14,7 @@ const person: PersonDefinitions = { female_first_name, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, name: name_, }; diff --git a/src/locales/vi/person/last_name_patterns.ts b/src/locales/vi/person/last_name_pattern.ts similarity index 100% rename from src/locales/vi/person/last_name_patterns.ts rename to src/locales/vi/person/last_name_pattern.ts diff --git a/src/locales/zh_CN/person/index.ts b/src/locales/zh_CN/person/index.ts index 83b511ea248..d22a45c2a5e 100644 --- a/src/locales/zh_CN/person/index.ts +++ b/src/locales/zh_CN/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -18,7 +18,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/zh_CN/person/last_name_patterns.ts b/src/locales/zh_CN/person/last_name_pattern.ts similarity index 100% rename from src/locales/zh_CN/person/last_name_patterns.ts rename to src/locales/zh_CN/person/last_name_pattern.ts diff --git a/src/locales/zh_TW/person/index.ts b/src/locales/zh_TW/person/index.ts index 83b511ea248..d22a45c2a5e 100644 --- a/src/locales/zh_TW/person/index.ts +++ b/src/locales/zh_TW/person/index.ts @@ -7,7 +7,7 @@ import female_first_name from './female_first_name'; import female_prefix from './female_prefix'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; import male_prefix from './male_prefix'; import name_ from './name'; @@ -18,7 +18,7 @@ const person: PersonDefinitions = { female_prefix, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, male_prefix, name: name_, diff --git a/src/locales/zh_TW/person/last_name_patterns.ts b/src/locales/zh_TW/person/last_name_pattern.ts similarity index 100% rename from src/locales/zh_TW/person/last_name_patterns.ts rename to src/locales/zh_TW/person/last_name_pattern.ts diff --git a/src/locales/zu_ZA/person/index.ts b/src/locales/zu_ZA/person/index.ts index 3b898ef83ff..c8cf328dfc4 100644 --- a/src/locales/zu_ZA/person/index.ts +++ b/src/locales/zu_ZA/person/index.ts @@ -6,14 +6,14 @@ import type { PersonDefinitions } from '../../..'; import female_first_name from './female_first_name'; import first_name from './first_name'; import last_name from './last_name'; -import last_name_patterns from './last_name_patterns'; +import last_name_pattern from './last_name_pattern'; import male_first_name from './male_first_name'; const person: PersonDefinitions = { female_first_name, first_name, last_name, - last_name_patterns, + last_name_pattern, male_first_name, }; diff --git a/src/locales/zu_ZA/person/last_name_patterns.ts b/src/locales/zu_ZA/person/last_name_pattern.ts similarity index 100% rename from src/locales/zu_ZA/person/last_name_patterns.ts rename to src/locales/zu_ZA/person/last_name_pattern.ts diff --git a/src/modules/company/index.ts b/src/modules/company/index.ts index 98dc2c6805c..40177ec0f82 100644 --- a/src/modules/company/index.ts +++ b/src/modules/company/index.ts @@ -62,9 +62,7 @@ export class CompanyModule { * @since 7.4.0 */ name(): string { - return this.faker.helpers.fake( - this.faker.definitions.company.name_patterns - ); + return this.faker.helpers.fake(this.faker.definitions.company.name_pattern); } /** diff --git a/src/modules/finance/index.ts b/src/modules/finance/index.ts index 579bd89bcd9..cca634c0520 100644 --- a/src/modules/finance/index.ts +++ b/src/modules/finance/index.ts @@ -839,6 +839,7 @@ export class FinanceModule { * Generates a random PIN number. * * @param length The length of the PIN to generate. Defaults to `4`. + * * @throws Will throw an error if length is less than 1. * * @example @@ -853,6 +854,7 @@ export class FinanceModule { * * @param options An options object. Defaults to `{}`. * @param options.length The length of the PIN to generate. Defaults to `4`. + * * @throws Will throw an error if length is less than 1. * * @example @@ -874,6 +876,7 @@ export class FinanceModule { * * @param options An options object or the length of the PIN. Defaults to `{}`. * @param options.length The length of the PIN to generate. Defaults to `4`. + * * @throws Will throw an error if length is less than 1. * * @example @@ -900,6 +903,7 @@ export class FinanceModule { * * @param options An options object or the length of the PIN. Defaults to `{}`. * @param options.length The length of the PIN to generate. Defaults to `4`. + * * @throws Will throw an error if length is less than 1. * * @example @@ -957,6 +961,7 @@ export class FinanceModule { * * @param formatted Return a formatted version of the generated IBAN. Defaults to `false`. * @param countryCode The country code from which you want to generate an IBAN, if none is provided a random country will be used. + * * @throws Will throw an error if the passed country code is not supported. * * @example @@ -973,6 +978,7 @@ export class FinanceModule { * @param options An options object. Defaults to `{}`. * @param options.formatted Return a formatted version of the generated IBAN. Defaults to `false`. * @param options.countryCode The country code from which you want to generate an IBAN, if none is provided a random country will be used. + * * @throws Will throw an error if the passed country code is not supported. * * @example diff --git a/src/modules/git/index.ts b/src/modules/git/index.ts index 81e79af0447..791ea06b22d 100644 --- a/src/modules/git/index.ts +++ b/src/modules/git/index.ts @@ -62,7 +62,6 @@ export class GitModule { * @param options.eol Choose the end of line character to use. Defaults to 'CRLF'. * 'LF' = '\n', * 'CRLF' = '\r\n' - * * @param options.refDate The date to use as reference point for the commit. Defaults to `new Date()`. * * @example diff --git a/src/modules/helpers/index.ts b/src/modules/helpers/index.ts index 937fe21cc30..d90bcbda0d9 100644 --- a/src/modules/helpers/index.ts +++ b/src/modules/helpers/index.ts @@ -555,6 +555,7 @@ export class HelpersModule { * Takes an array and randomizes it in place then returns it. * * @template T The type of the elements to shuffle. + * * @param list The array to shuffle. * @param options The options to use when shuffling. * @param options.inplace Whether to shuffle the array in place or return a new array. Defaults to `false`. @@ -579,6 +580,7 @@ export class HelpersModule { * Returns a randomized version of the array. * * @template T The type of the elements to shuffle. + * * @param list The array to shuffle. * @param options The options to use when shuffling. * @param options.inplace Whether to shuffle the array in place or return a new array. Defaults to `false`. @@ -604,6 +606,7 @@ export class HelpersModule { * Returns a randomized version of the array. * * @template T The type of the elements to shuffle. + * * @param list The array to shuffle. * @param options The options to use when shuffling. * @param options.inplace Whether to shuffle the array in place or return a new array. Defaults to `false`. @@ -647,6 +650,7 @@ export class HelpersModule { * This method does not store the unique state between invocations. * * @template T The type of the elements. + * * @param source The strings to choose from or a function that generates a string. * @param length The number of elements to generate. * @@ -721,6 +725,7 @@ export class HelpersModule { * Returns the result of the callback if the probability check was successful, otherwise `undefined`. * * @template T The type of result of the given callback. + * * @param callback The callback to that will be invoked if the probability check was successful. * @param options The options to use. Defaults to `{}`. * @param options.probability The probability (`[0.00, 1.00]`) of the callback being invoked. Defaults to `0.5`. @@ -754,6 +759,7 @@ export class HelpersModule { * Returns a random key from given object or `undefined` if no key could be found. * * @template T The type of the object to select from. + * * @param object The object to be used. * * @example @@ -770,6 +776,7 @@ export class HelpersModule { * Returns a random value from given object or `undefined` if no key could be found. * * @template T The type of object to select from. + * * @param object The object to be used. * * @example @@ -786,6 +793,7 @@ export class HelpersModule { * Returns random element from the given array. * * @template T The type of the elements to pick from. + * * @param array Array to pick the value from. * * @example @@ -813,6 +821,7 @@ export class HelpersModule { * For example, if there are two values A and B, with weights 1 and 2 respectively, then the probability of picking A is 1/3 and the probability of picking B is 2/3. * * @template T The type of the elements to pick from. + * * @param array Array to pick the value from. * @param array[].weight The weight of the value. * @param array[].value The value to pick. @@ -868,6 +877,7 @@ export class HelpersModule { * Returns a subset with random elements of the given array in random order. * * @template T The type of the elements to pick from. + * * @param array Array to pick the value from. * @param count Number or range of elements to pick. * When not provided, random number of elements will be picked. @@ -934,6 +944,7 @@ export class HelpersModule { * This does the same as `objectValue` except that it ignores (the values assigned to) the numeric keys added for TypeScript enums. * * @template EnumType Type of generic enums, automatically inferred by TypeScript. + * * @param enumObject Enum to pick the value from. * * @example @@ -1228,6 +1239,7 @@ export class HelpersModule { * Used unique entries will be stored internally and filtered from subsequent calls. * * @template Method The type of the method to execute. + * * @param method The method used to generate the values. * @param args The arguments used to call the method. * @param options The optional options used to configure this method. @@ -1251,7 +1263,7 @@ export class HelpersModule { */ unique< Method extends ( - // TODO christopher 2023-02-14: This `any` type can be fixed by anyone if they want to. + // TODO @Shinigami92 2023-02-14: This `any` type can be fixed by anyone if they want to. // eslint-disable-next-line @typescript-eslint/no-explicit-any ...parameters: any[] ) => RecordKey @@ -1327,6 +1339,7 @@ export class HelpersModule { * Generates an array containing values returned by the given method. * * @template T The type of elements. + * * @param method The method used to generate the values. * @param options The optional options object. * @param options.count The number or range of elements to generate. Defaults to `3`. diff --git a/src/modules/helpers/unique.ts b/src/modules/helpers/unique.ts index c6668137c27..5cf55a66edd 100644 --- a/src/modules/helpers/unique.ts +++ b/src/modules/helpers/unique.ts @@ -70,6 +70,7 @@ Try adjusting maxTime or maxRetries parameters for faker.helpers.unique().` * Used unique entries will be stored internally and filtered from subsequent calls. * * @template Method The type of the method to execute. + * * @param method The method used to generate the values. * @param args The arguments used to call the method. * @param options The optional options used to configure this method. @@ -83,7 +84,7 @@ Try adjusting maxTime or maxRetries parameters for faker.helpers.unique().` */ export function exec< Method extends ( - // TODO christopher 2023-02-14: This `any` type can be fixed by anyone if they want to. + // TODO @Shinigami92 2023-02-14: This `any` type can be fixed by anyone if they want to. // eslint-disable-next-line @typescript-eslint/no-explicit-any ...parameters: any[] ) => RecordKey diff --git a/src/modules/image/index.ts b/src/modules/image/index.ts index cce875ba5f5..e7d268141e2 100644 --- a/src/modules/image/index.ts +++ b/src/modules/image/index.ts @@ -16,7 +16,7 @@ import { Unsplash } from './providers/unsplash'; * * For a random user avatar image, use [`avatar()`](https://next.fakerjs.dev/api/image.html#avatar). * - * This module previously also contained methods for specifically themed images like "fashion" or "food", but these are now deprecated. If you need more control over image type, you are recommended to use an image provider directly or provide your own set of placeholder images. + * This module previously also contained methods for specifically themed images like "fashion" or "food", but these are now deprecated. If you need more control over image type, you can request categorized images using [`urlLoremFlickr()`](https://next.fakerjs.dev/api/image.html#urlloremflickr), use an image provider directly or provide your own set of placeholder images. */ export class ImageModule { /** @@ -501,6 +501,9 @@ export class ImageModule { * @param height The height of the image. Defaults to `480`. * @param randomize Whether to randomize the image or not. Defaults to `false`. * + * @see faker.image.url() + * @see faker.image.urlLoremFlickr() + * * @example * faker.image.abstract() // 'https://loremflickr.com/640/480/abstract' * faker.image.abstract(1234, 2345) // 'https://loremflickr.com/1234/2345/abstract' @@ -508,12 +511,14 @@ export class ImageModule { * * @since 2.0.1 * - * @deprecated Use `faker.image.url` instead. + * @deprecated Use `faker.image.urlLoremFlickr({ category: 'abstract' })` if you want an image from LoremFlickr in the correct category, or `faker.image.url()` if you just want any image. + * */ abstract(width?: number, height?: number, randomize?: boolean): string { deprecated({ deprecated: 'faker.image.abstract', - proposed: 'faker.image.url', + proposed: + "faker.image.urlLoremFlickr({ category: 'abstract' }) or faker.image.url", since: '8.0', until: '9.0', }); @@ -528,6 +533,9 @@ export class ImageModule { * @param height The height of the image. Defaults to `480`. * @param randomize Whether to randomize the image or not. Defaults to `false`. * + * @see faker.image.url() + * @see faker.image.urlLoremFlickr() + * * @example * faker.image.animals() // 'https://loremflickr.com/640/480/animals' * faker.image.animals(1234, 2345) // 'https://loremflickr.com/1234/2345/animals' @@ -535,12 +543,14 @@ export class ImageModule { * * @since 2.0.1 * - * @deprecated Use `faker.image.url` instead. + * @deprecated Use `faker.image.urlLoremFlickr({ category: 'animals' })` if you want an image from LoremFlickr in the correct category, or `faker.image.url()` if you just want any image. + * */ animals(width?: number, height?: number, randomize?: boolean): string { deprecated({ deprecated: 'faker.image.animals', - proposed: 'faker.image.url', + proposed: + "faker.image.urlLoremFlickr({ category: 'animals' }) or faker.image.url", since: '8.0', until: '9.0', }); @@ -555,6 +565,9 @@ export class ImageModule { * @param height The height of the image. Defaults to `480`. * @param randomize Whether to randomize the image or not. Defaults to `false`. * + * @see faker.image.url() + * @see faker.image.urlLoremFlickr() + * * @example * faker.image.business() // 'https://loremflickr.com/640/480/business' * faker.image.business(1234, 2345) // 'https://loremflickr.com/1234/2345/business' @@ -562,12 +575,15 @@ export class ImageModule { * * @since 2.0.1 * - * @deprecated Use `faker.image.url` instead. + * @deprecated Use `faker.image.urlLoremFlickr({ category: 'business' })` if you want an image from LoremFlickr in the correct category, or `faker.image.url()` if you just want any image. + * + * */ business(width?: number, height?: number, randomize?: boolean): string { deprecated({ deprecated: 'faker.image.business', - proposed: 'faker.image.url', + proposed: + "faker.image.urlLoremFlickr({ category: 'business' }) or faker.image.url", since: '8.0', until: '9.0', }); @@ -582,6 +598,9 @@ export class ImageModule { * @param height The height of the image. Defaults to `480`. * @param randomize Whether to randomize the image or not. Defaults to `false`. * + * @see faker.image.url() + * @see faker.image.urlLoremFlickr() + * * @example * faker.image.cats() // 'https://loremflickr.com/640/480/cats' * faker.image.cats(1234, 2345) // 'https://loremflickr.com/1234/2345/cats' @@ -589,12 +608,13 @@ export class ImageModule { * * @since 2.0.1 * - * @deprecated Use `faker.image.url` instead. + * @deprecated Use `faker.image.urlLoremFlickr({ category: 'cats' })` if you want an image from LoremFlickr in the correct category, or `faker.image.url()` if you just want any image. */ cats(width?: number, height?: number, randomize?: boolean): string { deprecated({ deprecated: 'faker.image.cats', - proposed: 'faker.image.url', + proposed: + "faker.image.urlLoremFlickr({ category: 'cats' }) or faker.image.url", since: '8.0', until: '9.0', }); @@ -609,6 +629,9 @@ export class ImageModule { * @param height The height of the image. Defaults to `480`. * @param randomize Whether to randomize the image or not. Defaults to `false`. * + * @see faker.image.url() + * @see faker.image.urlLoremFlickr() + * * @example * faker.image.city() // 'https://loremflickr.com/640/480/city' * faker.image.city(1234, 2345) // 'https://loremflickr.com/1234/2345/city' @@ -616,12 +639,13 @@ export class ImageModule { * * @since 2.0.1 * - * @deprecated Use `faker.image.url` instead. + * @deprecated Use `faker.image.urlLoremFlickr({ category: 'city' })` if you want an image from LoremFlickr in the correct category, or `faker.image.url()` if you just want any image. */ city(width?: number, height?: number, randomize?: boolean): string { deprecated({ deprecated: 'faker.image.city', - proposed: 'faker.image.url', + proposed: + "faker.image.urlLoremFlickr({ category: 'city' }) or faker.image.url", since: '8.0', until: '9.0', }); @@ -636,6 +660,9 @@ export class ImageModule { * @param height The height of the image. Defaults to `480`. * @param randomize Whether to randomize the image or not. Defaults to `false`. * + * @see faker.image.url() + * @see faker.image.urlLoremFlickr() + * * @example * faker.image.food() // 'https://loremflickr.com/640/480/food' * faker.image.food(1234, 2345) // 'https://loremflickr.com/1234/2345/food' @@ -643,12 +670,13 @@ export class ImageModule { * * @since 2.0.1 * - * @deprecated Use `faker.image.url` instead. + * @deprecated Use `faker.image.urlLoremFlickr({ category: 'food' })` if you want an image from LoremFlickr in the correct category, or `faker.image.url()` if you just want any image. */ food(width?: number, height?: number, randomize?: boolean): string { deprecated({ deprecated: 'faker.image.food', - proposed: 'faker.image.url', + proposed: + "faker.image.urlLoremFlickr({ category: 'food' }) or faker.image.url", since: '8.0', until: '9.0', }); @@ -663,6 +691,9 @@ export class ImageModule { * @param height The height of the image. Defaults to `480`. * @param randomize Whether to randomize the image or not. Defaults to `false`. * + * @see faker.image.url() + * @see faker.image.urlLoremFlickr() + * * @example * faker.image.nightlife() // 'https://loremflickr.com/640/480/nightlife' * faker.image.nightlife(1234, 2345) // 'https://loremflickr.com/1234/2345/nightlife' @@ -670,12 +701,13 @@ export class ImageModule { * * @since 2.0.1 * - * @deprecated Use `faker.image.url` instead. + * @deprecated Use `faker.image.urlLoremFlickr({ category: 'nightlife' })` if you want an image from LoremFlickr in the correct category, or `faker.image.url()` if you just want any image. */ nightlife(width?: number, height?: number, randomize?: boolean): string { deprecated({ deprecated: 'faker.image.nightlife', - proposed: 'faker.image.url', + proposed: + "faker.image.urlLoremFlickr({ category: 'nightlife' }) or faker.image.url", since: '8.0', until: '9.0', }); @@ -690,6 +722,9 @@ export class ImageModule { * @param height The height of the image. Defaults to `480`. * @param randomize Whether to randomize the image or not. Defaults to `false`. * + * @see faker.image.url() + * @see faker.image.urlLoremFlickr() + * * @example * faker.image.fashion() // 'https://loremflickr.com/640/480/fashion' * faker.image.fashion(1234, 2345) // 'https://loremflickr.com/1234/2345/fashion' @@ -697,12 +732,13 @@ export class ImageModule { * * @since 2.0.1 * - * @deprecated Use `faker.image.url` instead. + * @deprecated Use `faker.image.urlLoremFlickr({ category: 'fashion' })` if you want an image from LoremFlickr in the correct category, or `faker.image.url()` if you just want any image. */ fashion(width?: number, height?: number, randomize?: boolean): string { deprecated({ deprecated: 'faker.image.fashion', - proposed: 'faker.image.url', + proposed: + "faker.image.urlLoremFlickr({ category: 'fashion' }) or faker.image.url", since: '8.0', until: '9.0', }); @@ -717,6 +753,9 @@ export class ImageModule { * @param height The height of the image. Defaults to `480`. * @param randomize Whether to randomize the image or not. Defaults to `false`. * + * @see faker.image.url() + * @see faker.image.urlLoremFlickr() + * * @example * faker.image.people() // 'https://loremflickr.com/640/480/people' * faker.image.people(1234, 2345) // 'https://loremflickr.com/1234/2345/people' @@ -724,12 +763,13 @@ export class ImageModule { * * @since 2.0.1 * - * @deprecated Use `faker.image.url` instead. + * @deprecated Use `faker.image.urlLoremFlickr({ category: 'people' })` if you want an image from LoremFlickr in the correct category, or `faker.image.url()` if you just want any image. */ people(width?: number, height?: number, randomize?: boolean): string { deprecated({ deprecated: 'faker.image.people', - proposed: 'faker.image.url', + proposed: + "faker.image.urlLoremFlickr({ category: 'people' }) or faker.image.url", since: '8.0', until: '9.0', }); @@ -744,6 +784,9 @@ export class ImageModule { * @param height The height of the image. Defaults to `480`. * @param randomize Whether to randomize the image or not. Defaults to `false`. * + * @see faker.image.url() + * @see faker.image.urlLoremFlickr() + * * @example * faker.image.nature() // 'https://loremflickr.com/640/480/nature' * faker.image.nature(1234, 2345) // 'https://loremflickr.com/1234/2345/nature' @@ -751,12 +794,13 @@ export class ImageModule { * * @since 2.0.1 * - * @deprecated Use `faker.image.url` instead. + * @deprecated Use `faker.image.urlLoremFlickr({ category: 'nature' })` if you want an image from LoremFlickr in the correct category, or `faker.image.url()` if you just want any image. */ nature(width?: number, height?: number, randomize?: boolean): string { deprecated({ deprecated: 'faker.image.nature', - proposed: 'faker.image.url', + proposed: + "faker.image.urlLoremFlickr({ category: 'nature' }) or faker.image.url", since: '8.0', until: '9.0', }); @@ -771,6 +815,9 @@ export class ImageModule { * @param height The height of the image. Defaults to `480`. * @param randomize Whether to randomize the image or not. Defaults to `false`. * + * @see faker.image.url() + * @see faker.image.urlLoremFlickr() + * * @example * faker.image.sports() // 'https://loremflickr.com/640/480/sports' * faker.image.sports(1234, 2345) // 'https://loremflickr.com/1234/2345/sports' @@ -778,12 +825,13 @@ export class ImageModule { * * @since 2.0.1 * - * @deprecated Use `faker.image.url` instead. + * @deprecated Use `faker.image.urlLoremFlickr({ category: 'sports' })` if you want an image from LoremFlickr in the correct category, or `faker.image.url()` if you just want any image. */ sports(width?: number, height?: number, randomize?: boolean): string { deprecated({ deprecated: 'faker.image.sports', - proposed: 'faker.image.url', + proposed: + "faker.image.urlLoremFlickr({ category: 'sports' }) or faker.image.url", since: '8.0', until: '9.0', }); @@ -798,6 +846,9 @@ export class ImageModule { * @param height The height of the image. Defaults to `480`. * @param randomize Whether to randomize the image or not. Defaults to `false`. * + * @see faker.image.url() + * @see faker.image.urlLoremFlickr() + * * @example * faker.image.technics() // 'https://loremflickr.com/640/480/technics' * faker.image.technics(1234, 2345) // 'https://loremflickr.com/1234/2345/technics' @@ -805,12 +856,13 @@ export class ImageModule { * * @since 2.0.1 * - * @deprecated Use `faker.image.url` instead. + * @deprecated Use `faker.image.urlLoremFlickr({ category: 'technics' })` if you want an image from LoremFlickr in the correct category, or `faker.image.url()` if you just want any image. */ technics(width?: number, height?: number, randomize?: boolean): string { deprecated({ deprecated: 'faker.image.technics', - proposed: 'faker.image.url', + proposed: + "faker.image.urlLoremFlickr({ category: 'technics' }) or faker.image.url", since: '8.0', until: '9.0', }); @@ -825,6 +877,9 @@ export class ImageModule { * @param height The height of the image. Defaults to `480`. * @param randomize Whether to randomize the image or not. Defaults to `false`. * + * @see faker.image.url() + * @see faker.image.urlLoremFlickr() + * * @example * faker.image.transport() // 'https://loremflickr.com/640/480/transport' * faker.image.transport(1234, 2345) // 'https://loremflickr.com/1234/2345/transport' @@ -832,12 +887,15 @@ export class ImageModule { * * @since 2.0.1 * - * @deprecated Use `faker.image.url` instead. + * @deprecated Use `faker.image.urlLoremFlickr({ category: 'transport' })` if you want an image from LoremFlickr in the correct category, or `faker.image.url()` if you just want any image. + * + * */ transport(width?: number, height?: number, randomize?: boolean): string { deprecated({ deprecated: 'faker.image.transport', - proposed: 'faker.image.url', + proposed: + "faker.image.urlLoremFlickr({ category: 'transport' }) or faker.image.url", since: '8.0', until: '9.0', }); diff --git a/src/modules/image/providers/lorempicsum.ts b/src/modules/image/providers/lorempicsum.ts index b9189a0fa9c..6299cf1bef1 100644 --- a/src/modules/image/providers/lorempicsum.ts +++ b/src/modules/image/providers/lorempicsum.ts @@ -101,7 +101,7 @@ export class LoremPicsum { since: '8.0', until: '9.0', }); - // TODO ST-DDT 2022-03-11: This method does the same as image url, maybe generate a seed, if it is missig? + // TODO @ST-DDT 2022-03-11: This method does the same as image url, maybe generate a seed, if it is missing? return this.imageUrl(width, height, grayscale, blur, seed); } diff --git a/src/modules/location/index.ts b/src/modules/location/index.ts index 24aef3b9d99..1d0bd4a4af2 100644 --- a/src/modules/location/index.ts +++ b/src/modules/location/index.ts @@ -700,15 +700,77 @@ export class LocationModule { /** * Returns a random direction (cardinal and ordinal; northwest, east, etc). * - * @param options Whether to use abbreviated or an options object. - * @param options.useAbbr If true this will return abbreviated directions (NW, E, etc). + * @param options The options to use. Defaults to `{}`. + * @param options.abbreviated If true this will return abbreviated directions (NW, E, etc). + * Otherwise this will return the long name. Defaults to `false`. + * + * @example + * faker.location.direction() // 'Northeast' + * faker.location.direction({ abbreviated: true }) // 'SW' + * + * @since 8.0.0 + */ + direction(options?: { + /** + * If true this will return abbreviated directions (NW, E, etc). + * Otherwise this will return the long name. + * + * @default false + */ + abbreviated?: boolean; + }): string; + /** + * Returns a random direction (cardinal and ordinal; northwest, east, etc). + * + * @param abbreviated If true this will return abbreviated directions (NW, E, etc). * Otherwise this will return the long name. Defaults to `false`. * * @example * faker.location.direction() // 'Northeast' * faker.location.direction(false) // 'South' * faker.location.direction(true) // 'NE' - * faker.location.direction({ useAbbr: true }) // 'SW' + * + * @since 8.0.0 + * + * @deprecated Use `faker.location.direction({ abbreviated })` instead. + */ + direction(abbreviated?: boolean): string; + /** + * Returns a random direction (cardinal and ordinal; northwest, east, etc). + * + * @param options Whether to use abbreviated or an options object. Defaults to `{}`. + * @param options.abbreviated If true this will return abbreviated directions (NW, E, etc). + * Otherwise this will return the long name. Defaults to `false`. + * + * @example + * faker.location.direction() // 'Northeast' + * faker.location.direction({ abbreviated: true }) // 'SW' + * + * @since 8.0.0 + */ + direction( + options?: + | boolean + | { + /** + * If true this will return abbreviated directions (NW, E, etc). + * Otherwise this will return the long name. + * + * @default false + */ + abbreviated?: boolean; + } + ): string; + /** + * Returns a random direction (cardinal and ordinal; northwest, east, etc). + * + * @param options Whether to use abbreviated or an options object. Defaults to `{}`. + * @param options.abbreviated If true this will return abbreviated directions (NW, E, etc). + * Otherwise this will return the long name. Defaults to `false`. + * + * @example + * faker.location.direction() // 'Northeast' + * faker.location.direction({ abbreviated: true }) // 'SW' * * @since 8.0.0 */ @@ -722,16 +784,22 @@ export class LocationModule { * * @default false */ - useAbbr?: boolean; + abbreviated?: boolean; } = {} ): string { if (typeof options === 'boolean') { - options = { useAbbr: options }; + deprecated({ + deprecated: 'faker.location.direction(abbreviated)', + proposed: 'faker.location.direction({ abbreviated })', + since: '8.0', + until: '9.0', + }); + options = { abbreviated: options }; } - const { useAbbr = false } = options; + const { abbreviated = false } = options; - if (!useAbbr) { + if (!abbreviated) { return this.faker.helpers.arrayElement( this.faker.definitions.location.direction ); @@ -745,15 +813,77 @@ export class LocationModule { /** * Returns a random cardinal direction (north, east, south, west). * - * @param options Whether to use abbreviated or an options object. - * @param options.useAbbr If true this will return abbreviated directions (N, E, etc). + * @param options The options to use. Defaults to `{}`. + * @param options.abbreviated If true this will return abbreviated directions (N, E, etc). + * Otherwise this will return the long name. Defaults to `false`. + * + * @example + * faker.location.cardinalDirection() // 'North' + * faker.location.cardinalDirection({ abbreviated: true }) // 'W' + * + * @since 8.0.0 + */ + cardinalDirection(options?: { + /** + * If true this will return abbreviated directions (N, E, etc). + * Otherwise this will return the long name. + * + * @default false + */ + abbreviated?: boolean; + }): string; + /** + * Returns a random cardinal direction (north, east, south, west). + * + * @param abbreviated If true this will return abbreviated directions (N, E, etc). * Otherwise this will return the long name. Defaults to `false`. * * @example * faker.location.cardinalDirection() // 'North' * faker.location.cardinalDirection(false) // 'South' * faker.location.cardinalDirection(true) // 'N' - * faker.location.cardinalDirection({ useAbbr: true }) // 'W' + * + * @since 8.0.0 + * + * @deprecated Use `faker.location.cardinalDirection({ abbreviated })` instead. + */ + cardinalDirection(abbreviated?: boolean): string; + /** + * Returns a random cardinal direction (north, east, south, west). + * + * @param options Whether to use abbreviated or an options object. Defaults to`{}`. + * @param options.abbreviated If true this will return abbreviated directions (N, E, etc). + * Otherwise this will return the long name. Defaults to `false`. + * + * @example + * faker.location.cardinalDirection() // 'North' + * faker.location.cardinalDirection({ abbreviated: true }) // 'W' + * + * @since 8.0.0 + */ + cardinalDirection( + options?: + | boolean + | { + /** + * If true this will return abbreviated directions (N, E, etc). + * Otherwise this will return the long name. + * + * @default false + */ + abbreviated?: boolean; + } + ): string; + /** + * Returns a random cardinal direction (north, east, south, west). + * + * @param options Whether to use abbreviated or an options object. Defaults to `{}`. + * @param options.abbreviated If true this will return abbreviated directions (N, E, etc). + * Otherwise this will return the long name. Defaults to `false`. + * + * @example + * faker.location.cardinalDirection() // 'North' + * faker.location.cardinalDirection({ abbreviated: true }) // 'W' * * @since 8.0.0 */ @@ -767,15 +897,21 @@ export class LocationModule { * * @default false */ - useAbbr?: boolean; + abbreviated?: boolean; } = {} ): string { if (typeof options === 'boolean') { - options = { useAbbr: options }; + deprecated({ + deprecated: 'faker.location.cardinalDirection(abbreviated)', + proposed: 'faker.location.cardinalDirection({ abbreviated })', + since: '8.0', + until: '9.0', + }); + options = { abbreviated: options }; } - const { useAbbr = false } = options; - if (!useAbbr) { + const { abbreviated = false } = options; + if (!abbreviated) { return this.faker.helpers.arrayElement( this.faker.definitions.location.direction.slice(0, 4) ); @@ -789,15 +925,78 @@ export class LocationModule { /** * Returns a random ordinal direction (northwest, southeast, etc). * - * @param options Whether to use abbreviated or an options object. - * @param options.useAbbr If true this will return abbreviated directions (NW, SE, etc). + * @param options Whether to use abbreviated or an options object. Defaults to `{}`. + * @param options.abbreviated If true this will return abbreviated directions (NW, SE, etc). + * Otherwise this will return the long name. Defaults to `false`. + * + * @example + * faker.location.ordinalDirection() // 'Northeast' + * faker.location.ordinalDirection({ abbreviated: true }) // 'SW' + * + * @since 8.0.0 + */ + ordinalDirection(options?: { + /** + * If true this will return abbreviated directions (NW, SE, etc). + * Otherwise this will return the long name. + * + * @default false + */ + abbreviated?: boolean; + }): string; + /** + * Returns a random ordinal direction (northwest, southeast, etc). + * + * @param options Whether to use abbreviated or an options object. Defaults to `{}`. + * @param options.abbreviated If true this will return abbreviated directions (NW, SE, etc). * Otherwise this will return the long name. Defaults to `false`. * * @example * faker.location.ordinalDirection() // 'Northeast' * faker.location.ordinalDirection(false) // 'Northwest' * faker.location.ordinalDirection(true) // 'NE' - * faker.location.ordinalDirection({ useAbbr: true }) // 'SW' + * + * @since 8.0.0 + * + * @deprecated Use `faker.location.ordinalDirection({ abbreviated })` instead. + */ + ordinalDirection(abbreviated?: boolean): string; + /** + * Returns a random ordinal direction (northwest, southeast, etc). + * + * @param options Whether to use abbreviated or an options object. Defaults to `{}`. + * @param options.abbreviated If true this will return abbreviated directions (NW, SE, etc). + * Otherwise this will return the long name. Defaults to `false`. + * + * @example + * faker.location.ordinalDirection() // 'Northeast' + * faker.location.ordinalDirection({ abbreviated: true }) // 'SW' + * + * @since 8.0.0 + */ + ordinalDirection( + options?: + | boolean + | { + /** + * If true this will return abbreviated directions (NW, SE, etc). + * Otherwise this will return the long name. + * + * @default false + */ + abbreviated?: boolean; + } + ): string; + /** + * Returns a random ordinal direction (northwest, southeast, etc). + * + * @param options Whether to use abbreviated or an options object. Defaults to `{}`. + * @param options.abbreviated If true this will return abbreviated directions (NW, SE, etc). + * Otherwise this will return the long name. Defaults to `false`. + * + * @example + * faker.location.ordinalDirection() // 'Northeast' + * faker.location.ordinalDirection({ abbreviated: true }) // 'SW' * * @since 8.0.0 */ @@ -811,15 +1010,21 @@ export class LocationModule { * * @default false */ - useAbbr?: boolean; + abbreviated?: boolean; } = {} ): string { if (typeof options === 'boolean') { - options = { useAbbr: options }; + deprecated({ + deprecated: 'faker.location.ordinalDirection(abbreviated)', + proposed: 'faker.location.ordinalDirection({ abbreviated })', + since: '8.0', + until: '9.0', + }); + options = { abbreviated: options }; } - const { useAbbr = false } = options; - if (!useAbbr) { + const { abbreviated = false } = options; + if (!abbreviated) { return this.faker.helpers.arrayElement( this.faker.definitions.location.direction.slice(4, 8) ); diff --git a/src/modules/person/index.ts b/src/modules/person/index.ts index 5dbeea3d146..789cd58c549 100644 --- a/src/modules/person/index.ts +++ b/src/modules/person/index.ts @@ -17,6 +17,7 @@ export type SexType = `${Sex}`; * @param param2.generic Non-sex definitions. * @param param2.female Female definitions. * @param param2.male Male definitions. + * * @returns Definition based on given sex. */ function selectDefinition( @@ -128,24 +129,24 @@ export class PersonModule { last_name, female_last_name, male_last_name, - last_name_patterns, - male_last_name_patterns, - female_last_name_patterns, + last_name_pattern, + male_last_name_pattern, + female_last_name_pattern, } = this.faker.definitions.person; if ( - last_name_patterns != null || - male_last_name_patterns != null || - female_last_name_patterns != null + last_name_pattern != null || + male_last_name_pattern != null || + female_last_name_pattern != null ) { const pattern = selectDefinition( this.faker, this.faker.helpers.weightedArrayElement, sex, { - generic: last_name_patterns, - female: female_last_name_patterns, - male: male_last_name_patterns, + generic: last_name_pattern, + female: female_last_name_pattern, + male: male_last_name_pattern, } ); return this.faker.helpers.fake(pattern); @@ -295,9 +296,9 @@ export class PersonModule { * @since 8.0.0 */ bio(): string { - const { bio_patterns } = this.faker.definitions.person; + const { bio_pattern } = this.faker.definitions.person; - return this.faker.helpers.fake(bio_patterns); + return this.faker.helpers.fake(bio_pattern); } /** diff --git a/src/modules/random/index.ts b/src/modules/random/index.ts index 2a44b0e2977..03f126f8df3 100644 --- a/src/modules/random/index.ts +++ b/src/modules/random/index.ts @@ -52,12 +52,12 @@ export class RandomModule { }); const wordMethods = [ - this.faker.location.cardinalDirection, + () => this.faker.location.cardinalDirection(), this.faker.location.cityName, this.faker.location.country, this.faker.location.county, - this.faker.location.direction, - this.faker.location.ordinalDirection, + () => this.faker.location.direction(), + () => this.faker.location.ordinalDirection(), this.faker.location.state, this.faker.location.street, diff --git a/src/modules/system/index.ts b/src/modules/system/index.ts index 35ca2c8d775..a4cf67450be 100644 --- a/src/modules/system/index.ts +++ b/src/modules/system/index.ts @@ -102,6 +102,7 @@ export class SystemModule { * Returns a random file name with a given extension or a commonly used extension. * * @param ext Extension. Empty string is considered to be not set. + * * @example * faker.system.commonFileName() // 'dollar.jpg' * faker.system.commonFileName('txt') // 'global_borders_wyoming.txt' diff --git a/src/utils/merge-locales.ts b/src/utils/merge-locales.ts index 1a69f541210..e8bdef33e99 100644 --- a/src/utils/merge-locales.ts +++ b/src/utils/merge-locales.ts @@ -7,6 +7,7 @@ import type { LocaleDefinition } from '..'; * Mutating the category entries in the returned locale will also mutate the entries in the respective source locale. * * @param locales The locales to merge. + * * @returns The newly merged locale. * * @example diff --git a/src/utils/types.ts b/src/utils/types.ts index afc4c17a3d6..8c1bfe6bc23 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -14,7 +14,7 @@ export type LiteralUnion = * These would fail when invoked since they are invoked without the `new` keyword. */ export type Callable = ( - // TODO christopher 2023-02-14: This `any` type can be fixed by anyone if they want to. + // TODO @Shinigami92 2023-02-14: This `any` type can be fixed by anyone if they want to. // eslint-disable-next-line @typescript-eslint/no-explicit-any ...args: any[] ) => unknown; diff --git a/test/__snapshots__/location.spec.ts.snap b/test/__snapshots__/location.spec.ts.snap index 5bea023d732..8fa97b7a983 100644 --- a/test/__snapshots__/location.spec.ts.snap +++ b/test/__snapshots__/location.spec.ts.snap @@ -4,9 +4,9 @@ exports[`location > 42 > buildingNumber 1`] = `"7917"`; exports[`location > 42 > cardinalDirection > noArgs 1`] = `"East"`; -exports[`location > 42 > cardinalDirection > with boolean 1`] = `"East"`; +exports[`location > 42 > cardinalDirection > with abbreviated option 1`] = `"E"`; -exports[`location > 42 > cardinalDirection > with useAbbr option 1`] = `"E"`; +exports[`location > 42 > cardinalDirection > with boolean 1`] = `"East"`; exports[`location > 42 > city 1`] = `"Port Valentine"`; @@ -24,9 +24,9 @@ exports[`location > 42 > county 1`] = `"Berkshire"`; exports[`location > 42 > direction > noArgs 1`] = `"South"`; -exports[`location > 42 > direction > with boolean 1`] = `"South"`; +exports[`location > 42 > direction > with abbreviated option 1`] = `"S"`; -exports[`location > 42 > direction > with useAbbr option 1`] = `"S"`; +exports[`location > 42 > direction > with boolean 1`] = `"South"`; exports[`location > 42 > latitude > noArgs 1`] = `-22.5828`; @@ -122,9 +122,9 @@ exports[`location > 42 > nearbyGPSCoordinate > with radius and isMetric 1`] = ` exports[`location > 42 > ordinalDirection > noArgs 1`] = `"Northwest"`; -exports[`location > 42 > ordinalDirection > with boolean 1`] = `"Northwest"`; +exports[`location > 42 > ordinalDirection > with abbreviated option 1`] = `"NW"`; -exports[`location > 42 > ordinalDirection > with useAbbr option 1`] = `"NW"`; +exports[`location > 42 > ordinalDirection > with boolean 1`] = `"Northwest"`; exports[`location > 42 > secondaryAddress 1`] = `"Apt. 791"`; @@ -158,9 +158,9 @@ exports[`location > 1211 > buildingNumber 1`] = `"487"`; exports[`location > 1211 > cardinalDirection > noArgs 1`] = `"West"`; -exports[`location > 1211 > cardinalDirection > with boolean 1`] = `"West"`; +exports[`location > 1211 > cardinalDirection > with abbreviated option 1`] = `"W"`; -exports[`location > 1211 > cardinalDirection > with useAbbr option 1`] = `"W"`; +exports[`location > 1211 > cardinalDirection > with boolean 1`] = `"West"`; exports[`location > 1211 > city 1`] = `"La Crosse"`; @@ -178,9 +178,9 @@ exports[`location > 1211 > county 1`] = `"Cambridgeshire"`; exports[`location > 1211 > direction > noArgs 1`] = `"Southwest"`; -exports[`location > 1211 > direction > with boolean 1`] = `"Southwest"`; +exports[`location > 1211 > direction > with abbreviated option 1`] = `"SW"`; -exports[`location > 1211 > direction > with useAbbr option 1`] = `"SW"`; +exports[`location > 1211 > direction > with boolean 1`] = `"Southwest"`; exports[`location > 1211 > latitude > noArgs 1`] = `77.1337`; @@ -276,9 +276,9 @@ exports[`location > 1211 > nearbyGPSCoordinate > with radius and isMetric 1`] = exports[`location > 1211 > ordinalDirection > noArgs 1`] = `"Southwest"`; -exports[`location > 1211 > ordinalDirection > with boolean 1`] = `"Southwest"`; +exports[`location > 1211 > ordinalDirection > with abbreviated option 1`] = `"SW"`; -exports[`location > 1211 > ordinalDirection > with useAbbr option 1`] = `"SW"`; +exports[`location > 1211 > ordinalDirection > with boolean 1`] = `"Southwest"`; exports[`location > 1211 > secondaryAddress 1`] = `"Suite 487"`; @@ -312,9 +312,9 @@ exports[`location > 1337 > buildingNumber 1`] = `"51225"`; exports[`location > 1337 > cardinalDirection > noArgs 1`] = `"East"`; -exports[`location > 1337 > cardinalDirection > with boolean 1`] = `"East"`; +exports[`location > 1337 > cardinalDirection > with abbreviated option 1`] = `"E"`; -exports[`location > 1337 > cardinalDirection > with useAbbr option 1`] = `"E"`; +exports[`location > 1337 > cardinalDirection > with boolean 1`] = `"East"`; exports[`location > 1337 > city 1`] = `"New Carmella"`; @@ -332,9 +332,9 @@ exports[`location > 1337 > county 1`] = `"Bedfordshire"`; exports[`location > 1337 > direction > noArgs 1`] = `"South"`; -exports[`location > 1337 > direction > with boolean 1`] = `"South"`; +exports[`location > 1337 > direction > with abbreviated option 1`] = `"S"`; -exports[`location > 1337 > direction > with useAbbr option 1`] = `"S"`; +exports[`location > 1337 > direction > with boolean 1`] = `"South"`; exports[`location > 1337 > latitude > noArgs 1`] = `-42.8356`; @@ -430,9 +430,9 @@ exports[`location > 1337 > nearbyGPSCoordinate > with radius and isMetric 1`] = exports[`location > 1337 > ordinalDirection > noArgs 1`] = `"Northwest"`; -exports[`location > 1337 > ordinalDirection > with boolean 1`] = `"Northwest"`; +exports[`location > 1337 > ordinalDirection > with abbreviated option 1`] = `"NW"`; -exports[`location > 1337 > ordinalDirection > with useAbbr option 1`] = `"NW"`; +exports[`location > 1337 > ordinalDirection > with boolean 1`] = `"Northwest"`; exports[`location > 1337 > secondaryAddress 1`] = `"Apt. 512"`; diff --git a/test/all_functional.spec.ts b/test/all_functional.spec.ts index 872629eaa1b..ca80014abbd 100644 --- a/test/all_functional.spec.ts +++ b/test/all_functional.spec.ts @@ -22,7 +22,7 @@ type SkipConfig = Partial< >; const BROKEN_LOCALE_METHODS = { - // TODO ST-DDT 2022-03-28: these are TODOs (usually broken locale files) + // TODO @ST-DDT 2022-03-28: these are TODOs (usually broken locale files) company: { suffixes: ['az'], companySuffix: ['az'], @@ -118,7 +118,7 @@ describe('functional tests', () => { describe(module, () => { modules[module].forEach((meth) => { const testAssertion = () => { - // TODO ST-DDT 2022-03-28: Use random seed once there are no more failures + // TODO @ST-DDT 2022-03-28: Use random seed once there are no more failures faker.seed(1); const result = faker[module][meth](); @@ -133,7 +133,7 @@ describe('functional tests', () => { if (isWorkingLocaleForMethod(module, meth, locale)) { it(`${meth}()`, testAssertion); } else { - // TODO ST-DDT 2022-03-28: Remove once there are no more failures + // TODO @ST-DDT 2022-03-28: Remove once there are no more failures // We expect a failure here to ensure we remove the exclusions when fixed it.fails(`${meth}()`, testAssertion); } @@ -156,7 +156,7 @@ describe('faker.helpers.fake functional tests', () => { describe(module, () => { modules[module].forEach((meth) => { const testAssertion = () => { - // TODO ST-DDT 2022-03-28: Use random seed once there are no more failures + // TODO @ST-DDT 2022-03-28: Use random seed once there are no more failures faker.seed(1); const result = faker.helpers.fake(`{{${module}.${meth}}}`); @@ -169,7 +169,7 @@ describe('faker.helpers.fake functional tests', () => { if (isWorkingLocaleForMethod(module, meth, locale)) { it(`${meth}()`, testAssertion); } else { - // TODO ST-DDT 2022-03-28: Remove once there are no more failures + // TODO @ST-DDT 2022-03-28: Remove once there are no more failures // We expect a failure here to ensure we remove the exclusions when fixed it.fails(`${meth}()`, testAssertion); } diff --git a/test/location.spec.ts b/test/location.spec.ts index 5841aa28d62..4dbc85c297d 100644 --- a/test/location.spec.ts +++ b/test/location.spec.ts @@ -112,7 +112,7 @@ describe('location', () => { )((t) => { t.it('noArgs') .it('with boolean', false) - .it('with useAbbr option', { useAbbr: true }); + .it('with abbreviated option', { abbreviated: true }); }); t.describe('zipCode', (t) => { @@ -280,11 +280,11 @@ describe('location', () => { }); describe('direction()', () => { - it('returns abbreviation when useAbbr is true', () => { - const direction = faker.location.direction({ useAbbr: true }); + it('returns abbreviation when abbreviated is true', () => { + const direction = faker.location.direction({ abbreviated: true }); const lengthDirection = direction.length; const prefixErrorMessage = - 'The abbreviation of direction when useAbbr is true should'; + 'The abbreviation of direction when abbreviated is true should'; expect( direction, @@ -295,14 +295,14 @@ describe('location', () => { }); describe('ordinalDirection()', () => { - it('returns abbreviation when useAbbr is true', () => { + it('returns abbreviation when abbreviated is true', () => { const ordinalDirection = faker.location.ordinalDirection({ - useAbbr: true, + abbreviated: true, }); const expectedType = 'string'; const ordinalDirectionLength = ordinalDirection.length; const prefixErrorMessage = - 'The ordinal direction when useAbbr is true should'; + 'The ordinal direction when abbreviated is true should'; expect( ordinalDirection, @@ -313,14 +313,14 @@ describe('location', () => { }); describe('cardinalDirection()', () => { - it('returns abbreviation when useAbbr is true', () => { + it('returns abbreviation when abbreviated is true', () => { const cardinalDirection = faker.location.cardinalDirection({ - useAbbr: true, + abbreviated: true, }); const expectedType = 'string'; const cardinalDirectionLength = cardinalDirection.length; const prefixErrorMessage = - 'The cardinal direction when useAbbr is true should'; + 'The cardinal direction when abbreviated is true should'; expect( cardinalDirection, diff --git a/test/scripts/apidoc/__snapshots__/signature.spec.ts.snap b/test/scripts/apidoc/__snapshots__/signature.spec.ts.snap index bd916f0ec9b..15bb4d00b25 100644 --- a/test/scripts/apidoc/__snapshots__/signature.spec.ts.snap +++ b/test/scripts/apidoc/__snapshots__/signature.spec.ts.snap @@ -43,7 +43,8 @@ exports[`signature > analyzeSignature() > complexArrayParameter 1`] = ` "returns": "T", "seeAlsos": [], "since": "", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L346", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L356", + "throws": undefined, } `; @@ -67,7 +68,8 @@ exports[`signature > analyzeSignature() > defaultBooleanParamMethod 1`] = ` "returns": "number", "seeAlsos": [], "since": "", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L104", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L105", + "throws": undefined, } `; @@ -83,6 +85,7 @@ exports[`signature > analyzeSignature() > expected and actual methods are equal "methodWithMultipleSeeMarkers", "methodWithMultipleSeeMarkersAndBackticks", "methodWithSinceMarker", + "methodWithThrows", "multiParamMethod", "noParamMethod", "optionalStringParamMethod", @@ -115,7 +118,8 @@ exports[`signature > analyzeSignature() > functionParamMethod 1`] = ` "returns": "number", "seeAlsos": [], "since": "", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L124", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L125", + "throws": undefined, } `; @@ -174,7 +178,8 @@ exports[`signature > analyzeSignature() > literalUnionParamMethod 1`] = ` "returns": "string", "seeAlsos": [], "since": "", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L158", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L159", + "throws": undefined, } `; @@ -193,7 +198,8 @@ exports[`signature > analyzeSignature() > methodWithDeprecated 1`] = ` "test.apidoc.methodWithExample()", ], "since": "", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L276", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L277", + "throws": undefined, } `; @@ -244,7 +250,8 @@ exports[`signature > analyzeSignature() > methodWithDeprecatedOption 1`] = ` "returns": "number", "seeAlsos": [], "since": "", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L288", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L298", + "throws": undefined, } `; @@ -261,7 +268,8 @@ exports[`signature > analyzeSignature() > methodWithExample 1`] = ` "returns": "number", "seeAlsos": [], "since": "", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L265", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L266", + "throws": undefined, } `; @@ -280,7 +288,8 @@ exports[`signature > analyzeSignature() > methodWithMultipleSeeMarkers 1`] = ` "test.apidoc.methodWithDeprecated()", ], "since": "", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L315", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L325", + "throws": undefined, } `; @@ -299,7 +308,8 @@ exports[`signature > analyzeSignature() > methodWithMultipleSeeMarkersAndBacktic "test.apidoc.methodWithDeprecated() with parameter bar and baz.", ], "since": "", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L325", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L335", + "throws": undefined, } `; @@ -315,7 +325,25 @@ exports[`signature > analyzeSignature() > methodWithSinceMarker 1`] = ` "returns": "number", "seeAlsos": [], "since": "1.0.0", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L334", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L344", + "throws": undefined, +} +`; + +exports[`signature > analyzeSignature() > methodWithThrows 1`] = ` +{ + "deprecated": undefined, + "description": "

Test with throws

+", + "examples": "
ts
methodWithThrows(): number
+
", + "name": "methodWithThrows", + "parameters": [], + "returns": "number", + "seeAlsos": [], + "since": "", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L286", + "throws": "a Faker error", } `; @@ -353,7 +381,8 @@ exports[`signature > analyzeSignature() > multiParamMethod 1`] = ` "returns": "number", "seeAlsos": [], "since": "", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L115", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L116", + "throws": undefined, } `; @@ -369,7 +398,8 @@ exports[`signature > analyzeSignature() > noParamMethod 1`] = ` "returns": "number", "seeAlsos": [], "since": "", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L77", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L78", + "throws": undefined, } `; @@ -393,7 +423,8 @@ exports[`signature > analyzeSignature() > optionalStringParamMethod 1`] = ` "returns": "number", "seeAlsos": [], "since": "", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L95", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L96", + "throws": undefined, } `; @@ -460,7 +491,8 @@ It also has a more complex description.

"returns": "number", "seeAlsos": [], "since": "", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L215", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L216", + "throws": undefined, } `; @@ -498,7 +530,8 @@ exports[`signature > analyzeSignature() > optionsInterfaceParamMethodWithDefault "returns": "number", "seeAlsos": [], "since": "", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L251", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L252", + "throws": undefined, } `; @@ -563,7 +596,8 @@ exports[`signature > analyzeSignature() > optionsParamMethod 1`] = ` "returns": "number", "seeAlsos": [], "since": "", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L185", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L186", + "throws": undefined, } `; @@ -601,7 +635,8 @@ exports[`signature > analyzeSignature() > optionsTypeParamMethodWithDefaults 1`] "returns": "number", "seeAlsos": [], "since": "", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L233", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L234", + "throws": undefined, } `; @@ -625,7 +660,8 @@ exports[`signature > analyzeSignature() > requiredNumberParamMethod 1`] = ` "returns": "number", "seeAlsos": [], "since": "", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L86", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L87", + "throws": undefined, } `; @@ -681,6 +717,7 @@ exports[`signature > analyzeSignature() > stringUnionParamMethod 1`] = ` "returns": "string", "seeAlsos": [], "since": "", - "sourcePath": "test/scripts/apidoc/signature.example.ts#L137", + "sourcePath": "test/scripts/apidoc/signature.example.ts#L138", + "throws": undefined, } `; diff --git a/test/scripts/apidoc/signature.example.ts b/test/scripts/apidoc/signature.example.ts index f84112db1e4..97db90c88b6 100644 --- a/test/scripts/apidoc/signature.example.ts +++ b/test/scripts/apidoc/signature.example.ts @@ -1,4 +1,5 @@ import type { Casing, ColorFormat } from '../../../src'; +import { FakerError } from '../../../src/errors/faker-error'; import type { AlphaNumericChar } from '../../../src/modules/string'; import type { LiteralUnion } from '../../../src/utils/types'; // explicitly export types so they show up in the docs as decomposed types @@ -277,6 +278,15 @@ export class SignatureTest { return 0; } + /** + * Test with throws + * + * @throws a Faker error + */ + methodWithThrows(): number { + throw new FakerError('Test error'); + } + /** * Test with deprecated option. *