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 buildMessage(key, result) {
let returnsRaw = getWithDefault(config, 'changeset-validations.rawOutput', false);
let messages = getMessages();
let description = messages.getDescriptionFor(key);
if (result.message) {
return result.message;
}
let { type, value, context = {} } = result;
if (context.message) {
let message = context.message;
if (typeOf(message) === 'function') {
let builtMessage = message(key, type, value, context);
assert('Custom message function must return a string', typeOf(builtMessage) === 'string');