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/string | |
| parent | 358572d9e76f4cd22bfcb09c092a1eaf3a31f005 (diff) | |
| download | faker-48a7af4f0470115945ab166b540d0bedc7e5eb20.tar.xz faker-48a7af4f0470115945ab166b540d0bedc7e5eb20.zip | |
refactor: simplify module creation (#2485)
Diffstat (limited to 'src/modules/string')
| -rw-r--r-- | src/modules/string/index.ts | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/modules/string/index.ts b/src/modules/string/index.ts index a370c386..7c159a21 100644 --- a/src/modules/string/index.ts +++ b/src/modules/string/index.ts @@ -1,6 +1,5 @@ -import type { SimpleFaker } from '../..'; import { FakerError } from '../../errors/faker-error'; -import { bindThisToMemberFunctions } from '../../internal/bind-this-to-member-functions'; +import { SimpleModuleBase } from '../../internal/module-base'; import type { LiteralUnion } from '../../utils/types'; export type Casing = 'upper' | 'lower' | 'mixed'; @@ -98,11 +97,7 @@ const SAMPLE_MAX_LENGTH = 2 ** 20; * - Emoji can be found at [`faker.internet.emoji()`](https://fakerjs.dev/api/internet.html#emoji). * - The [`faker.helpers`](https://fakerjs.dev/api/helpers.html) module includes a number of string related methods. */ -export class StringModule { - constructor(private readonly faker: SimpleFaker) { - bindThisToMemberFunctions(this); - } - +export class StringModule extends SimpleModuleBase { /** * Generates a string from the given characters. * |
