Skip to content

Commit

Permalink
v3.4.0
Browse files Browse the repository at this point in the history
Fixed bug with date objects being clobbered.

Updated NPM deps.
  • Loading branch information
cb1kenobi committed Mar 27, 2017
1 parent cf2489d commit 00330e8
Show file tree
Hide file tree
Showing 4 changed files with 221 additions and 204 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gawk",
"version": "3.3.0",
"version": "3.4.0",
"description": "Observable JavaScript object model",
"main": "./dist/index.js",
"author": "Chris Barber <[email protected]> (https://github.com/cb1kenobi)",
Expand All @@ -23,14 +23,14 @@
"test": "gulp test"
},
"dependencies": {
"source-map-support": "^0.4.11"
"source-map-support": "^0.4.14"
},
"devDependencies": {
"babel-eslint": "^7.1.1",
"babel-plugin-transform-es2015-modules-commonjs": "^6.23.0",
"babel-eslint": "^7.2.1",
"babel-plugin-transform-es2015-modules-commonjs": "^6.24.0",
"chai": "^3.5.0",
"codeclimate-test-reporter": "^0.4.1",
"coveralls": "^2.11.16",
"coveralls": "^2.12.0",
"del": "^2.2.2",
"esdoc-es7-plugin": "^0.0.3",
"gulp": "^3.9.1",
Expand All @@ -45,8 +45,8 @@
"gulp-mocha": "^3.0.1",
"gulp-plumber": "^1.1.0",
"gulp-sourcemaps": "^2.4.1",
"sinon": "^1.17.7",
"sinon-chai": "^2.8.0"
"sinon": "^2.1.0",
"sinon-chai": "^2.9.0"
},
"homepage": "https://github.com/cb1kenobi/gawk",
"bugs": "https://github.com/cb1kenobi/gawk/issues",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function gawk(value, parent) {
throw new TypeError('Expected parent to be a GawkArray or GawkObject');
}

if (!value || typeof value !== 'object') {
if (!value || typeof value !== 'object' || value instanceof Date) {
return value;
}

Expand Down
6 changes: 6 additions & 0 deletions test/test-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ describe('GawkObject', () => {
const gobj = new GawkObject(gawk(obj));
expect(gobj).to.deep.equal(obj);
});

it('should not clobber date objects', () => {
const dt = new Date;
const gobj = new GawkObject({ dt });
expect(gobj.dt).to.equal(dt);
});
});

describe('toString()', () => {
Expand Down
Loading

0 comments on commit 00330e8

Please sign in to comment.