Comparing version 2.0.2 to 2.0.3
@@ -71,11 +71,15 @@ 'use strict' | ||
const a = id.match(/(.*)+\/(\d+)+$/) | ||
if (!a) { | ||
const lastSlashIndex = id.lastIndexOf('/') | ||
if (lastSlashIndex === -1) { | ||
return null | ||
} | ||
const uuidPart = id.substring(0, lastSlashIndex) | ||
const countPart = Number(id.substring(lastSlashIndex + 1)) | ||
if (!uuidPart || isNaN(countPart)) { | ||
return null | ||
} | ||
const result = { | ||
uuid: parser.unparse(Buffer.from(a[1] + '==', 'base64')), | ||
count: parseInt(a[2]) | ||
uuid: parser.unparse(Buffer.from(uuidPart + '==', 'base64')), | ||
count: countPart | ||
} | ||
@@ -82,0 +86,0 @@ |
{ | ||
"name": "hyperid", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Uber-fast unique id generation, for Node.js and the browser", | ||
@@ -31,12 +31,12 @@ "main": "hyperid", | ||
"pre-commit": "^1.2.2", | ||
"shortid": "^2.2.14", | ||
"standard": "^12.0.0", | ||
"shortid": "^2.2.15", | ||
"standard": "^14.0.0", | ||
"tap-dot": "^2.0.0", | ||
"tape": "^4.9.2", | ||
"tape": "^4.13.0", | ||
"typescript": "^2.9.2" | ||
}, | ||
"dependencies": { | ||
"uuid": "^3.3.2", | ||
"uuid-parse": "^1.0.0" | ||
"uuid": "^3.4.0", | ||
"uuid-parse": "^1.1.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
11759
275
Updateduuid@^3.4.0
Updateduuid-parse@^1.1.0