Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default (
value: Object | Array,
inline: boolean,
lvl: number,
options: Options
): string => {
const normalizedValue = sortObject(value);
const stringifiedValue = prettyPrint(normalizedValue, {
transform: (currentObj, prop, originalResult) => {
const currentValue = currentObj[prop];
if (currentValue && isValidElement(currentValue)) {
return formatTreeNode(
parseReactElement(currentValue, options),
true,
lvl,
options
);
}
if (typeof currentValue === 'function') {
return formatFunction(currentValue, options);
}