Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions lib/schema.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'use strict';

var Joi = require('joi'),
nodeUUID = require('node-uuid'),
uuidv4 = require('uuid/v4'),
uuidv1 = require('uuid/v1'),
_ = require('lodash');

var internals = {};
Expand Down Expand Up @@ -166,14 +167,14 @@ Schema.types.binarySet = function () {

Schema.types.uuid = function () {
return Joi.string().guid({version : 'uuidv4'}).default(function () {
return nodeUUID.v4();
}, 'nodeUUID.v4()');
return uuidv4();
}, 'uuidv4()');
};

Schema.types.timeUUID = function () {
return Joi.string().guid({version : 'uuidv1'}).default(function () {
return nodeUUID.v4();
}, 'nodeUUID.v1()');
return uuidv1();
}, 'uuidv1()');
};

Schema.prototype.validate = function (params, options) {
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"bunyan": "1.5.x",
"joi": "10.6.x",
"lodash": "4.x.x",
"node-uuid": "1.4.x"
"uuid": "^3.3.0"
},
"devDependencies": {
"chai": "1.x.x",
Expand Down
4 changes: 2 additions & 2 deletions test/integration/integration-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var dynamo = require('../../index'),
async = require('async'),
_ = require('lodash'),
helper = require('../test-helper'),
uuid = require('node-uuid'),
uuidv4 = require('uuid/v4'),
Joi = require('joi');

chai.should();
Expand Down Expand Up @@ -76,7 +76,7 @@ describe('DynamoDB Integration Tests', function() {
before(function (done) {

function generateId () {
return uuid.v4();
return uuidv4();
}

dynamo.dynamoDriver(helper.realDynamoDB());
Expand Down