Related to #35 and another request from @eirikurn to change the API so it is more compatible with V1.
For example isPerson instead of isPersonkennitala. This reverts back to isPerson which is how it was in V1.
I also updated test cases where I added 20 as the starting increment for generatePerson. The manual addition of the starting increment in the tests caused me to miss that generatePerson sometimes generated ID's with starting increments below 20. I fixed this by making the default starting increments for persons 20.
I also removed the undefined returns from the info function where an undefined century digit at the end of a kt would return undefined. I refactored the function so it now always returns a KennitalaInfo object.
Also updated the formatKennitala function so it returns a string like before. It adds a optional spacer between the 6th and 7th digits in case the string length is longer than 5. Useful for formatting input fields.
Related to #35 and another request from @eirikurn to change the API so it is more compatible with V1.
For example
isPerson
instead ofisPersonkennitala
. This reverts back toisPerson
which is how it was in V1.I also updated test cases where I added 20 as the starting increment for
generatePerson
. The manual addition of the starting increment in the tests caused me to miss thatgeneratePerson
sometimes generated ID's with starting increments below 20. I fixed this by making the default starting increments for persons20
.I also removed the undefined returns from the
info
function where an undefined century digit at the end of a kt would return undefined. I refactored the function so it now always returns aKennitalaInfo
object.Also updated the
formatKennitala
function so it returns a string like before. It adds a optional spacer between the 6th and 7th digits in case the string length is longer than 5. Useful for formatting input fields.