Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Cap32 committed Jan 30, 2018
1 parent 8a87963 commit 1c20f65
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
- [`rootProps` option](#rootprops-option)
- [`strict` option](#strict-option)
- [Keywords](#keywords)
- [Syntactic Sugars](#syntactic-sugars)
- [array\(\)](#array)
- [object\(\)](#object)
- [required](#required)
- [dependencies](#dependencies)
- [Related projects](#related-projects)
- [License](#license)

Expand Down Expand Up @@ -156,6 +161,40 @@ skeeler.export('json', options);

[keywords.js](/src/keywords.js)

## Syntactic Sugars

### array()

`types.array(types.string)`

equals to

`types.array.items(types.string)`

### object()

`types.object({ foo: types.string })`

equals to

`types.object.properties({ foo: types.string })`

### required

`{ foo: types.required, bar: types.required }`

will be compiled to

`{ properties: { foo: {}, bar: {} }, required: ['foo', 'bar'] }`

### dependencies

`{ foo: types.dependencies(['bar']) }`

will be compiled to

`{ properties: { foo: {} }, dependencies: { foo: ['bar'] } }`

## Related projects

* [Skeeler](https://github.com/Cap32/skeeler)
Expand Down

0 comments on commit 1c20f65

Please sign in to comment.