Skip to content

Commit dbeeeaa

Browse files
committed
Update & fix dependency versions
- Update to new luhn module syntax - Fix versions in package.json to avoid encountering same issue in the future
1 parent 9407c8c commit dbeeeaa

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.DS_Store
1+
.DS_Store
2+
node_modules

card-swipe.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ var CreditSwipe = function(options){
115115
results = objectTool.merge(results, extractTypeData(results.account));
116116
}
117117
if(options.luhn){
118-
results['valid'] = require("luhn").luhn.validate(results.account);
118+
results['valid'] = require("luhn").validate(results.account);
119119
}
120120
res.push(results);
121121
setTimeout(function(){
@@ -159,7 +159,7 @@ module.exports.generate = function(type, options){
159159
};
160160
switch(type){
161161
case 'account':
162-
var luhn = require("luhn").luhn;
162+
var luhn = require("luhn");
163163
var keys = Object.keys(Keyboard.Sequence.types);
164164
var size = keys[Math.floor(Math.random()*keys.length)];
165165
var options = Keyboard.Sequence.types[size];

package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"homepage": "https://github.com/khrome/card-swipe",
44
"version": "1.0.2",
55
"main": "card-swipe.js",
6+
"scripts": {
7+
"test": " ./node_modules/mocha/bin/mocha"
8+
},
69
"description": "A utility for detecting CC track inputs from streaming character data and extracting data from them",
710
"keywords": [
811
"credit cards",
@@ -20,18 +23,15 @@
2023
"url": "git://github.com/khrome/card-swipe.git"
2124
},
2225
"dependencies": {
23-
"async-objects": "*",
24-
"character-scanner": "*"
26+
"async-objects": "^0.1.0",
27+
"character-scanner": "0.0.1",
28+
"luhn": "^2.1.0"
2529
},
2630
"devDependencies": {
27-
"mocha": "*",
28-
"should": "*",
29-
"luhn": "*",
30-
"faker2": "*"
31-
},
32-
"optionalDependencies": {
31+
"mocha": "^2.5.3",
32+
"should": "^10.0.0"
3333
},
3434
"engines": {
3535
"node": "*"
3636
}
37-
}
37+
}

0 commit comments

Comments
 (0)