@wdio/utils
Advanced tools
Comparing version
@@ -168,3 +168,12 @@ var __defProp = Object.defineProperty; | ||
const callArgs = args.map((arg) => { | ||
if (typeof arg === "string" && (arg.startsWith("!function(") || arg.startsWith("return (function") || arg.startsWith("return (async function"))) { | ||
if (typeof arg === "string" && /** | ||
* The regex pattern matches: | ||
* - Regular functions: `function()` or `function foo()` | ||
* - Async functions: `async function()` or `async function foo()` | ||
* - IIFEs: `!function()` | ||
* - Returned functions: `return function` or `return (function` | ||
* - Returned async functions: `return async function` or `return (async function` | ||
* - Arrow functions: `() =>` or `param =>` or `(param1, param2) =>` | ||
*/ | ||
/^\s*(?:(?:async\s+)?function\s*[\w\s]*\(|!function\(|return\s+\(?(?:async\s+)?function|\(?\w*(?:\s*,\s*\w+)*\)?\s*=>)/.test(arg.trim())) { | ||
arg = "<fn>"; | ||
@@ -171,0 +180,0 @@ } else if (typeof arg === "string" && /** |
{ | ||
"name": "@wdio/utils", | ||
"version": "9.10.1", | ||
"version": "9.11.0", | ||
"description": "A WDIO helper utility to provide several utility functions used across the project.", | ||
@@ -57,3 +57,3 @@ "author": "Christian Bromann <mail@bromann.dev>", | ||
}, | ||
"gitHead": "dc41a90e711d7b7a10e8129fb74650ad7a5956d0" | ||
"gitHead": "79a39e09a5eeabebac2f068b8d29f0ae4921fa20" | ||
} |
Sorry, the diff of this file is not supported yet
121424
0.39%2604
0.35%