Comparing version 0.0.4 to 0.5.0
@@ -187,4 +187,5 @@ var sprintf = require('sprintf').sprintf; | ||
var states = ['AK', 'AL', 'AR', 'AZ', 'CA', 'CO', 'CT', 'DC', 'DE', 'FL', 'GA', 'HI', 'IA', 'ID', 'IL', 'IN', 'KS', 'KY', 'LA', 'MA', 'MD', 'ME', 'MI', 'MN', 'MO', 'MS', 'MT', 'NC', 'ND', 'NE', 'NH', 'NJ', 'NM', 'NV', 'NY', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VA', 'VT', 'WA', 'WI', 'WV', 'WY']; | ||
module.exports.states = ['AK', 'AL', 'AR', 'AZ', 'CA', 'CO', 'CT', 'DC', 'DE', 'FL', 'GA', 'HI', 'IA', 'ID', 'IL', 'IN', 'KS', 'KY', 'LA', 'MA', 'MD', 'ME', 'MI', 'MN', 'MO', 'MS', 'MT', 'NC', 'ND', 'NE', 'NH', 'NJ', 'NM', 'NV', 'NY', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VA', 'VT', 'WA', 'WI', 'WV', 'WY']; | ||
// The SSA uses a funky method of figuring out what group number to use next. This area has them in the proper order and makes it easier to generate a SSN. | ||
@@ -214,5 +215,5 @@ var possibleGroups = [1, 3, 5, 7, 9, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 2, 4, 6, 8, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99]; | ||
exports.generate = function (state) { | ||
state = state || states[Math.floor(Math.random() * (states.length - 1))]; | ||
state = state || this.states[Math.floor(Math.random() * (states.length - 1))]; | ||
state = state.toUpperCase().trim();; | ||
if ( states.indexOf(state) === undefined ) { | ||
if ( this.states.indexOf(state) === undefined ) { | ||
throw "Invalid state " + state; | ||
@@ -219,0 +220,0 @@ } |
{ | ||
"name": "ssn", | ||
"version": "0.0.4", | ||
"version": "0.5.0", | ||
"description": "Validate and generate fake SSN", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "make test" | ||
}, | ||
@@ -28,3 +28,7 @@ "repository": { | ||
}, | ||
"homepage": "https://github.com/winfinit/fake-ssn-node" | ||
"homepage": "https://github.com/winfinit/fake-ssn-node", | ||
"devDependencies": { | ||
"mocha": "^1.21.4", | ||
"chai": "^1.9.1" | ||
} | ||
} |
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
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
16246
5
257
1
65
2