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

@sinonjs/fake-timers

Package Overview
Dependencies
Maintainers
6
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sinonjs/fake-timers - npm Package Compare versions

Comparing version 10.1.0 to 10.2.0

2

package.json
{
"name": "@sinonjs/fake-timers",
"description": "Fake JavaScript timers",
"version": "10.1.0",
"version": "10.2.0",
"homepage": "https://github.com/sinonjs/fake-timers",

@@ -6,0 +6,0 @@ "author": "Christian Johansen",

@@ -70,2 +70,3 @@ # `@sinonjs/fake-timers`

later to restore things as they were again.
Note that in NodeJS also the [timers](https://nodejs.org/api/timers.html) module will receive fake timers when using global scope.

@@ -150,3 +151,5 @@ ```js

Installs FakeTimers using the specified config (otherwise with epoch `0` on the global scope). The following configuration options are available
Installs FakeTimers using the specified config (otherwise with epoch `0` on the global scope).
Note that in NodeJS also the [timers](https://nodejs.org/api/timers.html) module will receive fake timers when using global scope.
The following configuration options are available

@@ -153,0 +156,0 @@ | Parameter | Type | Default | Description |

"use strict";
const globalObject = require("@sinonjs/commons").global;
let timersModule;
if (typeof require === "function" && typeof module === "object") {
try {
timersModule = require("timers");
} catch (e) {
// ignored
}
}

@@ -88,2 +96,3 @@ /**

* @property {boolean} [shouldClearNativeTimers] inherited from config
* @property {{methodName:string, original:any}[] | undefined} timersModuleMethods
*/

@@ -890,2 +899,8 @@ /* eslint-enable jsdoc/require-property-description */

}
if (clock.timersModuleMethods !== undefined) {
for (let j = 0; j < clock.timersModuleMethods.length; j++) {
const entry = clock.timersModuleMethods[j];
timersModule[entry.methodName] = entry.original;
}
}
}

@@ -1738,3 +1753,5 @@

}
if (_global === globalObject && timersModule) {
clock.timersModuleMethods = [];
}
for (i = 0, l = clock.methods.length; i < l; i++) {

@@ -1759,2 +1776,14 @@ const nameOfMethodToReplace = clock.methods[i];

}
if (
clock.timersModuleMethods !== undefined &&
timersModule[nameOfMethodToReplace]
) {
const original = timersModule[nameOfMethodToReplace];
clock.timersModuleMethods.push({
methodName: nameOfMethodToReplace,
original: original,
});
timersModule[nameOfMethodToReplace] =
_global[nameOfMethodToReplace];
}
}

@@ -1761,0 +1790,0 @@

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