Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getNormalizedTarget(target) {
if (target instanceof ShallowWrapper || target instanceof ReactWrapper)
target = clearClassNames(toJson(target));
target = normalize(target);
return target;
}
module.exports = function (value) {
const options = getOptions()
const isReactComponent = value instanceof ShallowWrapper || value instanceof ReactWrapper
const shouldClearClassNames = options.sanitizeClassNames && isReactComponent
if (shouldClearClassNames) {
return clearClassNames(normalize(toJson(value)))
}
return isReactComponent
? normalize(toJson(value))
: normalize(value)
}