From 618362c79adab7545d8ac00dc6c29a787323d6e5 Mon Sep 17 00:00:00 2001 From: Eric Cheng Date: Fri, 26 Aug 2022 18:51:48 -0400 Subject: [PATCH 1/7] fix(datatype): unintentional hex breaking change --- src/modules/color/index.ts | 4 +++- src/modules/database/index.ts | 4 +++- src/modules/datatype/index.ts | 19 ++++++--------- src/modules/finance/index.ts | 1 - src/modules/git/index.ts | 8 +++++-- test/__snapshots__/datatype.spec.ts.snap | 30 ++++++++++-------------- test/datatype.spec.ts | 25 +++++++------------- 7 files changed, 39 insertions(+), 52 deletions(-) diff --git a/src/modules/color/index.ts b/src/modules/color/index.ts index d64b7750545..3adb5eadfeb 100644 --- a/src/modules/color/index.ts +++ b/src/modules/color/index.ts @@ -297,7 +297,9 @@ export class Color { let color: string | number[]; let cssFunction: CSSFunction = 'rgb'; if (format === 'hex') { - color = this.faker.datatype.hexadecimal({ length: includeAlpha ? 8 : 6 }); + color = this.faker.datatype + .hexadecimal({ length: includeAlpha ? 8 : 6 }) + .slice(2); color = formatHexColor(color, options); return color; } diff --git a/src/modules/database/index.ts b/src/modules/database/index.ts index 5887ab097e5..26781a041b9 100644 --- a/src/modules/database/index.ts +++ b/src/modules/database/index.ts @@ -69,6 +69,8 @@ export class Database { * faker.database.mongodbObjectId() // 'e175cac316a79afdd0ad3afb' */ mongodbObjectId(): string { - return this.faker.datatype.hexadecimal({ length: 24, case: 'lower' }); + return this.faker.datatype + .hexadecimal({ length: 24, case: 'lower' }) + .replace('0x', ''); } } diff --git a/src/modules/datatype/index.ts b/src/modules/datatype/index.ts index 671e8c6c53d..20338ee6b75 100644 --- a/src/modules/datatype/index.ts +++ b/src/modules/datatype/index.ts @@ -190,22 +190,17 @@ export class Datatype { * * @param options The optional options object. * @param options.length Length of the generated number. Defaults to `1`. - * @param options.prefix Prefix for the generated number. Defaults to `''`. * @param options.case Case of the generated number. Defaults to `'mixed'`. * * @example - * faker.datatype.hexadecimal() // 'B' - * faker.datatype.hexadecimal({ length: 10 }) // 'aE13d044cB' - * faker.datatype.hexadecimal({ prefix: '0x' }) // '0xE' - * faker.datatype.hexadecimal({ case: 'lower' }) // 'f' - * faker.datatype.hexadecimal({ length: 10, prefix: '0x' }) // '0xf12a974eB1' - * faker.datatype.hexadecimal({ length: 10, case: 'upper' }) // 'E3F38014FB' - * faker.datatype.hexadecimal({ prefix: '0x', case: 'lower' }) // '0xd' - * faker.datatype.hexadecimal({ length: 10, prefix: '0x', case: 'mixed' }) // '0xAdE330a4D1' + * faker.datatype.hexadecimal() // '0xB' + * faker.datatype.hexadecimal({ length: 10 }) // '0xaE13d044cB' + * faker.datatype.hexadecimal({ case: 'lower' }) // '0xf' + * faker.datatype.hexadecimal({ length: 10, case: 'upper' }) // '0xE3F38014FB' */ hexadecimal( options: - | { length?: number; prefix?: string; case?: 'lower' | 'upper' | 'mixed' } + | { length?: number; case?: 'lower' | 'upper' | 'mixed' } | number = {} ): string { if (typeof options === 'number') { @@ -220,7 +215,7 @@ export class Datatype { }; } - const { length = 1, prefix = '', case: letterCase = 'mixed' } = options; + const { length = 1, case: letterCase = 'mixed' } = options; let wholeString = ''; @@ -257,7 +252,7 @@ export class Datatype { wholeString = wholeString.toLowerCase(); } - return `${prefix}${wholeString}`; + return `0x${wholeString}`; } /** diff --git a/src/modules/finance/index.ts b/src/modules/finance/index.ts index f1b089e320c..c6f799764a5 100644 --- a/src/modules/finance/index.ts +++ b/src/modules/finance/index.ts @@ -323,7 +323,6 @@ export class Finance { ethereumAddress(): string { const address = this.faker.datatype.hexadecimal({ length: 40, - prefix: '0x', case: 'lower', }); return address; diff --git a/src/modules/git/index.ts b/src/modules/git/index.ts index 215962731d0..e416c27cd34 100644 --- a/src/modules/git/index.ts +++ b/src/modules/git/index.ts @@ -92,7 +92,9 @@ export class Git { * faker.git.commitSha() // '2c6e3880fd94ddb7ef72d34e683cdc0c47bec6e6' */ commitSha(): string { - return this.faker.datatype.hexadecimal({ length: 40, case: 'lower' }); + return this.faker.datatype + .hexadecimal({ length: 40, case: 'lower' }) + .substring(2); } /** @@ -102,6 +104,8 @@ export class Git { * faker.git.shortSha() // '6155732' */ shortSha(): string { - return this.faker.datatype.hexadecimal({ length: 7, case: 'lower' }); + return this.faker.datatype + .hexadecimal({ length: 7, case: 'lower' }) + .substring(2); } } diff --git a/test/__snapshots__/datatype.spec.ts.snap b/test/__snapshots__/datatype.spec.ts.snap index 97f2d4c64e1..fd57752d866 100644 --- a/test/__snapshots__/datatype.spec.ts.snap +++ b/test/__snapshots__/datatype.spec.ts.snap @@ -70,15 +70,13 @@ exports[`datatype > 42 > float > with min and max 1`] = `-0.43`; exports[`datatype > 42 > float > with min, max and precision 1`] = `-0.4261`; -exports[`datatype > 42 > hexadecimal > noArgs 1`] = `"8"`; +exports[`datatype > 42 > hexadecimal > noArgs 1`] = `"0x8"`; -exports[`datatype > 42 > hexadecimal > with casing 1`] = `"8"`; +exports[`datatype > 42 > hexadecimal > with casing 1`] = `"0x8"`; -exports[`datatype > 42 > hexadecimal > with length 1`] = `"8BE4ABdd39321aD7d3fe01FfCE404F4d6db0906bd8"`; +exports[`datatype > 42 > hexadecimal > with length 1`] = `"0x8BE4ABdd39321aD7d3fe01FfCE404F4d6db0906bd8"`; -exports[`datatype > 42 > hexadecimal > with length, prefix, and casing 1`] = `"0x8be4abdd39321ad7d3fe"`; - -exports[`datatype > 42 > hexadecimal > with prefix 1`] = `"0x8"`; +exports[`datatype > 42 > hexadecimal > with length and casing 1`] = `"0x8be4abdd39321ad7d3fe"`; exports[`datatype > 42 > json 1`] = `"{\\"foo\\":79654,\\"bar\\":\\"2eiXX/J/*&\\",\\"bike\\":86617,\\"a\\":60111,\\"b\\":70807,\\"name\\":\\"\\\\\\"&{dnx4!1}\\",\\"prop\\":61748}"`; @@ -186,15 +184,13 @@ exports[`datatype > 1211 > float > with min and max 1`] = `61.07`; exports[`datatype > 1211 > float > with min, max and precision 1`] = `61.0658`; -exports[`datatype > 1211 > hexadecimal > noArgs 1`] = `"E"`; - -exports[`datatype > 1211 > hexadecimal > with casing 1`] = `"e"`; +exports[`datatype > 1211 > hexadecimal > noArgs 1`] = `"0xE"`; -exports[`datatype > 1211 > hexadecimal > with length 1`] = `"EaDB42F0e3f4A973fAB0AeefCE96DFCF49cD438dF9"`; +exports[`datatype > 1211 > hexadecimal > with casing 1`] = `"0xe"`; -exports[`datatype > 1211 > hexadecimal > with length, prefix, and casing 1`] = `"0xeadb42f0e3f4a973fab0"`; +exports[`datatype > 1211 > hexadecimal > with length 1`] = `"0xEaDB42F0e3f4A973fAB0AeefCE96DFCF49cD438dF9"`; -exports[`datatype > 1211 > hexadecimal > with prefix 1`] = `"0xE"`; +exports[`datatype > 1211 > hexadecimal > with length and casing 1`] = `"0xeadb42f0e3f4a973fab0"`; exports[`datatype > 1211 > json 1`] = `"{\\"foo\\":\\"Kti5-}$_/\`\\",\\"bar\\":76408,\\"bike\\":35403,\\"a\\":69406,\\"b\\":\\"l\\\\\\"h^]dnwI<\\",\\"name\\":\\"|p|5KWu3/C\\",\\"prop\\":\\"|Jh!E=x\\\\\\"RH\\"}"`; @@ -302,15 +298,13 @@ exports[`datatype > 1337 > float > with min and max 1`] = `-12.92`; exports[`datatype > 1337 > float > with min, max and precision 1`] = `-12.9153`; -exports[`datatype > 1337 > hexadecimal > noArgs 1`] = `"5"`; - -exports[`datatype > 1337 > hexadecimal > with casing 1`] = `"5"`; +exports[`datatype > 1337 > hexadecimal > noArgs 1`] = `"0x5"`; -exports[`datatype > 1337 > hexadecimal > with length 1`] = `"5c346ba075bd57F5A62B82d72AF39CBBB07a98cbA8"`; +exports[`datatype > 1337 > hexadecimal > with casing 1`] = `"0x5"`; -exports[`datatype > 1337 > hexadecimal > with length, prefix, and casing 1`] = `"0x5c346ba075bd57f5a62b"`; +exports[`datatype > 1337 > hexadecimal > with length 1`] = `"0x5c346ba075bd57F5A62B82d72AF39CBBB07a98cbA8"`; -exports[`datatype > 1337 > hexadecimal > with prefix 1`] = `"0x5"`; +exports[`datatype > 1337 > hexadecimal > with length and casing 1`] = `"0x5c346ba075bd57f5a62b"`; exports[`datatype > 1337 > json 1`] = `"{\\"foo\\":56052,\\"bar\\":21258,\\"bike\\":54308,\\"a\\":3397,\\"b\\":23538,\\"name\\":\\"X9@{:e=+kD\\",\\"prop\\":62850}"`; diff --git a/test/datatype.spec.ts b/test/datatype.spec.ts index a57139fdd0c..54a3ef016db 100644 --- a/test/datatype.spec.ts +++ b/test/datatype.spec.ts @@ -61,11 +61,9 @@ describe('datatype', () => { t.describe('hexadecimal', (t) => { t.it('noArgs') .it('with length', { length: 42 }) - .it('with prefix', { prefix: '0x' }) .it('with casing', { case: 'lower' }) - .it('with length, prefix, and casing', { + .it('with length and casing', { length: 20, - prefix: '0x', case: 'lower', }); }); @@ -331,31 +329,24 @@ describe('datatype', () => { describe('hexadecimal', () => { it('generates single hex character when no additional argument was provided', () => { const hex = faker.datatype.hexadecimal(); - expect(hex).toMatch(/^[0-9a-f]{1}$/i); - expect(hex).toHaveLength(1); + expect(hex).toMatch(/^(0x)[0-9a-f]{1}$/i); + expect(hex.substring(2)).toHaveLength(1); }); it('generates a random hex string with a provided length', () => { const hex = faker.datatype.hexadecimal({ length: 5 }); - expect(hex).toMatch(/^[0-9a-f]+$/i); - expect(hex).toHaveLength(5); - }); - - it('generates a hex string with a provided prefix', () => { - const hex = faker.datatype.hexadecimal({ prefix: '0x' }); - expect(hex).toMatch(/^(0x)[0-9A-F]+$/i); - expect(hex).toHaveLength(3); + expect(hex).toMatch(/^(0x)[0-9a-f]+$/i); + expect(hex.substring(2)).toHaveLength(5); }); it('generates a hex string with a provided casing', () => { const hex = faker.datatype.hexadecimal({ case: 'lower' }); - expect(hex).toMatch(/^[0-9a-f]+$/i); - expect(hex).toHaveLength(1); + expect(hex).toMatch(/^(0x)[0-9a-f]+$/i); + expect(hex.substring(2)).toHaveLength(1); }); - it('generates a hex string with a provided prefix, length, and casing', () => { + it('generates a hex string with a provided length and casing', () => { const hex = faker.datatype.hexadecimal({ - prefix: '0x', length: 7, case: 'upper', }); From 4ad1d739c4078825b86fdf6e380a082da37a1ba6 Mon Sep 17 00:00:00 2001 From: Eric Cheng Date: Fri, 26 Aug 2022 19:05:58 -0400 Subject: [PATCH 2/7] fix: revert feature deletion --- src/modules/datatype/index.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/modules/datatype/index.ts b/src/modules/datatype/index.ts index 20338ee6b75..57399450870 100644 --- a/src/modules/datatype/index.ts +++ b/src/modules/datatype/index.ts @@ -190,17 +190,22 @@ export class Datatype { * * @param options The optional options object. * @param options.length Length of the generated number. Defaults to `1`. + * @param options.prefix Prefix for the generated number. Defaults to `'0x'`. * @param options.case Case of the generated number. Defaults to `'mixed'`. * * @example * faker.datatype.hexadecimal() // '0xB' * faker.datatype.hexadecimal({ length: 10 }) // '0xaE13d044cB' - * faker.datatype.hexadecimal({ case: 'lower' }) // '0xf' + * faker.datatype.hexadecimal({ prefix: '0x' }) // '0xE' + * faker.datatype.hexadecimal({ case: 'lower' }) // 'f' + * faker.datatype.hexadecimal({ length: 10, prefix: '#' }) // '#f12a974eB1' * faker.datatype.hexadecimal({ length: 10, case: 'upper' }) // '0xE3F38014FB' + * faker.datatype.hexadecimal({ prefix: '', case: 'lower' }) // 'd' + * faker.datatype.hexadecimal({ length: 10, prefix: '0x', case: 'mixed' }) // '0xAdE330a4D1' */ hexadecimal( options: - | { length?: number; case?: 'lower' | 'upper' | 'mixed' } + | { length?: number; prefix?: string; case?: 'lower' | 'upper' | 'mixed' } | number = {} ): string { if (typeof options === 'number') { @@ -215,7 +220,7 @@ export class Datatype { }; } - const { length = 1, case: letterCase = 'mixed' } = options; + const { length = 1, prefix = '0x', case: letterCase = 'mixed' } = options; let wholeString = ''; @@ -252,7 +257,7 @@ export class Datatype { wholeString = wholeString.toLowerCase(); } - return `0x${wholeString}`; + return `${prefix}${wholeString}`; } /** From 39ba977d4ad9d66bfa3902b5f60b05fca4a2df19 Mon Sep 17 00:00:00 2001 From: Eric Cheng Date: Fri, 26 Aug 2022 19:07:13 -0400 Subject: [PATCH 3/7] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Leyla Jähnig --- src/modules/color/index.ts | 3 +-- src/modules/database/index.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/modules/color/index.ts b/src/modules/color/index.ts index 3adb5eadfeb..d453e904762 100644 --- a/src/modules/color/index.ts +++ b/src/modules/color/index.ts @@ -298,8 +298,7 @@ export class Color { let cssFunction: CSSFunction = 'rgb'; if (format === 'hex') { color = this.faker.datatype - .hexadecimal({ length: includeAlpha ? 8 : 6 }) - .slice(2); + .hexadecimal({ length: includeAlpha ? 8 : 6, prefix: '' }); color = formatHexColor(color, options); return color; } diff --git a/src/modules/database/index.ts b/src/modules/database/index.ts index 26781a041b9..58d42f9c906 100644 --- a/src/modules/database/index.ts +++ b/src/modules/database/index.ts @@ -70,7 +70,6 @@ export class Database { */ mongodbObjectId(): string { return this.faker.datatype - .hexadecimal({ length: 24, case: 'lower' }) - .replace('0x', ''); + .hexadecimal({ length: 24, case: 'lower', prefix: '' }); } } From ffcd1dbb1addc3c0c8b03cc31864347dc714ddb5 Mon Sep 17 00:00:00 2001 From: Eric Cheng Date: Fri, 26 Aug 2022 19:14:49 -0400 Subject: [PATCH 4/7] test: revert tests to before removal of `prefix` --- test/__snapshots__/datatype.spec.ts.snap | 12 ++++++++++++ test/datatype.spec.ts | 13 +++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/test/__snapshots__/datatype.spec.ts.snap b/test/__snapshots__/datatype.spec.ts.snap index fd57752d866..7980ec5c2d3 100644 --- a/test/__snapshots__/datatype.spec.ts.snap +++ b/test/__snapshots__/datatype.spec.ts.snap @@ -78,6 +78,10 @@ exports[`datatype > 42 > hexadecimal > with length 1`] = `"0x8BE4ABdd39321aD7d3f exports[`datatype > 42 > hexadecimal > with length and casing 1`] = `"0x8be4abdd39321ad7d3fe"`; +exports[`datatype > 42 > hexadecimal > with length, prefix, and casing 1`] = `"0x8be4abdd39321ad7d3fe"`; + +exports[`datatype > 42 > hexadecimal > with prefix 1`] = `"0x8"`; + exports[`datatype > 42 > json 1`] = `"{\\"foo\\":79654,\\"bar\\":\\"2eiXX/J/*&\\",\\"bike\\":86617,\\"a\\":60111,\\"b\\":70807,\\"name\\":\\"\\\\\\"&{dnx4!1}\\",\\"prop\\":61748}"`; exports[`datatype > 42 > number > noArgs 1`] = `37454`; @@ -192,6 +196,10 @@ exports[`datatype > 1211 > hexadecimal > with length 1`] = `"0xEaDB42F0e3f4A973f exports[`datatype > 1211 > hexadecimal > with length and casing 1`] = `"0xeadb42f0e3f4a973fab0"`; +exports[`datatype > 1211 > hexadecimal > with length, prefix, and casing 1`] = `"0xeadb42f0e3f4a973fab0"`; + +exports[`datatype > 1211 > hexadecimal > with prefix 1`] = `"0xE"`; + exports[`datatype > 1211 > json 1`] = `"{\\"foo\\":\\"Kti5-}$_/\`\\",\\"bar\\":76408,\\"bike\\":35403,\\"a\\":69406,\\"b\\":\\"l\\\\\\"h^]dnwI<\\",\\"name\\":\\"|p|5KWu3/C\\",\\"prop\\":\\"|Jh!E=x\\\\\\"RH\\"}"`; exports[`datatype > 1211 > number > noArgs 1`] = `92852`; @@ -306,6 +314,10 @@ exports[`datatype > 1337 > hexadecimal > with length 1`] = `"0x5c346ba075bd57F5A exports[`datatype > 1337 > hexadecimal > with length and casing 1`] = `"0x5c346ba075bd57f5a62b"`; +exports[`datatype > 1337 > hexadecimal > with length, prefix, and casing 1`] = `"0x5c346ba075bd57f5a62b"`; + +exports[`datatype > 1337 > hexadecimal > with prefix 1`] = `"0x5"`; + exports[`datatype > 1337 > json 1`] = `"{\\"foo\\":56052,\\"bar\\":21258,\\"bike\\":54308,\\"a\\":3397,\\"b\\":23538,\\"name\\":\\"X9@{:e=+kD\\",\\"prop\\":62850}"`; exports[`datatype > 1337 > number > noArgs 1`] = `26202`; diff --git a/test/datatype.spec.ts b/test/datatype.spec.ts index 54a3ef016db..25847e07415 100644 --- a/test/datatype.spec.ts +++ b/test/datatype.spec.ts @@ -61,9 +61,11 @@ describe('datatype', () => { t.describe('hexadecimal', (t) => { t.it('noArgs') .it('with length', { length: 42 }) + .it('with prefix', { prefix: '0x' }) .it('with casing', { case: 'lower' }) - .it('with length and casing', { + .it('with length, prefix, and casing', { length: 20, + prefix: '0x', case: 'lower', }); }); @@ -333,6 +335,12 @@ describe('datatype', () => { expect(hex.substring(2)).toHaveLength(1); }); + it('generates a hex string with a provided prefix', () => { + const hex = faker.datatype.hexadecimal({ prefix: '0x' }); + expect(hex).toMatch(/^(0x)[0-9A-F]+$/i); + expect(hex).toHaveLength(3); + }); + it('generates a random hex string with a provided length', () => { const hex = faker.datatype.hexadecimal({ length: 5 }); expect(hex).toMatch(/^(0x)[0-9a-f]+$/i); @@ -345,8 +353,9 @@ describe('datatype', () => { expect(hex.substring(2)).toHaveLength(1); }); - it('generates a hex string with a provided length and casing', () => { + it('generates a hex string with a provided prefix, length, and casing', () => { const hex = faker.datatype.hexadecimal({ + prefix: '0x', length: 7, case: 'upper', }); From e35cd12acddce9077589652ae27bad3130fca05d Mon Sep 17 00:00:00 2001 From: Eric Cheng Date: Fri, 26 Aug 2022 20:13:59 -0400 Subject: [PATCH 5/7] fix: lint issues --- src/modules/color/index.ts | 6 ++++-- src/modules/database/index.ts | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/modules/color/index.ts b/src/modules/color/index.ts index d453e904762..faa898d4c97 100644 --- a/src/modules/color/index.ts +++ b/src/modules/color/index.ts @@ -297,8 +297,10 @@ export class Color { let color: string | number[]; let cssFunction: CSSFunction = 'rgb'; if (format === 'hex') { - color = this.faker.datatype - .hexadecimal({ length: includeAlpha ? 8 : 6, prefix: '' }); + color = this.faker.datatype.hexadecimal({ + length: includeAlpha ? 8 : 6, + prefix: '', + }); color = formatHexColor(color, options); return color; } diff --git a/src/modules/database/index.ts b/src/modules/database/index.ts index 58d42f9c906..69e073159f0 100644 --- a/src/modules/database/index.ts +++ b/src/modules/database/index.ts @@ -69,7 +69,10 @@ export class Database { * faker.database.mongodbObjectId() // 'e175cac316a79afdd0ad3afb' */ mongodbObjectId(): string { - return this.faker.datatype - .hexadecimal({ length: 24, case: 'lower', prefix: '' }); + return this.faker.datatype.hexadecimal({ + length: 24, + case: 'lower', + prefix: '', + }); } } From 7642667e6a12503638a9cfd4f74530c6277d899a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leyla=20J=C3=A4hnig?= Date: Sat, 27 Aug 2022 10:34:42 +0200 Subject: [PATCH 6/7] refactor(git): use hexadecimal prefix option --- src/modules/git/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/modules/git/index.ts b/src/modules/git/index.ts index e416c27cd34..5fa9a20c766 100644 --- a/src/modules/git/index.ts +++ b/src/modules/git/index.ts @@ -93,8 +93,7 @@ export class Git { */ commitSha(): string { return this.faker.datatype - .hexadecimal({ length: 40, case: 'lower' }) - .substring(2); + .hexadecimal({ length: 40, case: 'lower', prefix: '' }); } /** @@ -105,7 +104,6 @@ export class Git { */ shortSha(): string { return this.faker.datatype - .hexadecimal({ length: 7, case: 'lower' }) - .substring(2); + .hexadecimal({ length: 7, case: 'lower', prefix: '' }); } } From 3a69ce95aa65816e7f91a4dfe7800821714416e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leyla=20J=C3=A4hnig?= Date: Sat, 27 Aug 2022 10:37:20 +0200 Subject: [PATCH 7/7] chore(git): formatting --- src/modules/git/index.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/modules/git/index.ts b/src/modules/git/index.ts index 5fa9a20c766..be8d02f172e 100644 --- a/src/modules/git/index.ts +++ b/src/modules/git/index.ts @@ -92,8 +92,11 @@ export class Git { * faker.git.commitSha() // '2c6e3880fd94ddb7ef72d34e683cdc0c47bec6e6' */ commitSha(): string { - return this.faker.datatype - .hexadecimal({ length: 40, case: 'lower', prefix: '' }); + return this.faker.datatype.hexadecimal({ + length: 40, + case: 'lower', + prefix: '', + }); } /** @@ -103,7 +106,10 @@ export class Git { * faker.git.shortSha() // '6155732' */ shortSha(): string { - return this.faker.datatype - .hexadecimal({ length: 7, case: 'lower', prefix: '' }); + return this.faker.datatype.hexadecimal({ + length: 7, + case: 'lower', + prefix: '', + }); } }