uuid-apikey
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -36,3 +36,3 @@ // index.js | ||
isAPIKey(apiKey) { | ||
apiKey = apiKey.replace(/-/g, ''); | ||
apiKey = apiKey.toUpperCase().replace(/-/g, ''); | ||
let re = /[0-9A-Z]*/g; | ||
@@ -39,0 +39,0 @@ return (apiKey.length === 28 && re.test(apiKey)); |
{ | ||
"name": "uuid-apikey", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "A Base32-Crockford encoded API Key generator, validator, and converter to turn UUIDs into human readable API Keys", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -28,2 +28,6 @@ const test = require('unit.js'); | ||
it('test good lower-case API Key', () => { | ||
test.assert(MainClass.isAPIKey(testKey.apiKey.toLowerCase())); | ||
}) | ||
it('test bad API Key', () => { | ||
@@ -30,0 +34,0 @@ test.assert(!MainClass.isAPIKey(testKey.uuid)); |
11496
170