@wdio/utils
Advanced tools
Comparing version 6.0.13 to 6.0.16
@@ -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" | ||
} |
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
30001
1
861
+ Added@wdio/logger@6.0.16(transitive)
+ Addedchalk@4.1.2(transitive)
- Removedis-base64@^1.1.0
- Removed@wdio/logger@6.0.12(transitive)
- Removedchalk@3.0.0(transitive)
- Removedis-base64@1.1.0(transitive)
Updated@wdio/logger@6.0.16