Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
size="small"
color="light"
underlined
title={showSpaces(unquote(prop.defaultValue.value))}>
Function
} else if (propName === 'shape' || propName === 'object') {
try {
// We eval source code to be able to format the defaultProp here. This
// can be considered safe, as it is the source code that is evaled,
// which is from a known source and safe by default
// eslint-disable-next-line no-eval
const object = eval(`(${prop.defaultValue.value})`)
return (
)
} catch (e) {
// eval will throw if it contains a reference to a property not in the
// local scope. To avoid any breakage we fall back to rendering the
// prop without any formatting
return (
)
}
}
}