Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

kennitala

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kennitala - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

CODE_OF_CONDUCT.md

2

bower.json
{
"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]);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc