Skip to content

Commit

Permalink
Updates validator README
Browse files Browse the repository at this point in the history
  • Loading branch information
cperryk committed Dec 28, 2016
1 parent 9554a5f commit e1bf878
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions validators/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A longer description that explains the validation error.

### validate

A function that returns an array of warnings/errors (return an empty array if all rules pass). It receives a frozen `state` object with refs and components. For example, the following validator warns when `tk` exists in article headlines and paragraphs:
A function that returns an array of warnings/errors (return an empty array if all rules pass). It receives a frozen `state` object with refs, components, and the page's layout object. For example, the following validator warns when `tk` exists in article headlines and paragraphs:

```js
var label = 'TKs';
Expand All @@ -25,8 +25,11 @@ var label = 'TKs';
};

/**
* @param {{refs: object, components: Array}} state
* @returns {[object]} errors
* @param {Object} state
* @param {Object} state.refs
* @param {Array} state.components
* @param {Object} state.layout
* @returns {Object[]} errors
*/
function validate(state) {
var errors = [],
Expand Down

0 comments on commit e1bf878

Please sign in to comment.