Skip to content

Commit

Permalink
feat(person): use fake patterns for jobTitle (#2528)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewmayer authored Nov 7, 2023
1 parent e4865df commit b40ad45
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/definitions/person.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export type PersonDefinition = LocaleEntry<{

title: PersonTitleDefinition;

job_title_pattern: string[];

western_zodiac_sign: string[];
}>;

Expand Down
2 changes: 2 additions & 0 deletions src/locales/en/person/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import female_middle_name from './female_middle_name';
import female_prefix from './female_prefix';
import first_name from './first_name';
import gender from './gender';
import job_title_pattern from './job_title_pattern';
import last_name from './last_name';
import last_name_pattern from './last_name_pattern';
import male_first_name from './male_first_name';
Expand All @@ -33,6 +34,7 @@ const person: PersonDefinition = {
female_prefix,
first_name,
gender,
job_title_pattern,
last_name,
last_name_pattern,
male_first_name,
Expand Down
3 changes: 3 additions & 0 deletions src/locales/en/person/job_title_pattern.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default [
'{{person.jobDescriptor}} {{person.jobArea}} {{person.jobType}}',
];
2 changes: 2 additions & 0 deletions src/locales/es/person/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { PersonDefinition } from '../../..';
import female_first_name from './female_first_name';
import female_prefix from './female_prefix';
import first_name from './first_name';
import job_title_pattern from './job_title_pattern';
import last_name from './last_name';
import last_name_pattern from './last_name_pattern';
import male_first_name from './male_first_name';
Expand All @@ -19,6 +20,7 @@ const person: PersonDefinition = {
female_first_name,
female_prefix,
first_name,
job_title_pattern,
last_name,
last_name_pattern,
male_first_name,
Expand Down
3 changes: 3 additions & 0 deletions src/locales/es/person/job_title_pattern.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default [
'{{person.jobType}} de {{person.jobArea}} {{person.jobDescriptor}}',
];
4 changes: 3 additions & 1 deletion src/modules/person/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,9 @@ export class PersonModule extends ModuleBase {
* @since 8.0.0
*/
jobTitle(): string {
return `${this.jobDescriptor()} ${this.jobArea()} ${this.jobType()}`;
return this.faker.helpers.fake(
this.faker.definitions.person.job_title_pattern
);
}

/**
Expand Down

0 comments on commit b40ad45

Please sign in to comment.