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/internet | |
| parent | 358572d9e76f4cd22bfcb09c092a1eaf3a31f005 (diff) | |
| download | faker-48a7af4f0470115945ab166b540d0bedc7e5eb20.tar.xz faker-48a7af4f0470115945ab166b540d0bedc7e5eb20.zip | |
refactor: simplify module creation (#2485)
Diffstat (limited to 'src/modules/internet')
| -rw-r--r-- | src/modules/internet/index.ts | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/modules/internet/index.ts b/src/modules/internet/index.ts index aecdb302..4f58615f 100644 --- a/src/modules/internet/index.ts +++ b/src/modules/internet/index.ts @@ -1,6 +1,5 @@ -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 { charMapping } from './char-mappings'; import * as random_ua from './user-agent'; @@ -38,11 +37,7 @@ export type HTTPProtocolType = 'http' | 'https'; * * You also have access to a number of the more technical elements of web requests, such as [`httpMethod`](https://fakerjs.dev/api/internet.html#httpmethod), [`httpStatusCode`](https://fakerjs.dev/api/internet.html#httpstatuscode), [`ip`](https://fakerjs.dev/api/internet.html#ip), [`mac`](https://fakerjs.dev/api/internet.html#mac), [`userAgent`](https://fakerjs.dev/api/internet.html#useragent), and [`port`](https://fakerjs.dev/api/internet.html#port). */ -export class InternetModule { - constructor(private readonly faker: Faker) { - bindThisToMemberFunctions(this); - } - +export class InternetModule extends ModuleBase { /** * Returns a random avatar url. * |
