aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinigami <[email protected]>2024-03-06 17:50:00 +0100
committerGitHub <[email protected]>2024-03-06 16:50:00 +0000
commitb3afc8f351003cf9df9984fb5be6cd46e18f71d8 (patch)
tree52554570e9738e311f11e3b64ecfb3b832452e3c
parent2716865a0441b8502c8d0ee3efbdbe1bcebe0101 (diff)
downloadfaker-b3afc8f351003cf9df9984fb5be6cd46e18f71d8.tar.xz
faker-b3afc8f351003cf9df9984fb5be6cd46e18f71d8.zip
refactor(git)!: remove v8 deprecated git method (#2716)
-rw-r--r--docs/guide/upgrading_v9/2716.md7
-rw-r--r--src/modules/git/index.ts23
-rw-r--r--test/modules/git.spec.ts2
3 files changed, 9 insertions, 23 deletions
diff --git a/docs/guide/upgrading_v9/2716.md b/docs/guide/upgrading_v9/2716.md
new file mode 100644
index 00000000..8f24100c
--- /dev/null
+++ b/docs/guide/upgrading_v9/2716.md
@@ -0,0 +1,7 @@
+### Remove deprecated git method
+
+Removed deprecated git method
+
+| old | replacement |
+| ---------------------- | ------------------------------------ |
+| `faker.git.shortSha()` | `faker.git.commitSha({ length: 7 })` |
diff --git a/src/modules/git/index.ts b/src/modules/git/index.ts
index 0c50b614..8f33f0c5 100644
--- a/src/modules/git/index.ts
+++ b/src/modules/git/index.ts
@@ -1,4 +1,3 @@
-import { deprecated } from '../../internal/deprecated';
import { ModuleBase } from '../../internal/module-base';
const nbsp = '\u00A0';
@@ -196,6 +195,8 @@ export class GitModule extends ModuleBase {
*
* @example
* faker.git.commitSha() // '2c6e3880fd94ddb7ef72d34e683cdc0c47bec6e6'
+ * faker.git.commitSha({ length: 7 }) // 'dbee57b'
+ * faker.git.commitSha({ length: 8 }) // '0e52376a'
*
* @since 5.0.0
*/
@@ -216,24 +217,4 @@ export class GitModule extends ModuleBase {
prefix: '',
});
}
-
- /**
- * Generates a random commit sha (short).
- *
- * @example
- * faker.git.shortSha() // '6155732'
- *
- * @since 5.0.0
- *
- * @deprecated Use `faker.git.commitSha({ length: 7 })` instead.
- */
- shortSha(): string {
- deprecated({
- deprecated: 'faker.git.shortSha()',
- proposed: 'faker.git.commitSha({ length: 7 })',
- since: '8.0',
- until: '9.0',
- });
- return this.commitSha({ length: 7 });
- }
}
diff --git a/test/modules/git.spec.ts b/test/modules/git.spec.ts
index b120cc09..8957e995 100644
--- a/test/modules/git.spec.ts
+++ b/test/modules/git.spec.ts
@@ -18,8 +18,6 @@ describe('git', () => {
.it('with length 8', { length: 8 });
});
- t.skip('shortSha');
-
t.describeEach(
'commitEntry',
'commitDate'