Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4.1.0 #17

Merged
merged 27 commits into from
Oct 13, 2024
Merged

v4.1.0 #17

merged 27 commits into from
Oct 13, 2024

Conversation

dhershman1
Copy link
Owner

📄 Description

Stripped Kyanite out as a dependency, added several new functions and expanded our unit tests

🦑 Type of Change

  • Bug Fix
  • Chore
  • New Feature
  • Breaking Change

📋 PR Checklist

  • This pull request has a descriptive title and information useful to a reviewer.
  • All tests are passing
  • Changelog Updated Properly
  • Types updated/added as needed
  • Has new/updated tests

📝 Changes

💅 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

🎊 Enhanced

  • 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

@dhershman1 dhershman1 merged commit a37f5af into master Oct 13, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant