mongo-dot-notation
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -62,3 +62,3 @@ 'use strict' | ||
function operatorName(operator) { | ||
return operator.constructor.name | ||
return operator.constructor && operator.constructor.name | ||
} |
{ | ||
"name": "mongo-dot-notation", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Convert simple objects to mongo update operators", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -8,3 +8,3 @@ 'use strict' | ||
var ObjectID = require('mongodb').ObjectID | ||
describe('#primitive types scenarios', function () { | ||
@@ -66,2 +66,9 @@ it('when is an empty object returns empty', function () { | ||
}) | ||
it('when constructor is undefined sets object', function () { | ||
var obj = { value: 'test' } | ||
obj.constructor = undefined; | ||
expect(dot.flatten(obj)).to.have.property('$set') | ||
.that.deep.equals(obj) | ||
}) | ||
}) | ||
@@ -68,0 +75,0 @@ |
22872
479