Skip to content

Commit

Permalink
Update Any.raw example to clarify behavior.
Browse files Browse the repository at this point in the history
  • Loading branch information
WesTyler committed Dec 13, 2016
1 parent bf4ec5d commit d95f3f5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -664,9 +664,11 @@ Outputs the original untouched value instead of the casted value.
- `isRaw` - whether to enable raw mode or not. Defaults to true.
```js
const schema = {
timestamp: Joi.date().raw()
};
const timestampSchema = Joi.date().timestamp();
timestampSchema.validate('12376834097810'); // { error: null, value: Sat Mar 17 2362 04:28:17 GMT-0500 (CDT) }

const rawTimestampSchema = Joi.date().timestamp().raw();
rawTimestampSchema.validate('12376834097810'); // { error: null, value: '12376834097810' }
```
#### `any.empty(schema)`
Expand Down

0 comments on commit d95f3f5

Please sign in to comment.