camouflage
Advanced tools
Comparing version 0.8.8 to 0.8.9
@@ -411,3 +411,3 @@ "use strict"; | ||
toJSON(){ | ||
var values = _.extend({}, this._values, this); | ||
var values = _.extend({}, this._values); | ||
var schema = this._schema; | ||
@@ -427,5 +427,8 @@ for(var key in schema){ | ||
} | ||
for(key in values){ | ||
if(values.hasOwnProperty(key) && key[0] === '_' && key !== '_id'){ | ||
delete values[key]; | ||
var proto = Object.getPrototypeOf(this); | ||
var protoProps = Object.getOwnPropertyNames(proto); | ||
for(var i=0; i<protoProps.length; i++){ | ||
key = protoProps[i]; | ||
if(key !== 'constructor' && key !== 'id'){ | ||
values[key] = this[key]; | ||
} | ||
@@ -432,0 +435,0 @@ } |
{ | ||
"name": "camouflage", | ||
"version": "0.8.8", | ||
"version": "0.8.9", | ||
"description": "A class-based ES6 ODM for Mongo-like databases.", | ||
@@ -5,0 +5,0 @@ "author": { |
Sorry, the diff of this file is not supported yet
256581
5136