Use util.isDate everywhere

pull/2/head
Louis Chatriot 12 years ago
parent d768da2ff9
commit f0a8dcb708
  1. 2
      lib/model.js
  2. 3
      test/model.test.js

@ -109,7 +109,7 @@ function deepCopy (obj) {
typeof obj === 'number' ||
typeof obj === 'string' ||
obj === null ||
(obj && obj.constructor && obj.constructor.name === 'Date') ) {
(util.isDate(obj)) ) {
return obj;
}

@ -3,6 +3,7 @@ var model = require('../lib/model')
, assert = require('chai').assert
, _ = require('underscore')
, async = require('async')
, util = require('util')
;
@ -79,7 +80,7 @@ describe('Model', function () {
b = model.serialize(a);
c = model.deserialize(b);
b.indexOf('\n').should.equal(-1);
c.test.constructor.name.should.equal('Date');
util.isDate(c.test).should.equal(true);
c.test.getTime().should.equal(d.getTime());
});

Loading…
Cancel
Save