Comparing version 4.0.7 to 4.0.8
@@ -0,7 +1,10 @@ | ||
const process = (function () { return this } ()).process; | ||
// https://github.com/iliakan/detect-node | ||
if (Object.prototype.toString.call(typeof process !== "undefined" ? process : 0) === "[object process]") { | ||
const browserify_do_no_require1 = "./mock/emitter.js"; | ||
const browserify_do_no_require2 = "./node/emitter.js"; | ||
const MockEmitter = require(browserify_do_no_require1); | ||
const NodeEmitter = require(browserify_do_no_require2); | ||
if (Object.prototype.toString.call(process) === "[object process]") { | ||
const browserify_do_no_require1 = __dirname + "/mock/emitter.js"; | ||
const browserify_do_no_require2 = __dirname + "/node/emitter.js"; | ||
// In case antena is browserified and then fed to a node-based headless browser, | ||
// we want to use the real node require and not the shim provided by Browserify. | ||
const MockEmitter = process.mainModule.require(browserify_do_no_require1); | ||
const NodeEmitter = process.mainModule.require(browserify_do_no_require2); | ||
module.exports = (address, session, callback) => (typeof address === "object" ? MockEmitter : NodeEmitter)(address, session, callback); | ||
@@ -8,0 +11,0 @@ } else { |
{ | ||
"name": "antena", | ||
"description": "Isomorphic communication library for node and browsers", | ||
"version": "4.0.7", | ||
"version": "4.0.8", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Laurent Christophe", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
32523
792
1