Skip to content
This repository was archived by the owner on Jan 27, 2024. It is now read-only.
This repository was archived by the owner on Jan 27, 2024. It is now read-only.

format() should allow the region to be empty #88

Description

@ooglek

Environment

Package version: v1.0.0

Description

What you'd like to happen:

We use E164 phone numbers (+12125004000, +442075972524) in our app. As these clearly indicate the country, the extra step of parsing the first few characters in order to tell format() what country we are in seems like extra effort. In addition, in v1.0.0 it seems like region is ignored when the phone number is passed in E164 format.

The new parse() method has been great so far! I'd love to see format() follow the same path of making region optional, with its use enhancing the method when necessary or useful.

Alternatives you've considered:

We are using this library and format() with regionCode:"US" as a placeholder for now, and it works, but are concerned that a future enhancement, change, or bug fix might cause this faked functionality to behave in a different manner.

I tried a different library, but it was feature incomplete, as it had only implemented mobile and fixedLine, and not Toll Free, etc and so the validation in that library failed to meet our needs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions