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

contimer

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contimer - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

8

index.js

@@ -24,3 +24,3 @@ /**

*/
function stop(ctx, id) {
function stop(ctx, id, preventCallback) {
var result,

@@ -35,3 +35,3 @@ timers = ctx[_TIMERS_PROP];

if (typeof _stopCallback === 'function') {
if (preventCallback !== true && typeof _stopCallback === 'function') {
setImmediate(function() {

@@ -68,4 +68,4 @@ _stopCallback(id, result);

var stopFn = function() {
return stop(ctx, id);
var stopFn = function(preventCallback) {
return stop(ctx, id, preventCallback);
};

@@ -72,0 +72,0 @@

{
"name": "contimer",
"version": "1.0.0",
"version": "1.0.1",
"description": "Routines to measure time in the context of an object.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -64,2 +64,17 @@ /* globals describe, it */

});
it('should not execute callback if 3rd argument is `true`', function(done) {
var marker = true,
ctx = {};
time.hook(function() { marker = false; });
time.start(ctx, TIMER_NAME);
time.stop(ctx, TIMER_NAME, true);
time.start(ctx, TIMER_NAME)(true);
setTimeout(function() {
assert(marker);
done();
}, 5);
});
});

@@ -66,0 +81,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