Bump version

pull/2/head
Louis Chatriot 10 years ago
parent 3b355a630d
commit 2ea3f0c26d
  1. 20
      browser-version/out/nedb.js
  2. 4
      browser-version/out/nedb.min.js
  3. 2
      package.json

@ -1734,9 +1734,7 @@ module.exports = Index;
* Querying, update
*/
var dateToJSON = function () { return { $$date: this.getTime() }; }
, originalDateToJSON = Date.prototype.toJSON
, util = require('util')
var util = require('util')
, _ = require('underscore')
, modifierFunctions = {}
, lastStepModifierFunctions = {}
@ -1795,22 +1793,20 @@ function checkObject (obj) {
*/
function serialize (obj) {
var res;
// Keep track of the fact that this is a Date object
Date.prototype.toJSON = dateToJSON;
res = JSON.stringify(obj, function (k, v) {
checkKey(k, v);
if (v === undefined) { return undefined; }
if (v === null) { return null; }
if (typeof v === undefined) { return null; }
if (typeof v === 'string' || typeof v === 'number' || typeof v === 'boolean' || v === null) { return v; }
// Hackish way of checking if object is Date (this way it works between execution contexts in node-webkit).
// We can't use value directly because for dates it is already string in this function (date.toJSON was already called), so we use this
if (typeof this[k].getTime === 'function') { return { $$date: this[k].getTime() }; }
return v;
});
// Return Date to its original state
Date.prototype.toJSON = originalDateToJSON;
return res;
}

File diff suppressed because one or more lines are too long

@ -1,6 +1,6 @@
{
"name": "nedb",
"version": "0.10.6",
"version": "0.10.7",
"author": {
"name": "Louis Chatriot",
"email": "louis.chatriot@gmail.com"

Loading…
Cancel
Save