timezone-mock
Advanced tools
Comparing version 1.1.4 to 1.2.0
14
index.js
@@ -226,2 +226,12 @@ var assert = require('assert'); | ||
var orig_object_toString; | ||
function mockDateObjectToString() { | ||
if (this instanceof MockDate) { | ||
// Look just like a regular Date to anything doing very low-level Object.prototype.toString calls | ||
// See: https://github.com/Jimbly/timezone-mock/issues/48 | ||
return '[object Date]'; | ||
} | ||
return orig_object_toString.call(this); | ||
} | ||
function register(new_timezone, glob) { | ||
@@ -237,2 +247,6 @@ if (!glob) { | ||
glob.Date = MockDate; | ||
if (!orig_object_toString) { | ||
orig_object_toString = Object.prototype.toString; | ||
Object.prototype.toString = mockDateObjectToString; | ||
} | ||
} | ||
@@ -239,0 +253,0 @@ exports.register = register; |
{ | ||
"name": "timezone-mock", | ||
"version": "1.1.4", | ||
"version": "1.2.0", | ||
"description": "A JavaScript library to mock the local timezone.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
27507
939