Socket
Socket
Sign inDemoInstall

@wdio/utils

Package Overview
Dependencies
Maintainers
7
Versions
292
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 6.0.13 to 6.0.16

28

build/utils.js

@@ -14,7 +14,3 @@ "use strict";

exports.filterSpecArgs = filterSpecArgs;
var _isBase = _interopRequireDefault(require("is-base64"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.isBase64 = isBase64;
const SCREENSHOT_REPLACEMENT = '"<Screenshot[base64]>"';

@@ -65,3 +61,3 @@

arg = '<fn>';
} else if (typeof arg === 'string' && (0, _isBase.default)(arg)) {
} else if (typeof arg === 'string' && isBase64(arg)) {
arg = SCREENSHOT_REPLACEMENT;

@@ -86,3 +82,3 @@ } else if (typeof arg === 'string') {

function transformCommandLogResult(result) {
if (typeof result.file === 'string' && (0, _isBase.default)(result.file)) {
if (typeof result.file === 'string' && isBase64(result.file)) {
return SCREENSHOT_REPLACEMENT;

@@ -158,2 +154,20 @@ }

return args.filter(arg => typeof arg !== 'function');
}
function isBase64(str) {
var notBase64 = new RegExp('[^A-Z0-9+\\/=]', 'i');
const isString = typeof str === 'string' || str instanceof String;
if (!isString) {
throw new Error('Expected string but received invalid type.');
}
const len = str.length;
if (!len || len % 4 !== 0 || notBase64.test(str)) {
return false;
}
const firstPaddingChar = str.indexOf('=');
return firstPaddingChar === -1 || firstPaddingChar === len - 1 || firstPaddingChar === len - 2 && str[len - 1] === '=';
}
{
"name": "@wdio/utils",
"version": "6.0.13",
"version": "6.0.16",
"description": "A WDIO helper utility to provide several utility functions used across the project.",

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

"dependencies": {
"@wdio/logger": "6.0.12",
"is-base64": "^1.1.0"
"@wdio/logger": "6.0.16"
},

@@ -41,3 +40,3 @@ "publishConfig": {

},
"gitHead": "dab0fc8fe4406eb3e02b9ad6c6898692de2d10f7"
"gitHead": "b165926711d8a4dc0cc8b885874651da8dda3e20"
}
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