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/science/index.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/modules/science') diff --git a/src/modules/science/index.ts b/src/modules/science/index.ts index 95fc1290..26c78014 100644 --- a/src/modules/science/index.ts +++ b/src/modules/science/index.ts @@ -1,5 +1,4 @@ -import type { Faker } from '../..'; -import { bindThisToMemberFunctions } from '../../internal/bind-this-to-member-functions'; +import { ModuleBase } from '../../internal/module-base'; /** * The possible definitions related to elements. @@ -37,11 +36,7 @@ export interface Unit { * * Both methods in this module return objects rather than strings. For example, you can use `faker.science.chemicalElement().name` to pick out the specific property you need. */ -export class ScienceModule { - constructor(private readonly faker: Faker) { - bindThisToMemberFunctions(this); - } - +export class ScienceModule extends ModuleBase { /** * Returns a random periodic table element. * -- cgit v1.2.3