Socket
Socket
Sign inDemoInstall

@wdio/utils

Package Overview
Dependencies
Maintainers
4
Versions
291
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wdio/utils - npm Package Compare versions

Comparing version 5.11.1 to 5.12.0

24

build/initialisePlugin.js

@@ -8,8 +8,2 @@ "use strict";

/**
* Allows to safely require a package, it only throws if the package was found
* but failed to load due to syntax errors
* @param {string} name of package
* @return {object} package content
*/
function safeRequire(name) {

@@ -28,14 +22,4 @@ try {

}
/**
* initialise WebdriverIO compliant plugins like reporter or services in the following way:
* 1. if package name is scoped (starts with "@"), require scoped package name
* 2. otherwise try to require "@wdio/<name>-<type>"
* 3. otherwise try to require "wdio-<name>-<type>"
*/
function initialisePlugin(name, type, target = 'default') {
/**
* directly import packages that are scoped
*/
if (name[0] === '@') {

@@ -45,7 +29,3 @@ const service = safeRequire(name);

}
/**
* check for scoped version of plugin first (e.g. @wdio/sauce-service)
*/
const scopedPlugin = safeRequire(`@wdio/${name.toLowerCase()}-${type}`);

@@ -56,7 +36,3 @@

}
/**
* check for old type of
*/
const plugin = safeRequire(`wdio-${name.toLowerCase()}-${type}`);

@@ -63,0 +39,0 @@

@@ -17,9 +17,2 @@ "use strict";

const log = (0, _logger.default)('@wdio/utils:initialiseServices');
/**
* initialise services based on configuration
* @param {Object} config config of running session
* @param {Object} caps capabilities of running session
* @param {String} type define sub type of plugins (for services it could be "launcher")
* @return {Object[]} list of service classes that got initialised
*/

@@ -35,5 +28,2 @@ function initialiseServices(config, caps, type) {

let serviceConfig = config;
/**
* allow custom services with custom options
*/

@@ -44,7 +34,3 @@ if (Array.isArray(serviceName)) {

}
/**
* allow custom services that are already initialised
*/
if (serviceName && typeof serviceName === 'object' && !Array.isArray(serviceName)) {

@@ -57,5 +43,2 @@ log.debug('initialise custom initiated service');

try {
/**
* allow custom service classes
*/
if (typeof serviceName === 'function') {

@@ -69,5 +52,2 @@ log.debug(`initialise custom service "${serviceName.name}"`);

const Service = (0, _initialisePlugin.default)(serviceName, 'service', type);
/**
* service only contains a launcher
*/

@@ -74,0 +54,0 @@ if (!Service) {

8

package.json
{
"name": "@wdio/utils",
"version": "5.11.1",
"version": "5.12.0",
"description": "A WDIO helper utility to provide several utility functions used across the project.",

@@ -10,3 +10,3 @@ "author": "Christian Bromann <christian@saucelabs.com>",

"engines": {
"node": ">= 8.11.0"
"node": ">= 10.13.0"
},

@@ -35,3 +35,3 @@ "scripts": {

"dependencies": {
"@wdio/logger": "^5.11.0",
"@wdio/logger": "^5.12.0",
"deepmerge": "^4.0.0"

@@ -42,3 +42,3 @@ },

},
"gitHead": "faed934ef001db6fe49331147cea70d377b0c2e3"
"gitHead": "187c8f044e252877533e53ee2b645f56416d5a41"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc