immediate
Advanced tools
Comparing version 3.0.4 to 3.0.5
{ | ||
"name": "immediate", | ||
"version": "3.0.4", | ||
"version": "3.0.5", | ||
"description": "A cross browser microtask library", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/calvinmetcalf/immediate", |
{ | ||
"name": "immediate", | ||
"version": "3.0.4", | ||
"version": "3.0.5", | ||
"description": "A cross browser microtask library", | ||
@@ -5,0 +5,0 @@ "repo": "calvinmetcalf/immediate", |
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.immediate = f()}})(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);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.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){ | ||
(function (global){ | ||
'use strict'; | ||
var types = [ | ||
_dereq_('./nextTick'), | ||
_dereq_('./mutation.js'), | ||
_dereq_('./messageChannel'), | ||
_dereq_('./stateChange'), | ||
_dereq_('./timeout') | ||
]; | ||
var Mutation = global.MutationObserver || global.WebKitMutationObserver; | ||
var scheduleDrain; | ||
{ | ||
if (Mutation) { | ||
var called = 0; | ||
var observer = new Mutation(nextTick); | ||
var element = global.document.createTextNode(''); | ||
observer.observe(element, { | ||
characterData: true | ||
}); | ||
scheduleDrain = function () { | ||
element.data = (called = ++called % 2); | ||
}; | ||
} else if (!global.setImmediate && typeof global.MessageChannel !== 'undefined') { | ||
var channel = new global.MessageChannel(); | ||
channel.port1.onmessage = nextTick; | ||
scheduleDrain = function () { | ||
channel.port2.postMessage(0); | ||
}; | ||
} else if ('document' in global && 'onreadystatechange' in global.document.createElement('script')) { | ||
scheduleDrain = function () { | ||
// Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted | ||
// into the document. Do so, thus queuing up the task. Remember to clean up once it's been called. | ||
var scriptEl = global.document.createElement('script'); | ||
scriptEl.onreadystatechange = function () { | ||
nextTick(); | ||
scriptEl.onreadystatechange = null; | ||
scriptEl.parentNode.removeChild(scriptEl); | ||
scriptEl = null; | ||
}; | ||
global.document.documentElement.appendChild(scriptEl); | ||
}; | ||
} else { | ||
scheduleDrain = function () { | ||
setTimeout(nextTick, 0); | ||
}; | ||
} | ||
} | ||
var draining; | ||
@@ -28,11 +65,3 @@ var queue = []; | ||
} | ||
var scheduleDrain; | ||
var i = -1; | ||
var len = types.length; | ||
while (++ i < len) { | ||
if (types[i] && types[i].test && types[i].test()) { | ||
scheduleDrain = types[i].install(nextTick); | ||
break; | ||
} | ||
} | ||
module.exports = immediate; | ||
@@ -44,89 +73,5 @@ function immediate(task) { | ||
} | ||
},{"./messageChannel":2,"./mutation.js":3,"./nextTick":6,"./stateChange":4,"./timeout":5}],2:[function(_dereq_,module,exports){ | ||
(function (global){ | ||
'use strict'; | ||
exports.test = function () { | ||
if (global.setImmediate) { | ||
// we can only get here in IE10 | ||
// which doesn't handel postMessage well | ||
return false; | ||
} | ||
return typeof global.MessageChannel !== 'undefined'; | ||
}; | ||
exports.install = function (func) { | ||
var channel = new global.MessageChannel(); | ||
channel.port1.onmessage = func; | ||
return function () { | ||
channel.port2.postMessage(0); | ||
}; | ||
}; | ||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | ||
},{}],3:[function(_dereq_,module,exports){ | ||
(function (global){ | ||
'use strict'; | ||
//based off rsvp https://github.com/tildeio/rsvp.js | ||
//license https://github.com/tildeio/rsvp.js/blob/master/LICENSE | ||
//https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp/asap.js | ||
var Mutation = global.MutationObserver || global.WebKitMutationObserver; | ||
exports.test = function () { | ||
return Mutation; | ||
}; | ||
exports.install = function (handle) { | ||
var called = 0; | ||
var observer = new Mutation(handle); | ||
var element = global.document.createTextNode(''); | ||
observer.observe(element, { | ||
characterData: true | ||
}); | ||
return function () { | ||
element.data = (called = ++called % 2); | ||
}; | ||
}; | ||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | ||
},{}],4:[function(_dereq_,module,exports){ | ||
(function (global){ | ||
'use strict'; | ||
exports.test = function () { | ||
return 'document' in global && 'onreadystatechange' in global.document.createElement('script'); | ||
}; | ||
exports.install = function (handle) { | ||
return function () { | ||
// Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted | ||
// into the document. Do so, thus queuing up the task. Remember to clean up once it's been called. | ||
var scriptEl = global.document.createElement('script'); | ||
scriptEl.onreadystatechange = function () { | ||
handle(); | ||
scriptEl.onreadystatechange = null; | ||
scriptEl.parentNode.removeChild(scriptEl); | ||
scriptEl = null; | ||
}; | ||
global.document.documentElement.appendChild(scriptEl); | ||
return handle; | ||
}; | ||
}; | ||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | ||
},{}],5:[function(_dereq_,module,exports){ | ||
'use strict'; | ||
exports.test = function () { | ||
return true; | ||
}; | ||
exports.install = function (t) { | ||
return function () { | ||
setTimeout(t, 0); | ||
}; | ||
}; | ||
},{}],6:[function(_dereq_,module,exports){ | ||
},{}]},{},[1])(1) | ||
}); |
@@ -1,1 +0,1 @@ | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.immediate=e()}}(function(){return function e(n,t,o){function i(u,f){if(!t[u]){if(!n[u]){var a="function"==typeof require&&require;if(!f&&a)return a(u,!0);if(r)return r(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var l=t[u]={exports:{}};n[u][0].call(l.exports,function(e){var t=n[u][1][e];return i(t?t:e)},l,l.exports,e,n,t,o)}return t[u].exports}for(var r="function"==typeof require&&require,u=0;u<o.length;u++)i(o[u]);return i}({1:[function(e,n,t){"use strict";function o(){r=!0;for(var e,n,t=a.length;t;){for(n=a,a=[],e=-1;++e<t;)n[e]();t=a.length}r=!1}function i(e){1!==a.push(e)||r||u()}for(var r,u,f=[e("./nextTick"),e("./mutation.js"),e("./messageChannel"),e("./stateChange"),e("./timeout")],a=[],s=-1,l=f.length;++s<l;)if(f[s]&&f[s].test&&f[s].test()){u=f[s].install(o);break}n.exports=i},{"./messageChannel":2,"./mutation.js":3,"./nextTick":6,"./stateChange":4,"./timeout":5}],2:[function(e,n,t){(function(e){"use strict";t.test=function(){return e.setImmediate?!1:"undefined"!=typeof e.MessageChannel},t.install=function(n){var t=new e.MessageChannel;return t.port1.onmessage=n,function(){t.port2.postMessage(0)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(e,n,t){(function(e){"use strict";var n=e.MutationObserver||e.WebKitMutationObserver;t.test=function(){return n},t.install=function(t){var o=0,i=new n(t),r=e.document.createTextNode("");return i.observe(r,{characterData:!0}),function(){r.data=o=++o%2}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,n,t){(function(e){"use strict";t.test=function(){return"document"in e&&"onreadystatechange"in e.document.createElement("script")},t.install=function(n){return function(){var t=e.document.createElement("script");return t.onreadystatechange=function(){n(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t),n}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],5:[function(e,n,t){"use strict";t.test=function(){return!0},t.install=function(e){return function(){setTimeout(e,0)}}},{}],6:[function(e,n,t){},{}]},{},[1])(1)}); | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.immediate=e()}}(function(){return function e(n,t,o){function r(f,u){if(!t[f]){if(!n[f]){var a="function"==typeof require&&require;if(!u&&a)return a(f,!0);if(i)return i(f,!0);var d=new Error("Cannot find module '"+f+"'");throw d.code="MODULE_NOT_FOUND",d}var s=t[f]={exports:{}};n[f][0].call(s.exports,function(e){var t=n[f][1][e];return r(t?t:e)},s,s.exports,e,n,t,o)}return t[f].exports}for(var i="function"==typeof require&&require,f=0;f<o.length;f++)r(o[f]);return r}({1:[function(e,n,t){(function(e){"use strict";function t(){s=!0;for(var e,n,t=c.length;t;){for(n=c,c=[],e=-1;++e<t;)n[e]();t=c.length}s=!1}function o(e){1!==c.push(e)||s||r()}var r,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var f=0,u=new i(t),a=e.document.createTextNode("");u.observe(a,{characterData:!0}),r=function(){a.data=f=++f%2}}else if(e.setImmediate||"undefined"==typeof e.MessageChannel)r="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var n=e.document.createElement("script");n.onreadystatechange=function(){t(),n.onreadystatechange=null,n.parentNode.removeChild(n),n=null},e.document.documentElement.appendChild(n)}:function(){setTimeout(t,0)};else{var d=new e.MessageChannel;d.port1.onmessage=t,r=function(){d.port2.postMessage(0)}}var s,c=[];n.exports=o}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}); |
'use strict'; | ||
var types = [ | ||
require('./nextTick'), | ||
require('./mutation.js'), | ||
require('./messageChannel'), | ||
require('./stateChange'), | ||
require('./timeout') | ||
]; | ||
var Mutation = global.MutationObserver || global.WebKitMutationObserver; | ||
var scheduleDrain; | ||
if (process.browser) { | ||
if (Mutation) { | ||
var called = 0; | ||
var observer = new Mutation(nextTick); | ||
var element = global.document.createTextNode(''); | ||
observer.observe(element, { | ||
characterData: true | ||
}); | ||
scheduleDrain = function () { | ||
element.data = (called = ++called % 2); | ||
}; | ||
} else if (!global.setImmediate && typeof global.MessageChannel !== 'undefined') { | ||
var channel = new global.MessageChannel(); | ||
channel.port1.onmessage = nextTick; | ||
scheduleDrain = function () { | ||
channel.port2.postMessage(0); | ||
}; | ||
} else if ('document' in global && 'onreadystatechange' in global.document.createElement('script')) { | ||
scheduleDrain = function () { | ||
// Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted | ||
// into the document. Do so, thus queuing up the task. Remember to clean up once it's been called. | ||
var scriptEl = global.document.createElement('script'); | ||
scriptEl.onreadystatechange = function () { | ||
nextTick(); | ||
scriptEl.onreadystatechange = null; | ||
scriptEl.parentNode.removeChild(scriptEl); | ||
scriptEl = null; | ||
}; | ||
global.document.documentElement.appendChild(scriptEl); | ||
}; | ||
} else { | ||
scheduleDrain = function () { | ||
setTimeout(nextTick, 0); | ||
}; | ||
} | ||
} else { | ||
scheduleDrain = function () { | ||
process.nextTick(nextTick); | ||
}; | ||
} | ||
var draining; | ||
@@ -27,11 +67,3 @@ var queue = []; | ||
} | ||
var scheduleDrain; | ||
var i = -1; | ||
var len = types.length; | ||
while (++ i < len) { | ||
if (types[i] && types[i].test && types[i].test()) { | ||
scheduleDrain = types[i].install(nextTick); | ||
break; | ||
} | ||
} | ||
module.exports = immediate; | ||
@@ -42,2 +74,2 @@ function immediate(task) { | ||
} | ||
} | ||
} |
{ | ||
"name": "immediate", | ||
"version": "3.0.4", | ||
"version": "3.0.5", | ||
"description": "A cross browser microtask library", | ||
@@ -29,4 +29,7 @@ "contributors": [ | ||
}, | ||
"browser": { | ||
"./nextTick": false | ||
"browserify": { | ||
"transform": [ | ||
"inline-process-browser", | ||
"unreachable-branch-transform" | ||
] | ||
}, | ||
@@ -48,3 +51,7 @@ "bugs": "https://github.com/calvinmetcalf/immediate/issues", | ||
"derequire": "^2.0.0" | ||
}, | ||
"dependencies": { | ||
"inline-process-browser": "^1.0.0", | ||
"unreachable-branch-transform": "^0.3.0" | ||
} | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
14036
2
9
171
1
+ Addedacorn@1.2.2(transitive)
+ Addedast-types@0.8.15(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addedesmangle-evaluator@1.0.1(transitive)
+ Addedesprima-fb@15001.1001.0-dev-harmony-fb(transitive)
+ Addedfalafel@1.2.0(transitive)
+ Addedforeach@2.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedinline-process-browser@1.0.0(transitive)
+ Addedisarray@0.0.1(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedprivate@0.1.8(transitive)
+ Addedreadable-stream@1.0.34(transitive)
+ Addedrecast@0.10.43(transitive)
+ Addedsource-map@0.5.7(transitive)
+ Addedstring_decoder@0.10.31(transitive)
+ Addedthrough2@0.6.5(transitive)
+ Addedunreachable-branch-transform@0.3.0(transitive)
+ Addedxtend@4.0.2(transitive)