Skip to content

Commit b3afc8f

Browse files
authored
refactor(git)!: remove v8 deprecated git method (#2716)
1 parent 2716865 commit b3afc8f

File tree

3 files changed

+9
-23
lines changed

3 files changed

+9
-23
lines changed

docs/guide/upgrading_v9/2716.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
### Remove deprecated git method
2+
3+
Removed deprecated git method
4+
5+
| old | replacement |
6+
| ---------------------- | ------------------------------------ |
7+
| `faker.git.shortSha()` | `faker.git.commitSha({ length: 7 })` |

src/modules/git/index.ts

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { deprecated } from '../../internal/deprecated';
21
import { ModuleBase } from '../../internal/module-base';
32

43
const nbsp = '\u00A0';
@@ -196,6 +195,8 @@ export class GitModule extends ModuleBase {
196195
*
197196
* @example
198197
* faker.git.commitSha() // '2c6e3880fd94ddb7ef72d34e683cdc0c47bec6e6'
198+
* faker.git.commitSha({ length: 7 }) // 'dbee57b'
199+
* faker.git.commitSha({ length: 8 }) // '0e52376a'
199200
*
200201
* @since 5.0.0
201202
*/
@@ -216,24 +217,4 @@ export class GitModule extends ModuleBase {
216217
prefix: '',
217218
});
218219
}
219-
220-
/**
221-
* Generates a random commit sha (short).
222-
*
223-
* @example
224-
* faker.git.shortSha() // '6155732'
225-
*
226-
* @since 5.0.0
227-
*
228-
* @deprecated Use `faker.git.commitSha({ length: 7 })` instead.
229-
*/
230-
shortSha(): string {
231-
deprecated({
232-
deprecated: 'faker.git.shortSha()',
233-
proposed: 'faker.git.commitSha({ length: 7 })',
234-
since: '8.0',
235-
until: '9.0',
236-
});
237-
return this.commitSha({ length: 7 });
238-
}
239220
}

test/modules/git.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ describe('git', () => {
1818
.it('with length 8', { length: 8 });
1919
});
2020

21-
t.skip('shortSha');
22-
2321
t.describeEach(
2422
'commitEntry',
2523
'commitDate'

0 commit comments

Comments
 (0)