Skip to content

Instantly share code, notes, and snippets.

@3rd-Eden
Created September 19, 2011 13:56
Show Gist options
  • Save 3rd-Eden/1226543 to your computer and use it in GitHub Desktop.
Save 3rd-Eden/1226543 to your computer and use it in GitHub Desktop.
var Schema = require('<secret>/schema');
/**
* Define a validation schema for the `randomname` object.
*
* @static {Object}
*/
exports.randomname = {
name: new Schema().string().length(5, 25).$
, age: new Schema().number().between(18, 130).$
, skills: new Schema().array().length(1, 10).not('sex', 'pedobear').$
, ip: new Schema().string().not('127.0.0.1').match(/\d+/i).$
, administrator: new Schema().optional().string().length(5, 25).$
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment