File tree Expand file tree Collapse file tree 5 files changed +47
-50
lines changed Expand file tree Collapse file tree 5 files changed +47
-50
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11# @obosbbl/validation
22
3+ ## 0.3.0
4+
5+ ### Minor Changes
6+
7+ - 1dfc896: add method ` no/validateNationalIdentityNumber() `
8+
9+ Validates that the input is a valid Norwegian national identity number (either a fødselsnummer or a D-nummer).
10+ It validates the checksum and checks if the date of birth is valid.
11+
12+ ```
13+ import { validateNationalIdentityNumber } from "@obosbbl/validation/no";
14+
15+ // Fødselsnummer
16+ validatePersonalIdentityNumber('21075417753') // => true
17+
18+ // D-nummer
19+ validatePersonalIdentityNumber('53097248016') // => true
20+ ```
21+
22+ - 2491f32: add method ` se/validateNationalIdentityNumber() `
23+
24+ Validates that the input is a valid Swedish national identity number (either a personnummer or a samordningsnummer).
25+ It validates the checksum and checks if the date of birth is valid.
26+
27+ It supports both short (10 digits) and long (12 digits) formats, with a separator if the ` allowFormatting ` option is set to ` true ` .
28+
29+ ```
30+ import { validateNationalIdentityNumber } from "@obosbbl/validation/se";
31+
32+ // short
33+ validatePersonalIdentityNumber('YYMMDDXXXX') // true
34+
35+ // short with separator
36+ validatePersonalIdentityNumber('YYMMDD-XXXX', { allowFormatting: true }) // true
37+
38+ // long
39+ validatePersonalIdentityNumber('YYYYMMDDXXXX') // true
40+
41+ // long input, validate short format
42+ validatePersonalIdentityNumber('YYYYMMDDXXXX', { format: 'short' }) // false
43+ ```
44+
45+ ### Patch Changes
46+
47+ - b1c13ed: add checksum validation of Swedish organization numbers. Previously we only checked the length of the number.
48+
349## 0.2.0
450
551### Minor Changes
Original file line number Diff line number Diff line change 11{
22 "name" : " @obosbbl/validation" ,
3- "version" : " 0.2 .0" ,
3+ "version" : " 0.3 .0" ,
44 "description" : " A collection of validation methods for OBOS" ,
55 "repository" : {
66 "url" : " https://github.com/code-obos/public-frontend-modules"
You can’t perform that action at this time.
0 commit comments