1.0.0 • Published 7 years ago
chisel-addon-phone v1.0.0
Phone (Chisel Mutator Addon)
Formats a phone number based on the provided country.
Installation
Use the Chisel RESTful API, Chisel CLI, or Chisel GUI to install this mutator addon.
Usage
After installation, this addon will be available on api.mutators.addons.phone as a function with the following parameters:
number: A valid phone number in any format.country: A country code in ISO 3166 format.format: An optional string, eitherintfor International,natfor National,e164for E164, andrfc3966for RFC3966 formatting (defaults toint).
Example
api.mutators.addons.phone('1235556789', 'US'); // Returns "+1 123-555-6789"
api.mutators.addons.phone('1235556789', 'US', 'int'); // Returns "+1 123-555-6789"
api.mutators.addons.phone('1235556789', 'US', 'nat'); // Returns "(123) 555-6789"
api.mutators.addons.phone('1235556789', 'US', 'e164'); // Returns "+11235556789"
api.mutators.addons.phone('1235556789', 'US', 'rfc3966'); // Returns "tel:+1-123-555-6789"1.0.0
7 years ago