Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Commit

Permalink
added rule objects as an option alongside semicolon split strings
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkingshott committed Jul 29, 2022
1 parent cb4263c commit 1cf9d74
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 89 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ Iodine.assert(item_1, ['required', 'integer', 'min:5']);
Iodine.assert(item_2, ['required', 'integer', 'min:5']);
```

Or, if you prefer, you can supply the rule as an `object` instead of a `string` separated by a semicolon:

```js
Iodine.assert(8, ['required', 'integer', { rule : 'min', param : 7 }, 'max:10']);
```

## Optional values

For advanced validation, you may wish to allow for optional values. Iodine supports this with the `optional` rule:
Expand Down
2 changes: 1 addition & 1 deletion dist/iodine.min.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/iodine.min.esm.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 1cf9d74

Please sign in to comment.