Comparing version 1.2.1 to 1.2.2
{ | ||
"name": "kennitala", | ||
"main": "dist/kennitala.min.js", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"homepage": "https://github.com/HermannBjorgvin/Kennitala", | ||
@@ -6,0 +6,0 @@ "authors": [ |
@@ -9,6 +9,6 @@ (function(){ | ||
kennitala.isValid = function(kennitala) { | ||
var isPerson = evaluate(kennitala, isPerson); | ||
var isCompany = evaluate(kennitala, isCompany); | ||
var person = evaluate(kennitala, isPerson); | ||
var company = evaluate(kennitala, isCompany); | ||
return (isPerson || isCompany); | ||
return (person || company); | ||
} | ||
@@ -15,0 +15,0 @@ |
{ | ||
"name": "kennitala", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Icelandic social security number (kennitölur) utilities for servers and clients", | ||
@@ -5,0 +5,0 @@ "main": "dist/kennitala.min.js", |
@@ -20,3 +20,3 @@ <h1 align=left>Kennitala</h1> | ||
<h3 align=left>Examples</h3> | ||
### Examples | ||
@@ -29,4 +29,21 @@ ``` Javascript | ||
kennitala.isValid('8281249124'); // returns False | ||
``` | ||
### More examples | ||
``` Javascript | ||
const kennitala = require('kennitala'); | ||
// the .info() method returns an object with useful information | ||
kennitala.info('3108962099'); | ||
// returns | ||
{ | ||
kt: '3108962099', | ||
valid: true, | ||
type: 'person', | ||
birthday: 1996-08-31T00:00:00.000Z, | ||
birthdayReadable: 'Sat Aug 31 1996', | ||
age: 22 | ||
} | ||
// Check if kennitala is valid for a person (returns false for companies) | ||
@@ -38,3 +55,2 @@ kennitala.isPerson('3108962099'); // returns True | ||
// Checks if kennitala is valid for a company (returns false for persons) | ||
@@ -45,3 +61,2 @@ kennitala.isCompany('6010100890'); // True | ||
// the .format() method formats a kennitala and adds a traditional - spacer | ||
@@ -60,21 +75,7 @@ // takes an optional parameter for the spacer between the 6th and 7th digit | ||
// the .clean() method removes all non digit characters. ideal for database storage | ||
kennitala.clean(3108962099); // returns '3108962099' | ||
// the .info() method returns an object with useful information | ||
kennitala.info('3108962099'); | ||
// returns | ||
{ | ||
kt: '3108962099', | ||
valid: true, | ||
type: 'person', | ||
birthday: 1996-08-31T00:00:00.000Z, | ||
birthdayReadable: 'Sat Aug 31 1996', | ||
age: 22 | ||
} | ||
``` | ||
<h3 align=left>API documentation</h3> | ||
### API documentation | ||
@@ -81,0 +82,0 @@ kennitala.isValid([string, int]); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31988
11
146