aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorST-DDT <[email protected]>2022-02-06 12:01:04 +0100
committerGitHub <[email protected]>2022-02-06 12:01:04 +0100
commit98bd988305db71e438c3ea5ce31d9bf4c3df0843 (patch)
treef318d6c95da69bd23decad4ad40987d5b925f0bb
parent30b0faa1cba1d3cd74e95315347b98a49ebcb76b (diff)
downloadfaker-98bd988305db71e438c3ea5ce31d9bf4c3df0843.tar.xz
faker-98bd988305db71e438c3ea5ce31d9bf4c3df0843.zip
docs: improve git jsdocs (#435)
-rw-r--r--src/git.ts34
1 files changed, 23 insertions, 11 deletions
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 <[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 = '';