Skip to content

Commit 949835f

Browse files
authored
chore: drop fake usage in vehicle.ts (#275)
1 parent 825a8c8 commit 949835f

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

src/vehicle.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
import type { Faker } from '.';
2-
import type { Fake } from './fake';
3-
4-
let fake: Fake['fake'];
52

63
/**
74
* Module to generate vehicle related entries.
85
*/
96
export class Vehicle {
107
constructor(private readonly faker: Faker) {
11-
fake = faker.fake;
12-
138
// Bind `this` so namespaced is working correctly
149
for (const name of Object.getOwnPropertyNames(Vehicle.prototype)) {
1510
if (name === 'constructor' || typeof this[name] !== 'function') {
@@ -26,7 +21,7 @@ export class Vehicle {
2621
* faker.vehicle.vehicle() // 'BMW Explorer'
2722
*/
2823
vehicle(): string {
29-
return fake('{{vehicle.manufacturer}} {{vehicle.model}}');
24+
return `${this.manufacturer()} ${this.model()}`;
3025
}
3126

3227
/**
@@ -98,7 +93,7 @@ export class Vehicle {
9893
* faker.vehicle.color() // 'red'
9994
*/
10095
color(): string {
101-
return fake('{{commerce.color}}');
96+
return this.faker.commerce.color();
10297
}
10398

10499
/**

0 commit comments

Comments
 (0)