aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorST-DDT <[email protected]>2023-01-09 20:22:46 +0100
committerGitHub <[email protected]>2023-01-09 19:22:46 +0000
commit1e7534e92ac002c0281a47336343f39e29065630 (patch)
tree94e4c0de2264f65ed61b6d61ca99c02e03c18c35 /src/modules
parent099e76ce0fb180beb5fd62d72a07c236e04cdca0 (diff)
downloadfaker-1e7534e92ac002c0281a47336343f39e29065630.tar.xz
faker-1e7534e92ac002c0281a47336343f39e29065630.zip
refactor(company): deprecate suffix methods (#1719)
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/company/index.ts21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/modules/company/index.ts b/src/modules/company/index.ts
index 70c40521..79f2fa8f 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.
@@ -18,12 +19,22 @@ export class CompanyModule {
/**
* Returns an array with possible company name suffixes.
*
+ * @see faker.company.name()
+ *
* @example
* faker.company.suffixes() // [ 'Inc', 'and Sons', 'LLC', 'Group' ]
*
* @since 2.0.1
+ *
+ * @deprecated Use `faker.company.name` instead.
*/
suffixes(): string[] {
+ deprecated({
+ deprecated: 'faker.company.suffixes',
+ proposed: 'faker.company.name',
+ since: '8.0',
+ until: '9.0',
+ });
// Don't want the source array exposed to modification, so return a copy
return this.faker.definitions.company.suffix.slice(0);
}
@@ -45,12 +56,22 @@ export class CompanyModule {
/**
* Returns a random company suffix.
*
+ * @see faker.company.name()
+ *
* @example
* faker.company.companySuffix() // 'and Sons'
*
* @since 2.0.1
+ *
+ * @deprecated Use `faker.company.name` instead.
*/
companySuffix(): string {
+ deprecated({
+ deprecated: 'faker.company.companySuffix',
+ proposed: 'faker.company.name',
+ since: '8.0',
+ until: '9.0',
+ });
return this.faker.helpers.arrayElement(this.suffixes());
}