Skip to content

Invalid zip/postal codes when using locale en_CA #1416

@dbertouille

Description

@dbertouille

Pre-Checks

Describe the bug

When generating zip codes (postal codes) using the en_CA locale, invalid codes are generated. The characters D, F, I, O, Q, or U are not used in postal codes. This is can cause the randomly generated codes to fail validation.

Reference Documentation

Minimal reproduction code

const { faker } = require('@faker-js/faker');

faker.locale = 'en_CA';

console.log(faker.address.zipCode());

Additional Context

No response

Environment Info

System:
    OS: macOS 12.3
    CPU: (8) arm64 Apple M1 Pro
    Memory: 96.56 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.17.0 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.15.0 - /opt/homebrew/bin/npm
  Browsers:
    Brave Browser: 106.1.44.101
    Chrome: 105.0.5195.52
    Safari: 15.4
  npmPackages:
    @faker-js/faker: ^7.5.0 => 7.5.0

Which module system do you use?

  • CJS
  • ESM

Used Package Manager

npm

Metadata

Metadata

Assignees

Labels

c: bugSomething isn't workingc: localePermutes locale definitionsm: locationSomething is referring to the location modulep: 1-normalNothing urgent

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions