hapijs/joi — pull request #521 by joeframbach (2014-12-26 03:03:37+00:00)
Title: custom validators

#### `any.custom(fn)`

Allows a custom validation function.
- `fn` - function which takes parameter `value` and returns either string error message or null.

```javascript
var schema = {
primeNumber: Joi.number().custom(function (n) {
if (!isPrime(n)) {
return 'must be prime';
}
return null;
})
};