larvituser
Advanced tools
Comparing version 0.5.3 to 0.5.4
'use strict'; | ||
const uuidLib = require('node-uuid'), | ||
const uuidLib = require('uuid'), | ||
async = require('async'), | ||
@@ -5,0 +5,0 @@ db = require('larvitdb'); |
@@ -6,5 +6,4 @@ 'use strict'; | ||
dbmigration = require('larvitdbmigration')({'tableName': 'users_db_version', 'migrationScriptsPath': __dirname + '/dbmigration'}), | ||
uuidLib = require('node-uuid'), | ||
uuidLib = require('uuid'), | ||
lUtils = require('larvitutils'), | ||
async = require('async'), | ||
log = require('winston'), | ||
@@ -105,3 +104,3 @@ db = require('larvitdb'); | ||
if (err) { | ||
log.error('larvituser: orders.js: Database error: ' + err.message); | ||
log.error('larvituser: helpers.js: Database error: ' + err.message); | ||
return; | ||
@@ -119,3 +118,1 @@ } | ||
exports.getFieldUuid = getFieldUuid; | ||
exports.orderFields = []; | ||
exports.rowFields = []; |
@@ -7,3 +7,3 @@ 'use strict'; | ||
lUtils = require('larvitutils'), | ||
uuidLib = require('node-uuid'), | ||
uuidLib = require('uuid'), | ||
bcrypt = require('bcryptjs'), | ||
@@ -473,3 +473,3 @@ async = require('async'), | ||
if (err) { | ||
log.error('larvituser: orders.js: Database error: ' + err.message); | ||
log.error('larvituser: index.js: Database error: ' + err.message); | ||
return; | ||
@@ -768,2 +768,3 @@ } | ||
exports.usernameAvailable = usernameAvailable; | ||
exports.Users = require(__dirname + '/users.js'); | ||
Object.assign(exports, require(__dirname + '/helpers.js')); // extend this module with all helpers from the helpers file |
{ | ||
"name": "larvituser", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"author": { | ||
@@ -17,3 +17,3 @@ "name": "Mikael 'Lilleman' Göransson", | ||
"larvitutils": "^1.0.4", | ||
"node-uuid": "^1.4.7", | ||
"uuid": "^3.0.0", | ||
"winston": "^2.1.1" | ||
@@ -20,0 +20,0 @@ }, |
@@ -287,3 +287,5 @@ 'use strict'; | ||
if (err) throw err; | ||
user.addField('cell', 46709771337, function() { | ||
user.addField('cell', 46709771337, function(err) { | ||
if (err) throw err; | ||
assert.deepEqual(user.fields.cell[0], 46709771337); | ||
@@ -305,7 +307,19 @@ assert.deepEqual(user.fields.lastname[0], 'Arvidsson'); | ||
user.replaceFields(newFields, function() { | ||
user.replaceFields(newFields, function(err) { | ||
if (err) throw err; | ||
assert.deepEqual(user.fields.foo, ['bar']); | ||
assert.deepEqual(user.fields.firstname, undefined); | ||
assert.deepEqual(user.fields.income[1], 'more than you'); | ||
done(); | ||
// Reload user to make sure the fields are saved in database correctly | ||
userLib.fromUsername('lilleman', function(err, secondUser) { | ||
if (err) throw err; | ||
assert.deepEqual(secondUser.fields.foo, ['bar']); | ||
assert.deepEqual(secondUser.fields.firstname, undefined); | ||
assert.deepEqual(secondUser.fields.income[1], 'more than you'); | ||
done(); | ||
}); | ||
}); | ||
@@ -318,2 +332,3 @@ }); | ||
if (err) throw err; | ||
userLib.getFieldData(user.uuid, 'foo', function(err, data) { | ||
@@ -320,0 +335,0 @@ if (err) throw err; |
Sorry, the diff of this file is not supported yet
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
59316
22
1472
20
+ Addeduuid@^3.0.0
- Removednode-uuid@^1.4.7
- Removednode-uuid@1.4.8(transitive)