diff options
| author | Piotr Kuczynski <[email protected]> | 2022-03-28 18:39:26 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-03-28 16:39:26 +0000 |
| commit | 814880b5b209d6f9c6ffb2c0ab5342c4c456b0b7 (patch) | |
| tree | 93bcf239cf6dc0f0c0f131e47b72bc36eb2691b0 /src/git.ts | |
| parent | 3e47440c21d05adadff860a6e1a72e947f73beae (diff) | |
| download | faker-814880b5b209d6f9c6ffb2c0ab5342c4c456b0b7.tar.xz faker-814880b5b209d6f9c6ffb2c0ab5342c4c456b0b7.zip | |
refactor: drop usage of `fake` for internal calls (#703)
Diffstat (limited to 'src/git.ts')
| -rw-r--r-- | src/git.ts | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -61,18 +61,17 @@ export class Git { */ commitEntry(options: { merge?: boolean } = {}): string { // TODO @Shinigami92 2022-01-11: We may want to make it configurable to use just `\n` instead of `\r\n` - let entry = 'commit {{git.commitSha}}\r\n'; + let entry = `commit ${this.commitSha()}\r\n`; if (options.merge || this.faker.datatype.number({ min: 0, max: 4 }) === 0) { - entry += 'Merge: {{git.shortSha}} {{git.shortSha}}\r\n'; + entry += `Merge: ${this.shortSha()}} ${this.shortSha()}\r\n`; } - entry += - 'Author: {{name.firstName}} {{name.lastName}} <{{internet.email}}>\r\n'; - entry += 'Date: ' + this.faker.date.recent().toString() + '\r\n'; - entry += '\r\n\xa0\xa0\xa0\xa0{{git.commitMessage}}\r\n'; + entry += `Author: ${this.faker.name.firstName()} ${this.faker.name.lastName()} <${this.faker.internet.email()}>\r\n`; + entry += `Date: ${this.faker.date.recent().toString()}\r\n`; + entry += `\r\n\xa0\xa0\xa0\xa0${this.commitMessage()}\r\n`; - return this.faker.fake(entry); + return entry; } /** @@ -82,8 +81,7 @@ export class Git { * faker.git.commitMessage() // 'reboot cross-platform driver' */ commitMessage(): string { - const format = '{{hacker.verb}} {{hacker.adjective}} {{hacker.noun}}'; - return this.faker.fake(format); + return `${this.faker.hacker.verb()} ${this.faker.hacker.adjective()} ${this.faker.hacker.noun()}`; } /** |
