Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const TestCafeDriver = require('./TestCafeDriver').TestCafeDriver
const t = require('testcafe').t
// TODO extract this to separate function
const stringify = function (obj) {
return JSON.stringify(obj, function (key, value) {
var fnBody
if (value instanceof Function || typeof value === 'function') {
fnBody = value.toString()
if (fnBody.length < 8 || fnBody.substring(0, 8) !== 'function') { // this is ES6 Arrow Function
return '_NuFrRa_' + fnBody
}
return fnBody
}
if (value instanceof RegExp) {
return '_PxEgEr_' + value
}