diff options
| author | Julian Rabe <[email protected]> | 2022-12-13 16:32:44 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-12-13 16:32:44 +0100 |
| commit | cf764b925339d7917a641a8937735c35ed31c25a (patch) | |
| tree | c496478e12ad4e40cc5668832e59deee20f906e1 /src | |
| parent | b2a72bc969dbd4f4e6e8645c03e4366556c63ab4 (diff) | |
| download | faker-cf764b925339d7917a641a8937735c35ed31c25a.tar.xz faker-cf764b925339d7917a641a8937735c35ed31c25a.zip | |
fix: ASCII-fy `domainWord()` (#1520)
Diffstat (limited to 'src')
| -rw-r--r-- | src/modules/internet/index.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/modules/internet/index.ts b/src/modules/internet/index.ts index 4f313275..2bac0668 100644 --- a/src/modules/internet/index.ts +++ b/src/modules/internet/index.ts @@ -358,10 +358,8 @@ export class InternetModule { * @since 2.0.1 */ domainWord(): string { - return `${this.faker.word.adjective()}-${this.faker.word.noun()}` - .replace(/([\\~#&*{}/:<>?|\"'])/gi, '') - .replace(/\s/g, '-') - .replace(/-{2,}/g, '-') + return this.faker.helpers + .slugify(`${this.faker.word.adjective()}-${this.faker.word.noun()}`) .toLowerCase(); } |
