diff --git a/example/StringCaseValidationPlugin.js b/example/StringCaseValidationPlugin.js new file mode 100644 index 0000000..fe48ee6 --- /dev/null +++ b/example/StringCaseValidationPlugin.js @@ -0,0 +1,12 @@ +var Database = require('iridium'); + +var Plugin = { + validate: function(schema, value, propertyName) { + if(schema == 'Uppercase') + return this.assert(value.toUpperCase() == value, 'uppercase string', value); + if(schema == 'Lowercase') + return this.assert(value.toLowerCase() == value, 'lowercase string', value); + } +}; + +module.exports = Plugin; \ No newline at end of file