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

dlgen

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dlgen - npm Package Compare versions

Comparing version 0.0.4 to 1.0.0

built/dlgen.d.ts

33

package.json
{
"name": "dlgen",
"version": "0.0.4",
"version": "1.0.0",
"description": "State ID/Driver license generator",
"main": "index.js",
"main": "built/dlgen.js",
"scripts": {
"test": "make test"
},
"test": "mocha"
},
"repository": {

@@ -14,13 +14,10 @@ "type": "git",

"keywords": [
"aamva",
"driver",
"license",
"AAMVA",
"AMVA",
"id generator",
"state id generator",
"state id"
"age",
"age calculator",
"age-calculator",
"calculate age",
"find age"
],
"author": "Roman Jurkov <winfinit@gmail.com>",
"license": "GNU General Public License",
"license": "GPL-3.0",
"bugs": {

@@ -30,12 +27,10 @@ "url": "https://github.com/winfinit/dlgen-js/issues"

"dependencies": {
"soundex": "*"
"soundex": "^0.2.1"
},
"homepage": "https://github.com/winfinit/dlgen-js",
"devDependencies": {
"mocha": "^1.21.4",
"chai": "^1.9.1"
},
"directories": {
"test": "test"
"@types/node": "^6.0.58",
"mocha": "^3.2.0",
"chai": "^3.5.0"
}
}

@@ -14,26 +14,17 @@ # dlgen.js

```javascript
dlgen.prototype.bake(<object | person>, <bool | format>);
// Generate ID for John Doe
var dlgen = require('dlgen');
let {DLGenerator, DLPerson} = require('dlgen');
var formatted_id = dlgen.bake({
"state": "FL",
"firstName": "JOHN",
"lastName": "DOE",
"middleName": "",
"dob": new Date(1984,10,26),
"gender": "male" //or female
}, true);
console.log(formatted_id); /* J500-160-84-426-0 */
var raw_id = dlgen.bake({
"state": "FL",
"firstName": "JOHN",
"lastName": "DOE",
"middleName": "",
"dob": new Date(1984,10,26),
"gender": "male" //or female
let person = new DLPerson({
firstName: "DOE",
lastName: "JOHN",
middleName: "",
dob: new Date(1984,10,26),
gender: "Male"
});
console.log(raw_id); /* J500160844260 */
let dlGenerator = new DLGenerator(person);
dlGenerator.toFormattedString(); // J500-160-84-426-0
dlGenerator.toString(); // J500160844260
```

@@ -40,0 +31,0 @@

@@ -1,29 +0,25 @@

var should = require('chai').should(),
expect = require('chai').expect,
dlgen = require('../index');
var expect = require('chai').expect;
let {DLGenerator, DLPerson} = require('../built/dlgen');
describe('id', function() {
describe('DLGenerator ID', function() {
it('should be formatted', function(){
var id = dlgen.bake({
lastName: "JOHN",
firstName: "DOE",
middleName: "",
gender: "male",
dob: new Date(1984,10,26)
}, true);
expect(id).to.equal("J500-160-84-426-0");
let dlGenerator = new DLGenerator(new DLPerson({
firstName: "DOE",
lastName: "JOHN",
middleName: "",
dob: new Date(1984,10,26),
gender: "Male"
}));
expect(dlGenerator.toFormattedString()).to.equal("J500-160-84-426-0");
});
it('should be not formatted', function(){
var id = dlgen.bake({
lastName: "JOHN",
firstName: "DOE",
middleName: "",
gender: "male",
dob: new Date(1984,10,26)
});
expect(id).to.equal("J500160844260");
let dlGenerator = new DLGenerator(new DLPerson({
firstName: "DOE",
lastName: "JOHN",
middleName: "",
dob: new Date(1984,10,26),
gender: "Male"
}));
expect(dlGenerator.toString()).to.equal("J500160844260")
});
});
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