Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 authored Mar 24, 2022
2 parents 7632415 + 949835f commit 720a35d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/.codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ coverage:
threshold: 2%
patch:
default:
target: 95%
target: 40%
threshold: 1%
9 changes: 2 additions & 7 deletions src/vehicle.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import type { Faker } from '.';
import type { Fake } from './fake';

let fake: Fake['fake'];

/**
* Module to generate vehicle related entries.
*/
export class Vehicle {
constructor(private readonly faker: Faker) {
fake = faker.fake;

// Bind `this` so namespaced is working correctly
for (const name of Object.getOwnPropertyNames(Vehicle.prototype)) {
if (name === 'constructor' || typeof this[name] !== 'function') {
Expand All @@ -26,7 +21,7 @@ export class Vehicle {
* faker.vehicle.vehicle() // 'BMW Explorer'
*/
vehicle(): string {
return fake('{{vehicle.manufacturer}} {{vehicle.model}}');
return `${this.manufacturer()} ${this.model()}`;
}

/**
Expand Down Expand Up @@ -98,7 +93,7 @@ export class Vehicle {
* faker.vehicle.color() // 'red'
*/
color(): string {
return fake('{{commerce.color}}');
return this.faker.commerce.color();
}

/**
Expand Down

0 comments on commit 720a35d

Please sign in to comment.