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/image | |
| parent | 358572d9e76f4cd22bfcb09c092a1eaf3a31f005 (diff) | |
| download | faker-48a7af4f0470115945ab166b540d0bedc7e5eb20.tar.xz faker-48a7af4f0470115945ab166b540d0bedc7e5eb20.zip | |
refactor: simplify module creation (#2485)
Diffstat (limited to 'src/modules/image')
| -rw-r--r-- | src/modules/image/index.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/modules/image/index.ts b/src/modules/image/index.ts index b1c9c692..915014db 100644 --- a/src/modules/image/index.ts +++ b/src/modules/image/index.ts @@ -1,6 +1,6 @@ import type { Faker } from '../..'; -import { bindThisToMemberFunctions } from '../../internal/bind-this-to-member-functions'; import { deprecated } from '../../internal/deprecated'; +import { ModuleBase } from '../../internal/module-base'; import type { MethodsOf } from '../../utils/types'; import { LoremPicsum } from './providers/lorempicsum'; import { Placeholder } from './providers/placeholder'; @@ -19,7 +19,7 @@ import { Unsplash } from './providers/unsplash'; * * This module previously also contained methods for specifically themed images like "fashion" or "food", but these are now deprecated. If you need more control over image type, you can request categorized images using [`urlLoremFlickr()`](https://fakerjs.dev/api/image.html#urlloremflickr), use an image provider directly or provide your own set of placeholder images. */ -export class ImageModule { +export class ImageModule extends ModuleBase { /** * @deprecated Use `faker.image` instead. */ @@ -38,8 +38,8 @@ export class ImageModule { // eslint-disable-next-line deprecation/deprecation readonly placeholder: Placeholder; - constructor(private readonly faker: Faker) { - bindThisToMemberFunctions(this); + constructor(faker: Faker) { + super(faker); // eslint-disable-next-line deprecation/deprecation this.unsplash = new Unsplash(this.faker); |
