From 98bd988305db71e438c3ea5ce31d9bf4c3df0843 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Sun, 6 Feb 2022 12:01:04 +0100 Subject: docs: improve git jsdocs (#435) --- src/git.ts | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'src/git.ts') diff --git a/src/git.ts b/src/git.ts index 366e819e..d708bc12 100644 --- a/src/git.ts +++ b/src/git.ts @@ -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 + * // 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 = ''; -- cgit v1.2.3