-
-
Notifications
You must be signed in to change notification settings - Fork 941
/
Copy pathindex.ts
269 lines (254 loc) · 6.48 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
import { deprecated } from '../../internal/deprecated';
import { ModuleBase } from '../../internal/module-base';
/**
* Module to generate company related entries.
*
* ### Overview
*
* To generate a random company name, use [`name()`](https://fakerjs.dev/api/company.html#name). This is localized in many locales.
*
* To generate jargon-filled company catchphrases and buzzwords, use [`catchPhrase()`](https://fakerjs.dev/api/company.html#catchphrase) or [`buzzPhrase()`](https://fakerjs.dev/api/company.html#buzzphrase).
*
* ### Related Modules
*
* - For products and commerce, use [`faker.commerce`](https://fakerjs.dev/api/commerce.html).
* - For finance-related entries, use [`faker.finance`](https://fakerjs.dev/api/finance.html).
*/
export class CompanyModule extends ModuleBase {
/**
* Returns an array with possible company name suffixes.
*
* @see faker.company.name(): For generating a complete 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
// eslint-disable-next-line deprecation/deprecation
return [...this.faker.definitions.company.suffix];
}
/**
* Generates a random company name.
*
* @example
* faker.company.name() // 'Zieme, Hauck and McClure'
*
* @since 7.4.0
*/
name(): string {
return this.faker.helpers.fake(this.faker.definitions.company.name_pattern);
}
/**
* Returns a random company suffix.
*
* @see faker.company.name(): For generating a complete 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(
// eslint-disable-next-line deprecation/deprecation
this.suffixes()
);
}
/**
* Generates a random catch phrase that can be displayed to an end user.
*
* @example
* faker.company.catchPhrase() // 'Upgradable systematic flexibility'
*
* @since 2.0.1
*/
catchPhrase(): string {
return [
this.catchPhraseAdjective(),
this.catchPhraseDescriptor(),
this.catchPhraseNoun(),
].join(' ');
}
/**
* Generates a random company bs phrase.
*
* @example
* faker.company.bs() // 'cultivate synergistic e-markets'
*
* @since 2.0.1
*
* @deprecated Use `faker.company.buzzPhrase` instead.
*/
bs(): string {
deprecated({
deprecated: 'faker.company.bs',
proposed: 'faker.company.buzzPhrase',
since: '8.0',
until: '9.0',
});
return this.buzzPhrase();
}
/**
* Generates a random buzz phrase that can be used to demonstrate data being viewed by a manager.
*
* @example
* faker.company.buzzPhrase() // 'cultivate synergistic e-markets'
*
* @since 8.0.0
*/
buzzPhrase(): string {
return [this.buzzVerb(), this.buzzAdjective(), this.buzzNoun()].join(' ');
}
/**
* Returns a random catch phrase adjective that can be displayed to an end user..
*
* @example
* faker.company.catchPhraseAdjective() // 'Multi-tiered'
*
* @since 2.0.1
*/
catchPhraseAdjective(): string {
return this.faker.helpers.arrayElement(
this.faker.definitions.company.adjective
);
}
/**
* Returns a random catch phrase descriptor that can be displayed to an end user..
*
* @example
* faker.company.catchPhraseDescriptor() // 'composite'
*
* @since 2.0.1
*/
catchPhraseDescriptor(): string {
return this.faker.helpers.arrayElement(
this.faker.definitions.company.descriptor
);
}
/**
* Returns a random catch phrase noun that can be displayed to an end user..
*
* @example
* faker.company.catchPhraseNoun() // 'leverage'
*
* @since 2.0.1
*/
catchPhraseNoun(): string {
return this.faker.helpers.arrayElement(this.faker.definitions.company.noun);
}
/**
* Returns a random company bs adjective.
*
* @example
* faker.company.bsAdjective() // 'one-to-one'
*
* @since 2.0.1
*
* @deprecated Use `faker.company.buzzAdjective` instead.
*/
bsAdjective(): string {
deprecated({
deprecated: 'faker.company.bsAdjective',
proposed: 'faker.company.buzzAdjective',
since: '8.0',
until: '9.0',
});
return this.buzzAdjective();
}
/**
* Returns a random buzz adjective that can be used to demonstrate data being viewed by a manager.
*
* @example
* faker.company.buzzAdjective() // 'one-to-one'
*
* @since 8.0.0
*/
buzzAdjective(): string {
return this.faker.helpers.arrayElement(
this.faker.definitions.company.buzz_adjective
);
}
/**
* Returns a random company bs buzz word.
*
* @example
* faker.company.bsBuzz() // 'empower'
*
* @since 2.0.1
*
* @deprecated Use `faker.company.buzzVerb` instead.
*/
bsBuzz(): string {
deprecated({
deprecated: 'faker.company.bsBuzz',
proposed: 'faker.company.buzzVerb',
since: '8.0',
until: '9.0',
});
return this.buzzVerb();
}
/**
* Returns a random buzz verb that can be used to demonstrate data being viewed by a manager.
*
* @example
* faker.company.buzzVerb() // 'empower'
*
* @since 8.0.0
*/
buzzVerb(): string {
return this.faker.helpers.arrayElement(
this.faker.definitions.company.buzz_verb
);
}
/**
* Returns a random company bs noun.
*
* @example
* faker.company.bsNoun() // 'paradigms'
*
* @since 2.0.1
*
* @deprecated Use `faker.company.buzzNoun` instead.
*/
bsNoun(): string {
deprecated({
deprecated: 'faker.company.bsNoun',
proposed: 'faker.company.buzzNoun',
since: '8.0',
until: '9.0',
});
return this.buzzNoun();
}
/**
* Returns a random buzz noun that can be used to demonstrate data being viewed by a manager.
*
* @example
* faker.company.buzzNoun() // 'paradigms'
*
* @since 8.0.0
*/
buzzNoun(): string {
return this.faker.helpers.arrayElement(
this.faker.definitions.company.buzz_noun
);
}
}