@percy/core
Advanced tools
Comparing version 1.6.3 to 1.6.4
@@ -185,7 +185,10 @@ import EventEmitter from 'events'; | ||
} | ||
} // Serializes the provided function with percy helpers for use in evaluating browser scripts | ||
} // Used to test if a string looks like a function | ||
const FUNC_REG = /^(async\s+)?(function\s*)?(\w+\s*)?\(.*?\)\s*(\{|=>)/is; // Serializes the provided function with percy helpers for use in evaluating browser scripts | ||
export function serializeFunction(fn) { | ||
let fnbody = typeof fn === 'string' ? `async eval() {\n${fn}\n}` : fn.toString(); // we might have a function shorthand if this fails | ||
// stringify or convert a function body into a complete function | ||
let fnbody = typeof fn === 'string' && !FUNC_REG.test(fn) ? `async function eval() {\n${fn}\n}` : fn.toString(); // we might have a function shorthand if this fails | ||
@@ -192,0 +195,0 @@ /* eslint-disable-next-line no-new, no-new-func */ |
{ | ||
"name": "@percy/core", | ||
"version": "1.6.3", | ||
"version": "1.6.4", | ||
"license": "MIT", | ||
@@ -42,6 +42,6 @@ "repository": { | ||
"dependencies": { | ||
"@percy/client": "1.6.3", | ||
"@percy/config": "1.6.3", | ||
"@percy/dom": "1.6.3", | ||
"@percy/logger": "1.6.3", | ||
"@percy/client": "1.6.4", | ||
"@percy/config": "1.6.4", | ||
"@percy/dom": "1.6.4", | ||
"@percy/logger": "1.6.4", | ||
"content-disposition": "^0.5.4", | ||
@@ -57,3 +57,3 @@ "cross-spawn": "^7.0.3", | ||
}, | ||
"gitHead": "ab48a150317a4af36d536a5671701532c669d2d1" | ||
"gitHead": "651c0fad62f128053723f9b8d565c69496dc51e4" | ||
} |
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
148261
3301
+ Added@percy/client@1.6.4(transitive)
+ Added@percy/config@1.6.4(transitive)
+ Added@percy/dom@1.6.4(transitive)
+ Added@percy/env@1.6.4(transitive)
+ Added@percy/logger@1.6.4(transitive)
- Removed@percy/client@1.6.3(transitive)
- Removed@percy/config@1.6.3(transitive)
- Removed@percy/dom@1.6.3(transitive)
- Removed@percy/env@1.6.3(transitive)
- Removed@percy/logger@1.6.3(transitive)
Updated@percy/client@1.6.4
Updated@percy/config@1.6.4
Updated@percy/dom@1.6.4
Updated@percy/logger@1.6.4