-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
Description
Pre-Checks
- Follow our Code of Conduct.
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Faker issue and not related to a combination with another package.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
- I am willing to provide a PR.
Describe the bug
FakerJS for the EN_AU locale is currently generating invalid mobile phone numbers. I ran a test and it produced +61018806128, which is an invalid number as the third digit is not "4" (it always should be). Please see https://en.wikipedia.org/wiki/Telephone_numbers_in_Australia for further details.
Minimal reproduction code
import { fakerEN_AU as faker } from '@faker-js/faker';
phoneNumber = faker.phone.number({ style: 'international' });
// Output: `+61018806128`
// Expected output: `+61418806128`Additional Context
In the meantime, I'm using this:
phone = faker.helpers.fromRegExp('+614[0-9]{8}');This works, however it's more obscure and took additional time and effort searching to find this option. The faker.phone.number() should have worked to provide a valid number.
Environment Info
System:
OS: macOS 15.5
CPU: (12) arm64 Apple M2 Max
Memory: 95.56 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 23.11.0 - /opt/homebrew/bin/node
Yarn: 1.22.22 - /opt/homebrew/bin/yarn
npm: 10.9.1 - ~/code/my-app/node_modules/.bin/npm
pnpm: 9.7.1 - /opt/homebrew/bin/pnpm
Browsers:
Chrome: 138.0.7204.183
Safari: 18.5
npmPackages:
@faker-js/faker: ^9.7.0 => 9.7.0Which module system do you use?
- CJS
- ESM
Used Package Manager
npm