mongodb-extjson
Advanced tools
Comparing version 2.1.2 to 2.1.3
@@ -0,1 +1,11 @@ | ||
<a name="2.1.3"></a> | ||
## [2.1.3](https://github.com/mongodb-js/mongodb-extjson/compare/v2.1.2...v2.1.3) (2018-05-01) | ||
### Bug Fixes | ||
* **date:** fix date decode in relaxed mode ([#13](https://github.com/mongodb-js/mongodb-extjson/issues/13)) ([dc416aa](https://github.com/mongodb-js/mongodb-extjson/commit/dc416aa)) | ||
<a name="2.1.2"></a> | ||
@@ -2,0 +12,0 @@ ## [2.1.2](https://github.com/mongodb-js/mongodb-extjson/compare/v2.1.1...v2.1.2) (2018-04-06) |
@@ -303,3 +303,3 @@ (function (global, factory) { | ||
if (typeof d === 'string') date.setTime(Date.parse(d));else if (d instanceof BSON.Long) date.setTime(d.toNumber()); | ||
if (typeof d === 'string') date.setTime(Date.parse(d));else if (d instanceof BSON.Long) date.setTime(d.toNumber());else if (typeof d === 'number' && options.relaxed) date.setTime(d); | ||
return date; | ||
@@ -306,0 +306,0 @@ } |
@@ -80,2 +80,3 @@ 'use strict'; | ||
else if (d instanceof BSON.Long) date.setTime(d.toNumber()); | ||
else if (typeof d === 'number' && options.relaxed) date.setTime(d); | ||
return date; | ||
@@ -82,0 +83,0 @@ } |
{ | ||
"name": "mongodb-extjson", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"description": "MongoDB Extended JSON library", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -188,6 +188,8 @@ 'use strict'; | ||
it('should allow relaxed parsing', function() { | ||
const dt = new Date(1452124800000); | ||
const inputObject = { | ||
int: { $numberInt: '500' }, | ||
long: { $numberLong: '42' }, | ||
double: { $numberDouble: '24' } | ||
double: { $numberDouble: '24' }, | ||
date: { $date: { $numberLong: '1452124800000' } } | ||
}; | ||
@@ -199,3 +201,4 @@ | ||
long: 42, | ||
double: 24 | ||
double: 24, | ||
date: dt | ||
}); | ||
@@ -202,0 +205,0 @@ }); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
430729
6327