Socket
Socket
Sign inDemoInstall

tick-tock

Package Overview
Dependencies
1
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.1 to 0.1.2

22

index.js
'use strict';
var has = Object.prototype.hasOwnProperty
, ms = require('millisecond')
, next = null;
, ms = require('millisecond');
//
// The process.nexTick doesn't have a way to cancel the scheduled tick so we
// detect it first and know that when next is a function we cannot clear it.
//
if ('function' === typeof setImmediate) next = {
clearImmediate: clearImmediate,
setImmediate: setImmediate
};
/**

@@ -121,3 +111,3 @@ * Simple timer management.

if (!next) return tick.setTimeout(name, fn, 0);
if ('function' !== typeof setImmediate) return tick.setTimeout(name, fn, 0);

@@ -130,4 +120,4 @@ if (tick.timers[name]) {

tick.timers[name] = {
timer: (next.setImmediate || next)(tick.tock(name, true)),
clear: next.clearImmediate,
timer: setImmediate(tick.tock(name, true)),
clear: clearImmediate,
fns: [fn]

@@ -164,3 +154,3 @@ };

if (args.length === 1 && 'string' === typeof args[0]) {
args = args[0].split(/[\,|\s]+/);
args = args[0].split(/[, ]+/);
}

@@ -178,3 +168,3 @@

if (!timer) continue;
if (timer.clear) timer.clear(timer.timer);
timer.clear(timer.timer);

@@ -181,0 +171,0 @@ timer.fns = timer.timer = timer.clear = null;

{
"name": "tick-tock",
"version": "0.1.1",
"version": "0.1.2",
"description": "Timer management, never forget to clear timers again",

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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc