@jcoreio/auth0-meteor
Advanced tools
Comparing version
@@ -16,2 +16,6 @@ 'use strict'; | ||
var _lodash3 = require('lodash.size'); | ||
var _lodash4 = _interopRequireDefault(_lodash3); | ||
var _flowRuntime = require('flow-runtime'); | ||
@@ -48,3 +52,6 @@ | ||
} | ||
Meteor.users.update({ _id: _id }, { $set: $set, $unset: $unset }); | ||
var updates = {}; | ||
if ((0, _lodash4.default)($set)) updates.$set = $set; | ||
if ((0, _lodash4.default)($unset)) updates.$unset = $unset; | ||
if ((0, _lodash4.default)(updates)) Meteor.users.update({ _id: _id }, updates); | ||
}, _flowRuntime2.default.function(_flowRuntime2.default.param('_id', _flowRuntime2.default.string()), _flowRuntime2.default.param('profile', _flowRuntime2.default.ref(UserProfile)))); | ||
@@ -51,0 +58,0 @@ } |
{ | ||
"name": "@jcoreio/auth0-meteor", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "Auth0 integration with Meteor Accounts", | ||
@@ -96,4 +96,5 @@ "main": "lib/index.js", | ||
"lodash.get": "^4.4.2", | ||
"lodash.memoize": "^4.1.2" | ||
"lodash.memoize": "^4.1.2", | ||
"lodash.size": "^4.2.0" | ||
} | ||
} |
@@ -8,2 +8,3 @@ // @flow | ||
import get from 'lodash.get' | ||
import size from 'lodash.size' | ||
@@ -23,5 +24,8 @@ type Options = { | ||
} | ||
Meteor.users.update({_id}, {$set, $unset}) | ||
const updates = {} | ||
if (size($set)) updates.$set = $set | ||
if (size($unset)) updates.$unset = $unset | ||
if (size(updates)) Meteor.users.update({_id}, updates) | ||
} | ||
} | ||
Sorry, the diff of this file is not supported yet
226332
0.26%745
1.22%10
11.11%+ Added
+ Added
+ Added
+ Added
- Removed
- Removed