Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

phone-fns

Package Overview
Dependencies
Maintainers
0
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

phone-fns - npm Package Versions

23

4.1.2

Diff

Changelog

Source

v4.1.2

Fixed

  • Documentation examples for breakdownWithFormat function

Changed

  • Updated pinet to v1.2.1
killparadise
published 4.1.1 •

Changelog

Source

v4.1.1

New

  • Deprecated isValid function in favor of isValidWithFormat

Changed

  • Reset codecov coverage report using c8 package
  • Updated unit tests for some more coverage
  • Cleaned up some round about logic in the codebase
killparadise
published 4.1.0 •

Changelog

Source

v4.1.0

New

  • Added normalize function
    • This function strips out special characters and trims the phone number, much like uglify but skips non-digit characters
    • Example: normalize('555.444.3333 x 123') // => '5554443333x123' vs uglify('555.444.3333 x 123') // => 5554443333123
  • Added validate function
    • This is a validation function, but works better for world wide phone numbers as well. Expects the full number
    • Example: 333-444-5555 comes back valid but 444-5555 is invalid to this function
  • Added isValidWithFormat function
    • This takes a string phone number and a format string and validates the phone using the format
    • It's also passed through the validate function for an extra step of validation
  • Added findSeparators function
    • A simple function that finds the separators in a phone number and returns them as an array
  • Added breakdownWithFormat function
    • Works a lot like breakdown but follows a strict format provided by the user to breakdown the number into an object
    • This allows for a wider range of phone number support for breakdown

Changed

  • Phone-fns is no longer dependant on Kyanite and is dependency free!
  • isValid description to explain that it mostly focused on NANP numbers
  • breakdown description to better explain that it's main focus is NANP numbers and its gachas
  • We more than doubled our unit tests! Woo!

Chore

  • Renamed test files to *.spec.js instead of just *.js
killparadise
published 4.0.2 •

Changelog

Source

v4.0.2

Fixed

  • Typo for extension in types #14 @JonBee

Chore

  • Dependency Updates
killparadise
published 4.0.1 •

Changelog

Source

v4.0.1

New

  • Added more unit tests for isValid and breakdown

Fixed

  • Added warning into README that currently phone-fns is focused on US based phone number styles
  • Updated github action to LTS of node

Chore

  • Updated dependencies
killparadise
published 4.0.0 •

Changelog

Source

v4.0.0

Breaking Changes

  • Converted Phone-Fns to a standard ESM module
    • This means if you are using import statements in an ESM module for phone-fns this changes:
      • import phoneFns from 'phone-fns' --> import * as phoneFns from 'phone-fns'
      • You can also just destructure from here still like so: import { isValid } from 'phone-fns'
    • Phone fns should still support common js syntax out of the box as well
  • Upgraded to Kyanite v2.0.1

New

  • CDN support sould be working for phone-fns again
    • Updated README to reflect these changes

Improved

  • Made typings less confusing
killparadise
published 3.2.3 •

Changelog

Source

v3.2.3

New

  • Switched over to pinet jsdoc templating
  • Changed documentation hosting

Improved

  • All dependencies have been updated
  • Removed docs folder
  • Removed david-dm badge since it doesn't seem to be coming back
  • Documentation workflow now handled by circleci
  • format can now take in Number type phone numbers
killparadise
published 3.2.1 •

Changelog

Source

v3.2.1

Improved

  • Dependency updates
  • Unit tests
  • Optimization of some code pieces
  • Some documentation
killparadise
published 3.2.0 •

Changelog

Source

v3.2.0

New

  • Added new Placeholder support
killparadise
published 3.1.0 •

Changelog

Source

v3.1.0

Improved

  • Switched to internal currying
  • Improved formats performance and broke it down to a more intelligent function

Fixed

  • Typo in formats example
  • Remove unused code
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc