From 48a7af4f0470115945ab166b540d0bedc7e5eb20 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Mon, 6 Nov 2023 09:40:49 +0100 Subject: refactor: simplify module creation (#2485) --- src/modules/location/index.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/modules/location') diff --git a/src/modules/location/index.ts b/src/modules/location/index.ts index 19816c8f..baf51c51 100644 --- a/src/modules/location/index.ts +++ b/src/modules/location/index.ts @@ -1,7 +1,6 @@ -import type { Faker } from '../..'; import { FakerError } from '../../errors/faker-error'; -import { bindThisToMemberFunctions } from '../../internal/bind-this-to-member-functions'; import { deprecated } from '../../internal/deprecated'; +import { ModuleBase } from '../../internal/module-base'; /** * Module to generate addresses and locations. Prior to Faker 8.0.0, this module was known as `faker.address`. @@ -14,11 +13,7 @@ import { deprecated } from '../../internal/deprecated'; * * For a random country, you can use [`country()`](https://fakerjs.dev/api/location.html#country) or [`countryCode()`](https://fakerjs.dev/api/location.html#countrycode). */ -export class LocationModule { - constructor(private readonly faker: Faker) { - bindThisToMemberFunctions(this); - } - +export class LocationModule extends ModuleBase { /** * Generates random zip code from specified format. If format is not specified, * the locale's zip format is used. -- cgit v1.2.3