@wdio/utils
Advanced tools
Comparing version 5.14.4 to 5.15.0
@@ -106,4 +106,17 @@ "use strict"; | ||
function safeRequire(name) { | ||
let requirePath; | ||
try { | ||
require.resolve(name); | ||
const localNodeModules = `${process.cwd()}/node_modules`; | ||
if (!require.main.paths.includes(localNodeModules)) { | ||
require.main.paths.push(localNodeModules); | ||
const requireOpts = process.env.JEST_WORKER_ID ? {} : { | ||
paths: require.main.paths | ||
}; | ||
requirePath = require.resolve(name, requireOpts); | ||
} else { | ||
requirePath = require.resolve(name); | ||
} | ||
} catch (e) { | ||
@@ -114,3 +127,3 @@ return null; | ||
try { | ||
return require(name); | ||
return require(requirePath); | ||
} catch (e) { | ||
@@ -117,0 +130,0 @@ throw new Error(`Couldn't initialise "${name}".\n${e.stack}`); |
{ | ||
"name": "@wdio/utils", | ||
"version": "5.14.4", | ||
"version": "5.15.0", | ||
"description": "A WDIO helper utility to provide several utility functions used across the project.", | ||
@@ -40,3 +40,3 @@ "author": "Christian Bromann <christian@saucelabs.com>", | ||
}, | ||
"gitHead": "a61e97749a57e7b9e86864cbdf03456c71fd876a" | ||
"gitHead": "f49384dd159bbd308c70db1c119499b774c95f75" | ||
} |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
24051
655
4