Ghost/core/client/app/utils/validator-extensions.js

20 lines
353 B
JavaScript
Raw Normal View History

2015-02-13 07:22:32 +03:00
import Ember from 'ember';
const {isBlank} = Ember;
function init() {
// Provide a few custom validators
//
validator.extend('empty', function (str) {
return isBlank(str);
});
validator.extend('notContains', function (str, badString) {
return str.indexOf(badString) === -1;
});
}
export default {
init
};