aboutsummaryrefslogtreecommitdiff
path: root/src/modules/internet
diff options
context:
space:
mode:
authorShinigami <[email protected]>2023-10-17 22:03:32 +0200
committerGitHub <[email protected]>2023-10-17 20:03:32 +0000
commitc0330442be99988db57e9dad12ebdcd3b3a92213 (patch)
tree49a7814ef2a3b3a05b147e8be790c4712ef414e8 /src/modules/internet
parentf3de0f61dc517a4548150fd40498a9df6d4b97e6 (diff)
downloadfaker-c0330442be99988db57e9dad12ebdcd3b3a92213.tar.xz
faker-c0330442be99988db57e9dad12ebdcd3b3a92213.zip
infra(unicorn): prefer-spread (#2421)
Co-authored-by: ST-DDT <[email protected]>
Diffstat (limited to 'src/modules/internet')
-rw-r--r--src/modules/internet/index.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/modules/internet/index.ts b/src/modules/internet/index.ts
index 6e8f822f..947edfba 100644
--- a/src/modules/internet/index.ts
+++ b/src/modules/internet/index.ts
@@ -271,8 +271,8 @@ export class InternetModule {
// We limit to 50 chars to be more realistic
localPart = localPart.substring(0, 50);
if (allowSpecialCharacters) {
- const usernameChars: string[] = '._-'.split('');
- const specialChars: string[] = ".!#$%&'*+-/=?^_`{|}~".split('');
+ const usernameChars: string[] = [...'._-'];
+ const specialChars: string[] = [...".!#$%&'*+-/=?^_`{|}~"];
localPart = localPart.replace(
this.faker.helpers.arrayElement(usernameChars),
this.faker.helpers.arrayElement(specialChars)
@@ -638,8 +638,7 @@ export class InternetModule {
.normalize('NFKD') //for example è decomposes to as e + ̀
.replace(/[\u0300-\u036f]/g, ''); // removes combining marks
- result = result
- .split('')
+ result = [...result]
.map((char) => {
// If we have a mapping for this character, (for Cyrillic, Greek etc) use it
if (charMapping[char]) {