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() {
ValidatorsMessages.reopen({
i18n: inject.service(),
prefix: 'errors',
_regex: /\{{(\w+)\}}/g,
getDescriptionFor(attribute, options = {}) {
const i18n = get(this, 'i18n');
let key = `${get(this, 'prefix')}.description`;
let foundCustom;
if (!isEmpty(options.descriptionKey)) {
key = options.descriptionKey;
foundCustom = true;
} else if (!isEmpty(options.description)) {
return options.description;
}