idea-toolbox
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -103,3 +103,3 @@ 'use strict'; | ||
*/ | ||
function IUID(project, cb, attempt, maxAttempts) { | ||
function IUID(dynamo, project, cb, attempt, maxAttempts) { | ||
if(!project) return cb(false); | ||
@@ -110,5 +110,5 @@ attempt = attempt || 0; | ||
let id = project+'_'+UUIDV4(); | ||
Dynamo.getItem({ TableName: 'idea_iuid', Key: { project: project, id: id } }, | ||
dynamo.getItem({ TableName: 'idea_iuid', Key: { project: project, id: id } }, | ||
(err, data) => { | ||
if(data.Item) return IUID(project, cb, attempt+1, maxAttempts); // the ID exists, try again | ||
if(data.Item) return IUID(dynamo, project, cb, attempt+1, maxAttempts); // ID exists, try again | ||
else Dynamo.putItem({ TableName: 'idea_iuid', Key: { project: project, id: id } }, | ||
@@ -115,0 +115,0 @@ (err, data) => { |
{ | ||
"name": "idea-toolbox", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "IDEA's utility functions", | ||
@@ -5,0 +5,0 @@ "engines": { |
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
9194