diff options
Diffstat (limited to 'src/modules/git/index.ts')
| -rw-r--r-- | src/modules/git/index.ts | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/modules/git/index.ts b/src/modules/git/index.ts index 26e6e767..f19abeef 100644 --- a/src/modules/git/index.ts +++ b/src/modules/git/index.ts @@ -1,4 +1,5 @@ import type { Faker } from '../..'; +import { bindThisToMemberFunctions } from '../../internal/bind-this-to-member-functions'; import { deprecated } from '../../internal/deprecated'; /** @@ -10,16 +11,7 @@ import { deprecated } from '../../internal/deprecated'; */ export class GitModule { constructor(private readonly faker: Faker) { - // Bind `this` so namespaced is working correctly - for (const name of Object.getOwnPropertyNames(GitModule.prototype) as Array< - keyof GitModule | 'constructor' - >) { - if (name === 'constructor' || typeof this[name] !== 'function') { - continue; - } - - this[name] = this[name].bind(this); - } + bindThisToMemberFunctions(this); } /** |
