Socket
Socket
Sign inDemoInstall

phone-fns

Package Overview
Dependencies
1
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install
2Next

4.0.1

Diff

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
killparadise
published 3.0.0 •

Changelog

Source

v3.0.0

Breaking Changes

  • Removed find function since it was rather pointless
  • Removed match function since it was rather pointless
  • The main import is no longer a function but an object of functions
  • Re wrote how format works so it's easier to use and more light weight
    • Specify country code in the layout with C. Example: C + (NNN) NNN-NNNN
    • Usage example: format('C + (NNN) NNN-NNNN', 14445556666) // => '1 + (444) 555-6666'
  • breakdown no longer handles or accepts country codes
    • Technically the only function that cares about Country Codes is the format function this is to make functions easier to use
  • Scrapped modular functions
    • There is no need for this anymore, since Rollup & webpack v2+ treeshaking support curried functions, destructing works much better now

New

  • Documentation was moved onto a more sustainable location for quicker and more up to date docs, should be hosted via github pages now too

Improved

  • Using Kyanite to improve how format functions and better currying from the library
  • Replaced uglify-js with terser for performance gains
  • isValid optimizations using Kyanite
  • Overall documentation system should be built directly into its own page now
  • Added Typing declarations for TS and vscode IDE support
killparadise
published 2.0.1 •

Changelog

Source

v2.0.1

Improved

  • A new script system in place for generating library documentation to make it easier for the main site to pull in the latest documentation
killparadise
published 2.0.0 •

Changelog

Source

v2.0.0

BREAKING CHANGES

  • The API usage for format is now different, you only need to use the letter N in your layout now in the order you want the numbers to fill in
    • The letter N is case insensitive
    • Example: an old layout may have looked like: (AAA) LLL-NNNN now it is: (NNN) NNN-NNNN or (nnn) nnn-nnNN if you wanted to get creative

New

  • find has been deprecated and may be removed in later versions, please transition to breakdown
  • Added a 2nd validation level to format it will now validate the phone number has enough digits to fill out the layout properly
  • You can now pass country code as a number or string

Fixed

  • JSdocs for format were backwards
  • Able to properly handle numbers without an area code now
killparadise
published 1.0.1 •

Changelog

Source

v1.0.1

New

  • Rebuilt the architecture of the main source (has no effect on usage)
  • Added in CDN info to documentation
  • Building using Rollup now instead of webpack decreasing the overall file size of our main file to 1.86kb (vs 3.83kb with webpack) and 970B gzipped
    • This also benefits each individual functions build so they're also much smaller
  • Converting testing to latest babel versions
  • Convert linter from eslint to standardjs
  • Created an uncompressed build along with the compressed one which you can use in dev for easier debugging

Fixed

  • For some reason I didn't realize the package.json main was looking at a index.js file
  • Re built automated documentation script so it performs faster
2Next
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc