diff options
Diffstat (limited to 'src/git.ts')
| -rw-r--r-- | src/git.ts | 34 |
1 files changed, 23 insertions, 11 deletions
@@ -1,5 +1,8 @@ import type { Faker } from '.'; +/** + * Module to generate git related entries. + */ export class Git { private hexChars = [ '0', @@ -31,9 +34,10 @@ export class Git { } /** - * branch + * Generates a random branch name. * - * @method faker.git.branch + * @example + * faker.git.branch() // 'feed-parse' */ branch(): string { const noun = this.faker.hacker.noun().replace(' ', '-'); @@ -42,10 +46,15 @@ export class Git { } /** - * commitEntry + * Generates a random commit entry. * - * @method faker.git.commitEntry - * @param options + * @example + * faker.git.commitEntry() + * // commit fe8c38a965d13d9794eb36918cb24cebe49a45c2 + * // Author: Mable Harvey <[email protected]> + * // Date: Sat Feb 05 2022 15:09:18 GMT+0100 (Mitteleuropäische Normalzeit) + * // + * // copy primary system */ 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` @@ -64,9 +73,10 @@ export class Git { } /** - * commitMessage + * Generates a random commit message. * - * @method faker.git.commitMessage + * @example + * faker.git.commitMessage() // 'reboot cross-platform driver' */ commitMessage(): string { const format = '{{hacker.verb}} {{hacker.adjective}} {{hacker.noun}}'; @@ -74,9 +84,10 @@ export class Git { } /** - * commitSha + * Generates a random commit sha (full). * - * @method faker.git.commitSha + * @example + * faker.git.commitSha() // '2c6e3880fd94ddb7ef72d34e683cdc0c47bec6e6' */ commitSha(): string { let commit = ''; @@ -89,9 +100,10 @@ export class Git { } /** - * shortSha + * Generates a random commit sha (short). * - * @method faker.git.shortSha + * @example + * faker.git.shortSha() // '6155732' */ shortSha(): string { let shortSha = ''; |
