diff options
| author | ST-DDT <[email protected]> | 2023-11-06 09:40:49 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-11-06 08:40:49 +0000 |
| commit | 48a7af4f0470115945ab166b540d0bedc7e5eb20 (patch) | |
| tree | b6344afcc6f9fca2d16555d5e3495439952b9a57 /src/modules/helpers | |
| parent | 358572d9e76f4cd22bfcb09c092a1eaf3a31f005 (diff) | |
| download | faker-48a7af4f0470115945ab166b540d0bedc7e5eb20.tar.xz faker-48a7af4f0470115945ab166b540d0bedc7e5eb20.zip | |
refactor: simplify module creation (#2485)
Diffstat (limited to 'src/modules/helpers')
| -rw-r--r-- | src/modules/helpers/index.ts | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/modules/helpers/index.ts b/src/modules/helpers/index.ts index 4c64be4e..ff93f2ca 100644 --- a/src/modules/helpers/index.ts +++ b/src/modules/helpers/index.ts @@ -1,7 +1,7 @@ import type { Faker, SimpleFaker } from '../..'; import { FakerError } from '../../errors/faker-error'; -import { bindThisToMemberFunctions } from '../../internal/bind-this-to-member-functions'; import { deprecated } from '../../internal/deprecated'; +import { SimpleModuleBase } from '../../internal/module-base'; import { luhnCheckValue } from './luhn-check'; import type { RecordKey } from './unique'; import * as uniqueExec from './unique'; @@ -161,7 +161,7 @@ function legacyRegexpStringParse( /** * Module with various helper methods providing basic (seed-dependent) operations useful for implementing faker methods (without methods requiring localized data). */ -export class SimpleHelpersModule { +export class SimpleHelpersModule extends SimpleModuleBase { /** * Global store of unique values. * This means that faker should *never* return duplicate values across all API methods when using `faker.helpers.unique` without passing `options.store`. @@ -170,10 +170,6 @@ export class SimpleHelpersModule { */ private readonly uniqueStore: Record<RecordKey, RecordKey> = {}; - constructor(protected readonly faker: SimpleFaker) { - bindThisToMemberFunctions(this); - } - /** * Slugifies the given string. * For that all spaces (` `) are replaced by hyphens (`-`) |
