Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
({data: {id, payload}}) => {
const {hunks, oldSource, language, editsType} = payload;
const enhancers = [
editsType === 'none' ? null : markEdits(hunks, {type: editsType}),
markWord('\r', 'carriage-return', '␍'),
markWord('\t', 'tab', '→'),
];
const options = {
highlight: language !== 'text',
refractor: refractor,
language: language,
oldSource: oldSource,
enhancers: compact(enhancers),
};
try {
const tokens = tokenize(hunks, options);
const payload = {
success: true,