Skip to content

v2.0.0

Compare
Choose a tag to compare
@mikaello mikaello released this 12 Jun 06:04

New features

  • New object oriented API:
    import { NorwegianId } from 'norwegian-national-id-validator';
    
    const validation = NorwegianId('29029600013');
    
    validation.isValid() // => true
    validation.isBirthNumber() // => true
    validation.isDNumber() // => false
    validation.isHNumber() // => false
    validation.isFhNumber() // => false
    validation.isMale() // => false
    validation.isFemale() // => true
    validation.age() // => 24

Breaking

  • The previously undocumented function idNumberType returned type IdNumberType before, but this is changed to enum IdNumberType.

Documentation

A massive documentation upgrade, including automatically generated API documentation: https://github.com/mikaello/norwegian-national-id-validator/tree/master/docs

Thanks to @cobraz !