Skip to content

Commit 4c43763

Browse files
committed
refactor(company)!: remove v8 deprecated company methods
1 parent e1dc906 commit 4c43763

File tree

5 files changed

+0
-197
lines changed

5 files changed

+0
-197
lines changed

src/definitions/company.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,4 @@ export type CompanyDefinition = LocaleEntry<{
3838
* Catchphrase nouns that can be displayed to an end user.
3939
*/
4040
noun: string[];
41-
42-
/**
43-
* Company/Business entity types.
44-
*
45-
* @deprecated Use `faker.company.name` instead.
46-
*/
47-
suffix: string[];
4841
}>;

src/modules/company/index.ts

Lines changed: 0 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { deprecated } from '../../internal/deprecated';
21
import { ModuleBase } from '../../internal/module-base';
32

43
/**
@@ -16,30 +15,6 @@ import { ModuleBase } from '../../internal/module-base';
1615
* - For finance-related entries, use [`faker.finance`](https://fakerjs.dev/api/finance.html).
1716
*/
1817
export class CompanyModule extends ModuleBase {
19-
/**
20-
* Returns an array with possible company name suffixes.
21-
*
22-
* @see faker.company.name(): For generating a complete company name.
23-
*
24-
* @example
25-
* faker.company.suffixes() // [ 'Inc', 'and Sons', 'LLC', 'Group' ]
26-
*
27-
* @since 2.0.1
28-
*
29-
* @deprecated Use `faker.company.name` instead.
30-
*/
31-
suffixes(): string[] {
32-
deprecated({
33-
deprecated: 'faker.company.suffixes',
34-
proposed: 'faker.company.name',
35-
since: '8.0',
36-
until: '9.0',
37-
});
38-
// Don't want the source array exposed to modification, so return a copy
39-
// eslint-disable-next-line deprecation/deprecation
40-
return [...this.faker.definitions.company.suffix];
41-
}
42-
4318
/**
4419
* Generates a random company name.
4520
*
@@ -52,31 +27,6 @@ export class CompanyModule extends ModuleBase {
5227
return this.faker.helpers.fake(this.faker.definitions.company.name_pattern);
5328
}
5429

55-
/**
56-
* Returns a random company suffix.
57-
*
58-
* @see faker.company.name(): For generating a complete company name.
59-
*
60-
* @example
61-
* faker.company.companySuffix() // 'and Sons'
62-
*
63-
* @since 2.0.1
64-
*
65-
* @deprecated Use `faker.company.name` instead.
66-
*/
67-
companySuffix(): string {
68-
deprecated({
69-
deprecated: 'faker.company.companySuffix',
70-
proposed: 'faker.company.name',
71-
since: '8.0',
72-
until: '9.0',
73-
});
74-
return this.faker.helpers.arrayElement(
75-
// eslint-disable-next-line deprecation/deprecation
76-
this.suffixes()
77-
);
78-
}
79-
8030
/**
8131
* Generates a random catch phrase that can be displayed to an end user.
8232
*
@@ -93,26 +43,6 @@ export class CompanyModule extends ModuleBase {
9343
].join(' ');
9444
}
9545

96-
/**
97-
* Generates a random company bs phrase.
98-
*
99-
* @example
100-
* faker.company.bs() // 'cultivate synergistic e-markets'
101-
*
102-
* @since 2.0.1
103-
*
104-
* @deprecated Use `faker.company.buzzPhrase` instead.
105-
*/
106-
bs(): string {
107-
deprecated({
108-
deprecated: 'faker.company.bs',
109-
proposed: 'faker.company.buzzPhrase',
110-
since: '8.0',
111-
until: '9.0',
112-
});
113-
return this.buzzPhrase();
114-
}
115-
11646
/**
11747
* Generates a random buzz phrase that can be used to demonstrate data being viewed by a manager.
11848
*
@@ -165,26 +95,6 @@ export class CompanyModule extends ModuleBase {
16595
return this.faker.helpers.arrayElement(this.faker.definitions.company.noun);
16696
}
16797

168-
/**
169-
* Returns a random company bs adjective.
170-
*
171-
* @example
172-
* faker.company.bsAdjective() // 'one-to-one'
173-
*
174-
* @since 2.0.1
175-
*
176-
* @deprecated Use `faker.company.buzzAdjective` instead.
177-
*/
178-
bsAdjective(): string {
179-
deprecated({
180-
deprecated: 'faker.company.bsAdjective',
181-
proposed: 'faker.company.buzzAdjective',
182-
since: '8.0',
183-
until: '9.0',
184-
});
185-
return this.buzzAdjective();
186-
}
187-
18898
/**
18999
* Returns a random buzz adjective that can be used to demonstrate data being viewed by a manager.
190100
*
@@ -199,26 +109,6 @@ export class CompanyModule extends ModuleBase {
199109
);
200110
}
201111

202-
/**
203-
* Returns a random company bs buzz word.
204-
*
205-
* @example
206-
* faker.company.bsBuzz() // 'empower'
207-
*
208-
* @since 2.0.1
209-
*
210-
* @deprecated Use `faker.company.buzzVerb` instead.
211-
*/
212-
bsBuzz(): string {
213-
deprecated({
214-
deprecated: 'faker.company.bsBuzz',
215-
proposed: 'faker.company.buzzVerb',
216-
since: '8.0',
217-
until: '9.0',
218-
});
219-
return this.buzzVerb();
220-
}
221-
222112
/**
223113
* Returns a random buzz verb that can be used to demonstrate data being viewed by a manager.
224114
*
@@ -233,26 +123,6 @@ export class CompanyModule extends ModuleBase {
233123
);
234124
}
235125

236-
/**
237-
* Returns a random company bs noun.
238-
*
239-
* @example
240-
* faker.company.bsNoun() // 'paradigms'
241-
*
242-
* @since 2.0.1
243-
*
244-
* @deprecated Use `faker.company.buzzNoun` instead.
245-
*/
246-
bsNoun(): string {
247-
deprecated({
248-
deprecated: 'faker.company.bsNoun',
249-
proposed: 'faker.company.buzzNoun',
250-
since: '8.0',
251-
until: '9.0',
252-
});
253-
return this.buzzNoun();
254-
}
255-
256126
/**
257127
* Returns a random buzz noun that can be used to demonstrate data being viewed by a manager.
258128
*

test/all-functional.spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ type SkipConfig<TModule> = Partial<
4545

4646
const BROKEN_LOCALE_METHODS = {
4747
// TODO @ST-DDT 2022-03-28: these are TODOs (usually broken locale files)
48-
company: {
49-
suffixes: ['az'],
50-
companySuffix: ['az'],
51-
},
5248
date: {
5349
between: '*',
5450
betweens: '*',

test/modules/__snapshots__/company.spec.ts.snap

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,8 @@ exports[`company > 42 > catchPhraseDescriptor 1`] = `"explicit"`;
1616

1717
exports[`company > 42 > catchPhraseNoun 1`] = `"framework"`;
1818

19-
exports[`company > 42 > companySuffix 1`] = `"and Sons"`;
20-
2119
exports[`company > 42 > name 1`] = `"Wiegand - Reynolds"`;
2220

23-
exports[`company > 42 > suffixes 1`] = `
24-
[
25-
"Inc",
26-
"and Sons",
27-
"LLC",
28-
"Group",
29-
]
30-
`;
31-
3221
exports[`company > 1211 > buzzAdjective 1`] = `"plug-and-play"`;
3322

3423
exports[`company > 1211 > buzzNoun 1`] = `"methodologies"`;
@@ -45,19 +34,8 @@ exports[`company > 1211 > catchPhraseDescriptor 1`] = `"upward-trending"`;
4534

4635
exports[`company > 1211 > catchPhraseNoun 1`] = `"system engine"`;
4736

48-
exports[`company > 1211 > companySuffix 1`] = `"Group"`;
49-
5037
exports[`company > 1211 > name 1`] = `"Trantow, Fahey and Zieme"`;
5138

52-
exports[`company > 1211 > suffixes 1`] = `
53-
[
54-
"Inc",
55-
"and Sons",
56-
"LLC",
57-
"Group",
58-
]
59-
`;
60-
6139
exports[`company > 1337 > buzzAdjective 1`] = `"global"`;
6240

6341
exports[`company > 1337 > buzzNoun 1`] = `"ROI"`;
@@ -74,15 +52,4 @@ exports[`company > 1337 > catchPhraseDescriptor 1`] = `"demand-driven"`;
7452

7553
exports[`company > 1337 > catchPhraseNoun 1`] = `"data-warehouse"`;
7654

77-
exports[`company > 1337 > companySuffix 1`] = `"and Sons"`;
78-
7955
exports[`company > 1337 > name 1`] = `"Cronin and Sons"`;
80-
81-
exports[`company > 1337 > suffixes 1`] = `
82-
[
83-
"Inc",
84-
"and Sons",
85-
"LLC",
86-
"Group",
87-
]
88-
`;

test/modules/company.spec.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ const NON_SEEDED_BASED_RUN = 5;
88
describe('company', () => {
99
seededTests(faker, 'company', (t) => {
1010
t.itEach(
11-
'suffixes',
1211
'name',
13-
'companySuffix',
1412
'catchPhrase',
1513
'buzzPhrase',
1614
'catchPhraseAdjective',
@@ -20,22 +18,11 @@ describe('company', () => {
2018
'buzzVerb',
2119
'buzzNoun'
2220
);
23-
24-
t.skip('bs').skip('bsAdjective').skip('bsBuzz').skip('bsNoun');
2521
});
2622

2723
describe.each(times(NON_SEEDED_BASED_RUN).map(() => faker.seed()))(
2824
'random seeded tests for seed %i',
2925
() => {
30-
describe('suffixes()', () => {
31-
it('should return all suffixes', () => {
32-
const actual = faker.company.suffixes();
33-
34-
expect(actual).toBeTruthy();
35-
expect(faker.definitions.company.suffix).toEqual(actual);
36-
});
37-
});
38-
3926
describe('name()', () => {
4027
it('should return a random company name', () => {
4128
const actual = faker.company.name();
@@ -45,16 +32,6 @@ describe('company', () => {
4532
});
4633
});
4734

48-
describe('companySuffix()', () => {
49-
it('should return random value from company.suffixes array', () => {
50-
const actual = faker.company.companySuffix();
51-
52-
expect(actual).toBeTruthy();
53-
expect(actual).toBeTypeOf('string');
54-
expect(faker.definitions.company.suffix).toContain(actual);
55-
});
56-
});
57-
5835
describe('catchPhrase()', () => {
5936
it('should return phrase comprising of a catch phrase adjective, descriptor, and noun', () => {
6037
const actual = faker.company.catchPhrase();

0 commit comments

Comments
 (0)