Skip to content

Commit

Permalink
Merge branch 'release/1.1.0' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
diversario committed Oct 11, 2013
2 parents 42e574b + c7d0833 commit c9b5a5c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion README.md
Expand Up @@ -20,7 +20,15 @@ Property declarations can specify a property name or a path to a property using
Supported property options:

* `required`: _Boolean_ If this field is required
* `type`: _String, Array_ A lower*cased constructor name ('object', 'regexp', 'array' etc.) and also 'null' and 'undefined'. Setting this property to an array of values will look for one of the values.
* `type`: _String, Array_ A lower*cased constructor name, 'null' and 'undefined'. Setting this property to an array of values will look for one of the values. Possible values are:
- `object`
- `regexp`
- `array`
- `function`
- `string`
- `number`
- `date`
- `boolean`
* `regexp`: _RegExp_ Regular expression to run on property value. Array of expressions is supported as well and validation will pass if at least one regular expression passes.
* `regexpAll`: _RegExp_ Regular expression to run on property value. Array of expressions is supported as well and validation will pass only if all expressions pass.
* `function`: _Function, String_ Function to run with `this` being the object and property name as first argument. This parameter can also be specified as a string if you want to point to a function in the global scope (defined as `global.fn = myFunc`)
Expand All @@ -39,6 +47,7 @@ Running validation returns an array of violated rules, as such:
[
{
property: 'prop1',
value: 'Value of prop1',
rule: { /* rule as defined in the schema */ }
}
]
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "simple-schema",
"version": "1.0.0",
"version": "1.1.0",
"description": "Simple object validation framework",
"keywords": [
"validation",
Expand Down

0 comments on commit c9b5a5c

Please sign in to comment.