Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import ValidatorsMessage from 'ember-cp-validations/validators/messages';
export default ValidatorsMessage.extend({
inclusion: "is not included in the list",
exclusion: "is reserved",
invalid: "is invalid",
confirmation: "doesn't match {attribute}",
accepted: "must be accepted",
empty: "can't be empty",
blank: "can't be blank",
present: "must be blank",
collection: "must be a collection",
singular: "can't be a collection",
tooLong: "is too long (maximum is {count} characters)",
tooShort: "is too short (minimum is {count} characters)",
before: "must be before {date}",
after: "must be after {date}",
wrongDateFormat: "must be in the format of {date}",
wrongLength: "is the wrong length (should be {count} characters)",
function unwrap(input) {
if (isSafeString(input)) {
return input.toString();
}
return input;
}
function emitWarning(msg, meta, ENV) {
if (!get(ENV, 'i18n.suppressWarnings')) {
warn(msg, false, meta);
}
}
export default ValidatorsMessages.extend({
i18n: service(),
_regex: /\{\{(\w+)\}\}|\{(\w+)\}/g,
_prefix: computed('prefix', function() {
const prefix = get(this, 'prefix');
if (typeof prefix === 'string') {
if (prefix.length) {
return prefix + '.';
}
return prefix;
}
return 'errors.';
}),