When I'm trying to generate some email address under the "ja" locale, some email address are invalid.
To reproduce the issue, I use the browser's console from the demo page (https://rawgit.com/Marak/faker.js/master/examples/browser/index.html). Here's the input and output:
console.log(faker)
VM599:1 Faker聽{locales: {鈥, locale: "ja", localeFallback: "en", definitions: {鈥, fake: 茠,聽鈥
undefined
faker.locale = "ja"
"ja"
faker.internet.email()
"[email protected]"
faker.internet.email()
"[email protected]"
faker.internet.email()
"[email protected]"
faker.internet.email()
"[email protected]"
faker.internet.email()
"[email protected]"
faker.internet.email()
"[email protected]"
faker.internet.email()
"[email protected]"
faker.internet.email()
"[email protected]"
The email addresses that start with "." character are invalid. Please see https://en.wikipedia.org/wiki/Email_address#Syntax for the details.
If this is a legit issue, I could potentially open a PR to fix it.
@clarmso -
Thank you for bringing this to our attention.
If you are able to open a PR to resolve this it would be much appreciated.
Thank you.
I open a PR for this, the same problem was happening with ch locales. The problem was because of this regex:
https://github.com/Marak/faker.js/blob/cb851b7656309e99ebbb61174f68d5e93e2ee147/lib/helpers.js#L28
This was removing the Japanese characters, so I just include them in the regex.
Most helpful comment
If this is a legit issue, I could potentially open a PR to fix it.