* Generates a random commit sha. * * By default, the length of the commit sha is 40 characters. * * For a shorter commit sha, use the `length` option. * * Usual short commit sha length is: * - 7 for GitHub * - 8 for GitLab * * @param options Options for the commit sha.
(
options: {
/**
* The length of the commit sha.
*
* @default 40
*/
length?: number;
} = {}
)
| 201 | * @since 5.0.0 |
| 202 | */ |
| 203 | commitSha( |
| 204 | options: { |
| 205 | /** |
| 206 | * The length of the commit sha. |
| 207 | * |
| 208 | * @default 40 |
| 209 | */ |
| 210 | length?: number; |
| 211 | } = {} |
| 212 | ): string { |
| 213 | const { length = 40 } = options; |
| 214 | return this.faker.string.hexadecimal({ |
| 215 | length, |
| 216 | casing: 'lower', |
| 217 | prefix: '', |
| 218 | }); |
| 219 | } |
| 220 | } |
no test coverage detected