-
-
Notifications
You must be signed in to change notification settings - Fork 949
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(person)!: rename name module (#1445)
Co-authored-by: ST-DDT <[email protected]>
- Loading branch information
1 parent
90b9c5c
commit 20f2236
Showing
593 changed files
with
1,173 additions
and
1,112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ Using Faker is as easy as importing it from `@faker-js/faker`. | |
```js | ||
import { faker } from '@faker-js/faker'; | ||
|
||
const randomName = faker.name.fullName(); // Rowan Nikolaus | ||
const randomName = faker.person.fullName(); // Rowan Nikolaus | ||
const randomEmail = faker.internet.email(); // [email protected] | ||
``` | ||
|
||
|
@@ -16,7 +16,7 @@ Or if you using CommonJS | |
```js | ||
const { faker } = require('@faker-js/faker'); | ||
|
||
const randomName = faker.name.fullName(); // Rowan Nikolaus | ||
const randomName = faker.person.fullName(); // Rowan Nikolaus | ||
const randomEmail = faker.internet.email(); // [email protected] | ||
``` | ||
|
||
|
@@ -27,7 +27,7 @@ const randomEmail = faker.internet.email(); // [email protected] | |
import { faker } from 'https://cdn.skypack.dev/@faker-js/faker'; | ||
// Caitlyn Kerluke | ||
const randomName = faker.name.fullName(); | ||
const randomName = faker.person.fullName(); | ||
// [email protected] | ||
const randomEmail = faker.internet.email(); | ||
|
@@ -43,7 +43,7 @@ Using the browser is great for experimenting 👍. However, due to all of the st | |
```js | ||
import { faker } from 'https://cdn.skypack.dev/@faker-js/faker'; | ||
|
||
const randomName = faker.name.findName(); // Willie Bahringer | ||
const randomName = faker.person.findName(); // Willie Bahringer | ||
const randomEmail = faker.internet.email(); // [email protected] | ||
``` | ||
|
||
|
@@ -120,9 +120,9 @@ function createRandomUser(): User { | |
avatar: faker.image.avatar(), | ||
birthday: faker.date.birthdate(), | ||
email: faker.internet.email(), | ||
firstName: faker.name.firstName(), | ||
lastName: faker.name.lastName(), | ||
sex: faker.name.sexType(), | ||
firstName: faker.person.firstName(), | ||
lastName: faker.person.lastName(), | ||
sex: faker.person.sexType(), | ||
subscriptionTier: faker.helpers.arrayElement(['free', 'basic', 'business']), | ||
}; | ||
} | ||
|
@@ -142,9 +142,9 @@ Let's refactor our current code: | |
import { faker } from '@faker-js/faker'; | ||
|
||
function createRandomUser(): User { | ||
const sex = this.faker.name.sexType(); | ||
const firstName = faker.name.firstName(sex); | ||
const lastName = faker.name.lastName(); | ||
const sex = this.faker.person.sexType(); | ||
const firstName = faker.person.firstName(sex); | ||
const lastName = faker.person.lastName(); | ||
const email = faker.internet.email(firstName, lastName); | ||
|
||
return { | ||
|
@@ -179,9 +179,9 @@ Faker has your back, with another helper method: | |
import { faker } from '@faker-js/faker'; | ||
|
||
function createRandomUser(): User { | ||
const sex = this.faker.name.sexType(); | ||
const firstName = faker.name.firstName(sex); | ||
const lastName = faker.name.lastName(); | ||
const sex = this.faker.person.sexType(); | ||
const firstName = faker.person.firstName(sex); | ||
const lastName = faker.person.lastName(); | ||
const email = faker.helpers.unique(faker.internet.email, [ | ||
firstName, | ||
lastName, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export default [ | ||
'{{address.city_prefix}} {{name.firstName}}{{address.city_suffix}}', | ||
'{{address.city_prefix}} {{name.firstName}}', | ||
'{{name.firstName}}{{address.city_suffix}}', | ||
'{{name.lastName}}{{address.city_suffix}}', | ||
'{{address.city_prefix}} {{person.firstName}}{{address.city_suffix}}', | ||
'{{address.city_prefix}} {{person.firstName}}', | ||
'{{person.firstName}}{{address.city_suffix}}', | ||
'{{person.lastName}}{{address.city_suffix}}', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export default [ | ||
'{{name.firstName}} {{address.street_suffix}}', | ||
'{{name.lastName}} {{address.street_suffix}}', | ||
'{{person.firstName}} {{address.street_suffix}}', | ||
'{{person.lastName}} {{address.street_suffix}}', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export default [ | ||
'{{address.street_prefix}} {{name.first_name}}', | ||
'{{address.street_prefix}} {{name.last_name}}', | ||
'{{address.street_prefix}} {{person.first_name}}', | ||
'{{address.street_prefix}} {{person.last_name}}', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default [ | ||
'{{person.prefix}} {{person.first_name}} {{person.last_name}}', | ||
'{{person.first_name}} {{person.last_name}}', | ||
'{{person.last_name}} {{person.first_name}}', | ||
]; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.