diff options
| author | Leyla Jähnig <[email protected]> | 2022-10-14 23:54:31 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-10-14 21:54:31 +0000 |
| commit | a90f2fe65c705a5593215b0a35945b77c1d575f1 (patch) | |
| tree | bec933c9817ff19c05654a9376333c3c74a39316 /src/modules | |
| parent | 9c1437d6034ef5537c079746761c4c71347f768b (diff) | |
| download | faker-a90f2fe65c705a5593215b0a35945b77c1d575f1.tar.xz faker-a90f2fe65c705a5593215b0a35945b77c1d575f1.zip | |
feat(internet)!: ip now returns ipv4 and ipv6 (#1059)
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/internet/index.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/modules/internet/index.ts b/src/modules/internet/index.ts index 2da5b59f..3c4eedee 100644 --- a/src/modules/internet/index.ts +++ b/src/modules/internet/index.ts @@ -282,16 +282,16 @@ export class InternetModule { } /** - * Generates a random IPv4 address. + * Generates a random IPv4 or IPv6 address. * * @example * faker.internet.ip() // '245.108.222.0' + * faker.internet.ip() // '4e5:f9c5:4337:abfd:9caf:1135:41ad:d8d3' * * @since 2.0.1 */ ip(): string { - // TODO @Shinigami92 2022-03-21: We may want to return a IPv4 or IPv6 address here in a later major release - return this.ipv4(); + return this.faker.datatype.boolean() ? this.ipv4() : this.ipv6(); } /** |
