Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const updateOutput = (output: any) => {
if (output) {
// We already have something here, don't change the other fields
return output.merge({
data: createFrozenMediaBundle(content.data),
metadata: fromJS(content.metadata || {})
});
} else if (content.output_type === "update_display_data") {
// Nothing here and we have no valid output, just create a basic output
return {
data: createFrozenMediaBundle(content.data),
metadata: fromJS(content.metadata || {}),
output_type: "display_data"
};
} else {
// Nothing here, but we have a valid output
return createImmutableOutput(content);
}
};