From 5f947cbd4773f768a90243e54fd707c9769e8530 Mon Sep 17 00:00:00 2001 From: Shinigami Date: Tue, 18 Jul 2023 07:23:26 +0200 Subject: chore: enable strictBindCallApply (#2254) --- src/modules/database/index.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/modules/database') diff --git a/src/modules/database/index.ts b/src/modules/database/index.ts index ced5a3ef..6015cfa2 100644 --- a/src/modules/database/index.ts +++ b/src/modules/database/index.ts @@ -1,4 +1,5 @@ import type { Faker } from '../..'; +import { bindThisToMemberFunctions } from '../../internal/bind-this-to-member-functions'; /** * Module to generate database related entries. @@ -11,16 +12,7 @@ import type { Faker } from '../..'; */ export class DatabaseModule { constructor(private readonly faker: Faker) { - // Bind `this` so namespaced is working correctly - for (const name of Object.getOwnPropertyNames( - DatabaseModule.prototype - ) as Array) { - if (name === 'constructor' || typeof this[name] !== 'function') { - continue; - } - - this[name] = this[name].bind(this); - } + bindThisToMemberFunctions(this); } /** -- cgit v1.2.3