Skip to content

Commit

Permalink
refactor(company.name): deprecate format parameter (#1212)
Browse files Browse the repository at this point in the history
  • Loading branch information
Minozzzi authored Jul 30, 2022
1 parent a65f1a2 commit aedd7b8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/modules/company/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class Company {
/**
* Generates a random company name.
*
* @param format The optional format index used to select a format.
* @param format The optional format index used to select a format. Deprecated, do not use.
*
* @example
* faker.company.name() // 'Zieme, Hauck and McClure'
Expand All @@ -41,6 +41,15 @@ export class Company {
'{{name.lastName}}, {{name.lastName}} and {{name.lastName}}',
];

if (format != null) {
deprecated({
deprecated: 'faker.company.name(format)',
proposed: 'faker.company.name()',
since: '7.4',
until: '8.0',
});
}

if (typeof format !== 'number') {
format = this.faker.datatype.number(formats.length - 1);
}
Expand Down

0 comments on commit aedd7b8

Please sign in to comment.