Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(locale): move company.name formats to locales #1279

Closed
wants to merge 50 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
f1e52f8
refactor: move formats of company.name to locales
Minozzzi Aug 18, 2022
a1bc23e
refactor(locale): generate locales
Minozzzi Aug 18, 2022
1b84f51
chore(deps): update dependency vitepress to v1.0.0-alpha.8 (#1280)
renovate[bot] Aug 18, 2022
93ef876
chore(deps): update pnpm to v7.9.3 (#1281)
renovate[bot] Aug 18, 2022
1c57de9
docs(definitions/company): change JSDoc name explanation
Minozzzi Aug 18, 2022
a372c8c
test(internet): fix username expecting numbers with length 2 (#1284)
xDivisionByZerox Aug 18, 2022
e6a2fca
refactor(company): rename locales name to name_patterns
Minozzzi Aug 19, 2022
5585869
chore(deps): update vitest to ~0.22.1 (#1285)
renovate[bot] Aug 19, 2022
7a718b9
feat(locale): add directions and directions abbr to pl (#1225)
hankucz Aug 19, 2022
ca7cb41
feat(locale): add horses to pl (#1227)
hankucz Aug 19, 2022
ad3c9bf
feat(name): extract sex generator from gender to sex (#1168)
hankucz Aug 19, 2022
cc8b2b2
feat(locale): add city names (de) (#1283)
atheck Aug 19, 2022
21e3823
docs(modules/company): fix proposed functions to deprecated method co…
Minozzzi Aug 19, 2022
3372df1
chore(deps): update dependency prettier-plugin-organize-imports to ~3…
renovate[bot] Aug 19, 2022
a2ee07e
chore(deps): add glob types (#1288)
Shinigami92 Aug 20, 2022
9bfb31e
refactor(modules/company): keep the static patterns as a fallback
Minozzzi Aug 21, 2022
c678777
chore: merge commit
Minozzzi Aug 21, 2022
9ee725d
refactor: move formats of company.name to locales
Minozzzi Aug 18, 2022
42dd990
refactor(locale): generate locales
Minozzzi Aug 18, 2022
7838135
docs(definitions/company): change JSDoc name explanation
Minozzzi Aug 18, 2022
16f6ff3
refactor(company): rename locales name to name_patterns
Minozzzi Aug 19, 2022
7f6bf43
refactor(modules/company): keep the static patterns as a fallback
Minozzzi Aug 21, 2022
1d6e996
docs(modules/company): fix proposed functions to deprecated method co…
Minozzzi Aug 19, 2022
4721e51
chore: merge branch 'refactor/company/formats' of https://github.com/…
Minozzzi Aug 21, 2022
ef8a05b
refactor: move formats of company.name to locales
Minozzzi Aug 18, 2022
31e5d42
refactor(locale): generate locales
Minozzzi Aug 18, 2022
1165790
docs(definitions/company): change JSDoc name explanation
Minozzzi Aug 18, 2022
169493d
refactor(company): rename locales name to name_patterns
Minozzzi Aug 19, 2022
1c43c05
refactor(modules/company): keep the static patterns as a fallback
Minozzzi Aug 21, 2022
52c440e
docs(modules/company): fix proposed functions to deprecated method co…
Minozzzi Aug 19, 2022
8666ecd
refactor: move formats of company.name to locales
Minozzzi Aug 18, 2022
d2e76cd
chore: merge branch 'refactor/company/formats' of https://github.com/…
Minozzzi Aug 21, 2022
363f637
refactor: move formats of company.name to locales
Minozzzi Aug 18, 2022
db35821
refactor(locale): generate locales
Minozzzi Aug 18, 2022
334dafd
docs(definitions/company): change JSDoc name explanation
Minozzzi Aug 18, 2022
50198ea
refactor(company): rename locales name to name_patterns
Minozzzi Aug 19, 2022
7104834
refactor(modules/company): keep the static patterns as a fallback
Minozzzi Aug 21, 2022
bea672f
docs(modules/company): fix proposed functions to deprecated method co…
Minozzzi Aug 19, 2022
5ed8437
refactor: move formats of company.name to locales
Minozzzi Aug 18, 2022
3896df7
refactor: move formats of company.name to locales
Minozzzi Aug 18, 2022
2ecf7cf
chore: merge branch 'refactor/company/formats' of https://github.com/…
Minozzzi Aug 21, 2022
24af863
refactor: move formats of company.name to locales
Minozzzi Aug 18, 2022
d63b8d1
refactor(locale): generate locales
Minozzzi Aug 18, 2022
4d04573
docs(definitions/company): change JSDoc name explanation
Minozzzi Aug 18, 2022
a7b36c1
refactor(company): rename locales name to name_patterns
Minozzzi Aug 19, 2022
aab511f
refactor(modules/company): keep the static patterns as a fallback
Minozzzi Aug 21, 2022
1284666
docs(modules/company): fix proposed functions to deprecated method co…
Minozzzi Aug 19, 2022
658747b
refactor: move formats of company.name to locales
Minozzzi Aug 18, 2022
0b93c3a
refactor: move formats of company.name to locales
Minozzzi Aug 18, 2022
0e0d3aa
chore: merge branch 'refactor/company/formats' of https://github.com/…
Minozzzi Aug 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/definitions/company.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ export type CompanyDefinitions = LocaleEntry<{
*/
descriptor: string[];

/**
* A list of patterns used to generate company names.
*/
name: string[];

/**
* Catchphrase adjectives.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/locales/en/company/name.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default [
'{{name.last_name}} {{company.suffix}}',
'{{name.last_name}}-{{name.last_name}}',
'{{name.last_name}} - {{name.last_name}}',
'{{name.last_name}}, {{name.last_name}} and {{name.last_name}}',
];
9 changes: 2 additions & 7 deletions src/modules/company/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,15 @@ export class Company {
* faker.company.name() // 'Zieme, Hauck and McClure'
*/
name(format?: number): string {
const formats = [
'{{name.lastName}} {{company.companySuffix}}',
'{{name.lastName}} - {{name.lastName}}',
'{{name.lastName}}, {{name.lastName}} and {{name.lastName}}',
];

if (format != null) {
deprecated({
deprecated: 'faker.company.name(format)',
proposed: 'faker.company.name()',
proposed: 'faker.company.name() or faker.fake(format)',
since: '7.4',
until: '8.0',
});
}
const formats = this.faker.definitions.company.name;

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