aboutsummaryrefslogtreecommitdiff
path: root/src/modules/git
diff options
context:
space:
mode:
authorShinigami <[email protected]>2023-01-18 21:01:58 +0100
committerGitHub <[email protected]>2023-01-18 21:01:58 +0100
commit250fbb71eb68aa469b6b833a61a4d23fb60ad65d (patch)
tree0a5d282f61852a5eb94b118bafba175d4f81a824 /src/modules/git
parent0ac998992c87f9bfd5c1fae3c59ca6b79ef5b4b9 (diff)
downloadfaker-250fbb71eb68aa469b6b833a61a4d23fb60ad65d.tar.xz
faker-250fbb71eb68aa469b6b833a61a4d23fb60ad65d.zip
docs: jsdoc for options (#1644)
Diffstat (limited to 'src/modules/git')
-rw-r--r--src/modules/git/index.ts33
1 files changed, 30 insertions, 3 deletions
diff --git a/src/modules/git/index.ts b/src/modules/git/index.ts
index 4d8e2cd0..1f6d366f 100644
--- a/src/modules/git/index.ts
+++ b/src/modules/git/index.ts
@@ -56,7 +56,7 @@ export class GitModule {
* 'LF' = '\n',
* 'CRLF' = '\r\n'
*
- * @param options.refDate The date to use as reference point for the commit. Defaults to now.
+ * @param options.refDate The date to use as reference point for the commit. Defaults to `new Date()`.
*
* @example
* faker.git.commitEntry()
@@ -70,8 +70,26 @@ export class GitModule {
*/
commitEntry(
options: {
+ /**
+ * Set to `true` to generate a merge message line.
+ *
+ * @default faker.datatype.boolean({ probability: 0.2 })
+ */
merge?: boolean;
+ /**
+ * Choose the end of line character to use.
+ *
+ * - 'LF' = '\n',
+ * - 'CRLF' = '\r\n'
+ *
+ * @default 'CRLF'
+ */
eol?: 'LF' | 'CRLF';
+ /**
+ * The date to use as reference point for the commit.
+ *
+ * @default new Date()
+ */
refDate?: string | Date | number;
} = {}
): string {
@@ -125,7 +143,7 @@ export class GitModule {
* Generates a date string for a git commit using the same format as `git log`.
*
* @param options The optional options object.
- * @param options.refDate The date to use as reference point for the commit. Defaults to now.
+ * @param options.refDate The date to use as reference point for the commit. Defaults to `new Date()`.
*
* @example
* faker.git.commitDate() // 'Mon Nov 7 14:40:58 2022 +0600'
@@ -133,7 +151,16 @@ export class GitModule {
*
* @since 8.0.0
*/
- commitDate(options: { refDate?: string | Date | number } = {}): string {
+ commitDate(
+ options: {
+ /**
+ * The date to use as reference point for the commit.
+ *
+ * @default new Date()
+ */
+ refDate?: string | Date | number;
+ } = {}
+ ): string {
const { refDate } = options;
const dateParts = GIT_DATE_FORMAT_BASE.format(