diff options
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/company/index.ts | 28 | ||||
| -rw-r--r-- | src/modules/finance/index.ts | 2 |
2 files changed, 27 insertions, 3 deletions
diff --git a/src/modules/company/index.ts b/src/modules/company/index.ts index fb5f2e66..968afbbf 100644 --- a/src/modules/company/index.ts +++ b/src/modules/company/index.ts @@ -1,4 +1,5 @@ import type { Faker } from '../..'; +import { deprecated } from '../../internal/deprecated'; /** * Module to generate company related entries. @@ -31,9 +32,9 @@ export class Company { * @param format The optional format index used to select a format. * * @example - * faker.company.companyName() // 'Zieme, Hauck and McClure' + * faker.company.name() // 'Zieme, Hauck and McClure' */ - companyName(format?: number): string { + name(format?: number): string { const formats = [ '{{name.lastName}} {{company.companySuffix}}', '{{name.lastName}} - {{name.lastName}}', @@ -48,6 +49,29 @@ export class Company { } /** + * Generates a random company name. + * + * @param format The optional format index used to select a format. + * + * @see faker.company.name + * + * @example + * faker.company.companyName() // 'Zieme, Hauck and McClure' + * + * @deprecated Use `faker.company.name()` instead + */ + companyName(format?: number): string { + deprecated({ + deprecated: 'faker.company.companyName()', + proposed: 'faker.company.name()', + since: '7.4', + until: '8.0', + }); + + return this.name(format); + } + + /** * Returns a random company suffix. * * @example diff --git a/src/modules/finance/index.ts b/src/modules/finance/index.ts index ff9ffc68..5d83963b 100644 --- a/src/modules/finance/index.ts +++ b/src/modules/finance/index.ts @@ -424,7 +424,7 @@ export class Finance { */ transactionDescription(): string { const amount = this.amount(); - const company = this.faker.company.companyName(); + const company = this.faker.company.name(); const transactionType = this.transactionType(); const account = this.account(); const card = this.mask(); |
