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 function processResult(result) {
if (result && typeof result === 'object') {
let { type, context, message } = result;
if (message) {
return message;
}
set(context, 'description', Messages.getDescriptionFor(undefined, context));
return Messages.getMessageFor(type, context);
}
return result;
}
createErrorMessage(type, value, options) {
set(options, 'description', Messages.getDescriptionFor(undefined, options));
return Messages.getMessageFor(type, options);
}
};