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

immediate

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

immediate - npm Package Compare versions

Comparing version 3.0.3 to 3.1.0

5

dist/immediate.js

@@ -12,3 +12,4 @@ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.immediate=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){

var queue = [];
function drainQueue() {
//named nextTick for less confusing stack traces
function nextTick() {
draining = true;

@@ -33,3 +34,3 @@ var i, oldQueue;

if (types[i] && types[i].test && types[i].test()) {
scheduleDrain = types[i].install(drainQueue);
scheduleDrain = types[i].install(nextTick);
break;

@@ -36,0 +37,0 @@ }

26

lib/index.js

@@ -10,18 +10,34 @@ 'use strict';

var draining;
var currentQueue;
var queueIndex = -1;
var queue = [];
function cleanUpNextTick() {
draining = false;
if (currentQueue && currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
nextTick();
}
}
//named nextTick for less confusing stack traces
function nextTick() {
draining = true;
var i, oldQueue;
var len = queue.length;
var timeout = setTimeout(cleanUpNextTick);
while (len) {
oldQueue = queue;
currentQueue = queue;
queue = [];
i = -1;
while (++i < len) {
oldQueue[i]();
while (++queueIndex < len) {
currentQueue[queueIndex]();
}
queueIndex = -1;
len = queue.length;
}
queueIndex = -1;
draining = false;
clearTimeout(timeout);
}

@@ -28,0 +44,0 @@ var scheduleDrain;

{
"name": "immediate",
"version": "3.0.3",
"version": "3.1.0",
"description": "A cross browser microtask library",

@@ -38,3 +38,3 @@ "contributors": [

"build-js": "browserify -s immediate ./lib/index.js > dist/immediate.js",
"test": "jshint lib/*.js && node test/tests.js && browserify test/tests.js | testling"
"test": "jshint lib/*.js && node test/tests.js | tspec"
},

@@ -45,8 +45,8 @@ "jam": {

"devDependencies": {
"browserify": "^4.1.5",
"jshint": "^2.5.1",
"tap-spec": "^3.0.0",
"uglify-js": "^2.4.13",
"tape": "^2.13.1",
"jshint": "^2.5.1",
"browserify": "^4.1.5",
"testling": "^1.6.1"
"tape": "^4.0.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