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

Add formatSIRET, formatSIREN, formatVAT methods + tests #2

Merged
merged 1 commit into from
Feb 6, 2018

Conversation

WaldoJeffers
Copy link
Contributor

Add the following methods:

  • formatSIRET
  • formatSIREN
  • formatVAT

These methods internally use isXXXX to check if the input value is valid, and throw an error otherwise.

The regexps could probably be optimized, but I think this will do fine. Also, it might be interesting to have a formatSIRETorSIREN kind of method, because most programs accept both SIRET & SIREN from users.

I also added tests 😄 Feel free to give me some feedback if you'd like something done differently

Cheers

@coveralls
Copy link

coveralls commented Feb 6, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling 24e2d24 on WaldoJeffers:master into cd22d5b on jbdemonte:master.

@jbdemonte jbdemonte merged commit 61a2060 into jbdemonte:master Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants