diff options
| author | Shinigami <[email protected]> | 2022-05-21 16:30:33 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-05-21 14:30:33 +0000 |
| commit | 4c0e41831f8d2fad92f85cea647cbd0873fd842e (patch) | |
| tree | ea01cb901167f9c8b09a4ed463665c71a14bad47 /src/modules/vehicle | |
| parent | 5af79f487bd1537676d017ae09563e53d18458c4 (diff) | |
| download | faker-4c0e41831f8d2fad92f85cea647cbd0873fd842e.tar.xz faker-4c0e41831f8d2fad92f85cea647cbd0873fd842e.zip | |
feat: add casing option (#955)
Co-authored-by: Eric Cheng <[email protected]>
Diffstat (limited to 'src/modules/vehicle')
| -rw-r--r-- | src/modules/vehicle/index.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/modules/vehicle/index.ts b/src/modules/vehicle/index.ts index ec010af9..fb5cd9f9 100644 --- a/src/modules/vehicle/index.ts +++ b/src/modules/vehicle/index.ts @@ -75,14 +75,16 @@ export class Vehicle { * faker.vehicle.vin() // 'YV1MH682762184654' */ vin(): string { - const bannedChars = ['o', 'i', 'q']; + const bannedChars = ['o', 'i', 'q', 'O', 'I', 'Q']; return `${this.faker.random.alphaNumeric(10, { + casing: 'upper', bannedChars, })}${this.faker.random.alpha({ count: 1, - upcase: true, + casing: 'upper', bannedChars, })}${this.faker.random.alphaNumeric(1, { + casing: 'upper', bannedChars, })}${this.faker.datatype.number({ min: 10000, max: 99999 })}` // return five digit # .toUpperCase(); @@ -107,14 +109,14 @@ export class Vehicle { vrm(): string { return `${this.faker.random.alpha({ count: 2, - upcase: true, + casing: 'upper', })}${this.faker.datatype.number({ min: 0, max: 9, })}${this.faker.datatype.number({ min: 0, max: 9, - })}${this.faker.random.alpha({ count: 3, upcase: true })}`.toUpperCase(); + })}${this.faker.random.alpha({ count: 3, casing: 'upper' })}`.toUpperCase(); } /** |
