Socket
Socket
Sign inDemoInstall

process

Package Overview
Dependencies
0
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.7.0 to 0.8.0

27

browser.js

@@ -8,2 +8,4 @@ // shim for using process in browser

&& window.setImmediate;
var canMutationObserver = typeof window !== 'undefined'
&& window.MutationObserver;
var canPost = typeof window !== 'undefined'

@@ -17,4 +19,25 @@ && window.postMessage && window.addEventListener

var queue = [];
if (canMutationObserver) {
var hiddenDiv = document.createElement("div");
var observer = new MutationObserver(function () {
var queueList = queue.slice();
queue.length = 0;
queueList.forEach(function (fn) {
fn();
});
});
observer.observe(hiddenDiv, { attributes: true });
return function nextTick(fn) {
if (!queue.length) {
hiddenDiv.setAttribute('yes', 'no');
}
queue.push(fn);
};
}
if (canPost) {
var queue = [];
window.addEventListener('message', function (ev) {

@@ -59,3 +82,3 @@ var source = ev.source;

throw new Error('process.binding is not supported');
}
};

@@ -62,0 +85,0 @@ // TODO(shtylman)

2

package.json

@@ -8,3 +8,3 @@ {

],
"version": "0.7.0",
"version": "0.8.0",
"repository": {

@@ -11,0 +11,0 @@ "type": "git",

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