diff options
| author | Shinigami <[email protected]> | 2022-10-17 04:05:05 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-10-16 22:05:05 +0200 |
| commit | 20f2236265467feb095cce5b5735bbadc07b9696 (patch) | |
| tree | ffb3b6a4c6c1f0e7e30b4d02e97de63789030ee1 /src/modules/helpers | |
| parent | 90b9c5c39b8c193d41b7d3d9801e5b10360daa4c (diff) | |
| download | faker-20f2236265467feb095cce5b5735bbadc07b9696.tar.xz faker-20f2236265467feb095cce5b5735bbadc07b9696.zip | |
refactor(person)!: rename name module (#1445)
Co-authored-by: ST-DDT <[email protected]>
Diffstat (limited to 'src/modules/helpers')
| -rw-r--r-- | src/modules/helpers/index.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/modules/helpers/index.ts b/src/modules/helpers/index.ts index 5f90027d..bd765802 100644 --- a/src/modules/helpers/index.ts +++ b/src/modules/helpers/index.ts @@ -276,7 +276,7 @@ export class HelpersModule { * * @example * faker.helpers.uniqueArray(faker.random.word, 50) - * faker.helpers.uniqueArray(faker.definitions.name.first_name, 6) + * faker.helpers.uniqueArray(faker.definitions.person.first_name, 6) * faker.helpers.uniqueArray(["Hello", "World", "Goodbye"], 2) * * @since 6.0.0 @@ -478,10 +478,10 @@ export class HelpersModule { * It checks the given string for placeholders and replaces them by calling faker methods: * * ```js - * const hello = faker.helpers.fake('Hi, my name is {{name.firstName}} {{name.lastName}}!') + * const hello = faker.helpers.fake('Hi, my name is {{person.firstName}} {{person.lastName}}!') * ``` * - * This would use the `faker.name.firstName()` and `faker.name.lastName()` method to resolve the placeholders respectively. + * This would use the `faker.person.firstName()` and `faker.person.lastName()` method to resolve the placeholders respectively. * * It is also possible to provide parameters. At first, they will be parsed as json, * and if that isn't possible, we will fall back to string: @@ -499,10 +499,10 @@ export class HelpersModule { * @see faker.helpers.mustache() to use custom functions for resolution. * * @example - * faker.helpers.fake('{{name.lastName}}') // 'Barrows' - * faker.helpers.fake('{{name.lastName}}, {{name.firstName}} {{name.suffix}}') // 'Durgan, Noe MD' + * faker.helpers.fake('{{person.lastName}}') // 'Barrows' + * faker.helpers.fake('{{person.lastName}}, {{person.firstName}} {{person.suffix}}') // 'Durgan, Noe MD' * faker.helpers.fake('This is static test.') // 'This is static test.' - * faker.helpers.fake('Good Morning {{name.firstName}}!') // 'Good Morning Estelle!' + * faker.helpers.fake('Good Morning {{person.firstName}}!') // 'Good Morning Estelle!' * faker.helpers.fake('You can call me at {{phone.number(!## ### #####!)}}.') // 'You can call me at 202 555 973722.' * faker.helpers.fake('I flipped the coin and got: {{helpers.arrayElement(["heads", "tails"])}}') // 'I flipped the coin and got: tails' * @@ -524,7 +524,7 @@ export class HelpersModule { } // extract method name from between the {{ }} that we found - // for example: {{name.firstName}} + // for example: {{person.firstName}} const token = str.substring(start + 2, end + 2); let method = token.replace('}}', '').replace('{{', ''); @@ -614,7 +614,7 @@ export class HelpersModule { * @param options.store The store of unique entries. Defaults to a global store. * * @example - * faker.helpers.unique(faker.name.firstName) // 'Corbin' + * faker.helpers.unique(faker.person.firstName) // 'Corbin' * * @since 7.5.0 */ |
