-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from FieldVal/develop
Added parameters to errors
- Loading branch information
Showing
55 changed files
with
644 additions
and
573 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "fieldval", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"main": "fieldval.js", | ||
"ignore": [ | ||
"coverage", | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
BasicVal is a set of standard FieldVal [check functions](/docs/fieldval/Check%20Functions). Checks accept [flags](/docs/fieldval/Flags) as arguments and return typical FieldVal [errors](/docs/fieldval/Errors). | ||
BasicVal is a set of standard FieldVal [check functions](/docs/fieldval/Check%20Functions). Checks accept [options](/docs/fieldval/Options) as arguments and return typical FieldVal [errors](/docs/fieldval/Errors). | ||
|
||
BasicVal can be found at ```FieldVal.BasicVal```. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
```BasicVal.date_format([flags])``` | ||
```BasicVal.date_format([options])``` | ||
|
||
Checks whether a specified string value is a valid date format. |
2 changes: 1 addition & 1 deletion
2
docs_src/BasicVal/OtherChecks/does_not_contain/does_not_contain.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
```BasicVal.does_not_contain(characters, [flags])``` | ||
```BasicVal.does_not_contain(characters, [options])``` | ||
|
||
Checks if strings does not contain any of the provided characters. ```characters``` can be either one character or a list of characters. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
```BasicVal.equal_to(desired_value, [flags])``` | ||
```BasicVal.equal_to(desired_value, [options])``` | ||
|
||
Checks if the value that is being validated is equal to the desired value. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
```BasicVal.length(desired_length, [flags])``` | ||
```BasicVal.length(desired_length, [options])``` | ||
|
||
Checks if the value has desired length. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
```BasicVal.max_length(max_length, [flags])``` | ||
```BasicVal.max_length(max_length, [options])``` | ||
|
||
Checks if length of the value is less or equal to min_length. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
```BasicVal.maximum(max_val, [flags])``` | ||
```BasicVal.maximum(max_val, [options])``` | ||
|
||
Checks if the value is less or equal to max_val. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
```BasicVal.min_length(min_length, [flags])``` | ||
```BasicVal.min_length(min_length, [options])``` | ||
|
||
Checks if length of the value is greater or equal to min_length. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
```BasicVal.minimum(min_val, [flags])``` | ||
```BasicVal.minimum(min_val, [options])``` | ||
|
||
Checks if the value is greater or equal to min_val. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
```BasicVal.no_whitespace([flags])``` | ||
```BasicVal.no_whitespace([options])``` | ||
|
||
Checks that there is no whitespace in the value. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
```BasicVal.not_empty(trim, [flags])``` | ||
```BasicVal.not_empty(trim, [options])``` | ||
|
||
Checks if the string value is not empty. ```trim``` is a boolean specifying whether the string needs to be trimmed before the check. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
```BasicVal.not_one_of(undesired_values, [flags])``` | ||
```BasicVal.not_one_of(undesired_values, [options])``` | ||
|
||
Checks if the value is not equal to one of the undesired_values. ```undesired_values``` is an array. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
```BasicVal.one_of(desired_values, [flags])``` | ||
```BasicVal.one_of(desired_values, [options])``` | ||
|
||
Checks if the value is equal to one of the desired_values. ```desired_values``` is an array. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
```BasicVal.each(on_each, [flags])``` | ||
```BasicVal.each(on_each, [options])``` | ||
|
||
Checks if the string value starts with the ```desired_prefix```. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
```BasicVal.range(min_val, max_val, [flags])``` | ||
```BasicVal.range(min_val, max_val, [options])``` | ||
|
||
Combines [minimum](/docs/fieldval/BasicVal/minimum) and [maximum](/docs/fieldval/BasicVal/maximum). |
2 changes: 1 addition & 1 deletion
2
docs_src/BasicVal/OtherChecks/start_with_letter/start_with_letter.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
```BasicVal.start_with_letter([flags])``` | ||
```BasicVal.start_with_letter([options])``` | ||
|
||
Checks if the string value starts with a letter. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
```BasicVal.suffix(desired_suffix, [flags])``` | ||
```BasicVal.suffix(desired_suffix, [options])``` | ||
|
||
Checks if the string value ends with the ```desired_suffix```. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
```BasicVal.array([required], [flags])``` | ||
```BasicVal.array([required], [options])``` | ||
|
||
Checks if the value is an array. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
```BasicVal.boolean([required], [flags])``` | ||
```BasicVal.boolean([required], [options])``` | ||
|
||
Checks if the value is a boolean. | ||
|
||
Set ```{parse: true}``` in the flags object to attempt to parse the value. | ||
Set ```{parse: true}``` in the ```options``` object to attempt to parse the value. | ||
|
||
If the value is either "true" or "false" as a string, it will be parsed to the corresponding boolean. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
```BasicVal.email([required], [flags])``` | ||
```BasicVal.email([required], [options])``` | ||
|
||
Checks if the value is first a string, and then an email. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
```BasicVal.integer([required], [flags])``` | ||
```BasicVal.integer([required], [options])``` | ||
|
||
Checks if the value is an integer. | ||
|
||
Set ```{parse: true}``` in the flags object to attempt to parse the value. | ||
Set ```{parse: true}``` in the ```options``` object to attempt to parse the value. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
```BasicVal.number([required], [flags])``` | ||
```BasicVal.number([required], [options])``` | ||
|
||
Checks if the value is a number, including floats. | ||
|
||
Set ```{parse: true}``` in the flags object to attempt to parse the value. | ||
Set ```{parse: true}``` in the ```options``` object to attempt to parse the value. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
```BasicVal.object([required], [flags])``` | ||
```BasicVal.object([required], [options])``` | ||
|
||
Checks if the value is an object. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
```BasicVal.string([required], [flags])``` | ||
```BasicVal.string([required], [options])``` | ||
|
||
Checks if the value is a string. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
```BasicVal.url([required],[flags])``` | ||
```BasicVal.url([required],[options])``` | ||
|
||
Checks if the value is first a string, and then a url. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Options are used to both pass values to a check and also to indicate to a FieldVal validator how to use the check. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
The ```error``` option overrides the standard error for [BasicVal](/docs/fieldval/BasicVal) checks. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.