@iopipe/trace
Advanced tools
Comparing version 1.5.2 to 1.5.3
@@ -15,2 +15,11 @@ 'use strict'; | ||
const load = plugin => { | ||
/*eslint-disable camelcase, no-undef*/ | ||
if (typeof __non_webpack_require__ === 'function') { | ||
return __non_webpack_require__(`./plugins/${plugin}`); | ||
} | ||
return Promise.resolve().then(() => require(`./plugins/${plugin}`)); | ||
}; // eslint-disable-line import/extensions | ||
const plugins = { | ||
@@ -32,5 +41,4 @@ https: { | ||
} | ||
}; // eslint-disable-line import/extensions | ||
}; | ||
function getBooleanFromEnv(key = '') { | ||
@@ -111,2 +119,3 @@ const isFalsey = ['false', 'f', '0'].indexOf((process.env[key] || '').toString().toLowerCase()) > -1; | ||
const pluginKeys = Object.keys(plugins); | ||
pluginKeys.forEach(k => { | ||
@@ -118,13 +127,13 @@ const conf = plugins[k].config; | ||
// getting plugin; allows this to be loaded only if enabled. | ||
const module = require(`./plugins/${k}`); | ||
plugins[k].wrap = module.wrap; | ||
plugins[k].unwrap = module.unwrap; | ||
context[namespace] = { | ||
timeline: new _performanceNode2.default({ timestamp: true }), | ||
// object to store data about traces that will make it into the report later | ||
data: {}, | ||
config: context.config[conf] | ||
}; | ||
plugins[k].wrap(context[namespace]); | ||
load(`${k}`).then(mod => { | ||
plugins[k].wrap = mod.wrap; | ||
plugins[k].unwrap = mod.unwrap; | ||
context[namespace] = { | ||
timeline: new _performanceNode2.default({ timestamp: true }), | ||
// object to store data about traces that will make it into the report later | ||
data: {}, | ||
config: context.config[conf] | ||
}; | ||
plugins[k].wrap(context[namespace]); | ||
}); | ||
} | ||
@@ -131,0 +140,0 @@ }); |
{ | ||
"name": "@iopipe/trace", | ||
"version": "1.5.2", | ||
"version": "1.5.3", | ||
"description": "IOpipe plugin for tracing metrics", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
41743
619