Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

timekeeper

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

timekeeper - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

7

History.md
0.0.2 / 2012-04-01
0.0.3 / 2012-08-08
==================
* Only replace Date with FakeDate when timekeeper is enabled.
0.0.2 / 2012-04-01
==================
* rename ms to time to avoid namespace conflict
* make sure the instanceof Date still returns true

@@ -15,3 +15,2 @@ /**

/**

@@ -125,2 +124,4 @@ * `TimeKeeper`.

timekeeper.freeze = function(date) {
useFakeDate();
if (typeof date !== 'object') {

@@ -140,2 +141,4 @@ date = new NativeDate(date);

timekeeper.travel = function(date) {
useFakeDate();
if (typeof date !== 'object') {

@@ -155,2 +158,3 @@ date = new NativeDate(date);

timekeeper.reset = function() {
useNativeDate();
freeze = null;

@@ -164,7 +168,17 @@ started = null;

*/
Date = FakeDate;
function useFakeDate() {
Date = FakeDate
}
/**
* Restore the `Date` to `NativeDate`.
*/
function useNativeDate() {
Date = NativeDate
}
/**
* Expose `timekeeper`
*/
module.exports = timekeeper;

2

package.json
{
"name": "timekeeper"
, "description": "Easy testing of time-dependent code."
, "version": "0.0.2"
, "version": "0.0.3"
, "keywords": ["fake date", "date test", "mocking date"]

@@ -6,0 +6,0 @@ , "author": "Veselin Todorov <hi@vesln.com>"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc