0.0.5 • Published 7 years ago
pure-validation v0.0.5
pure-validation
A lightweight module for simple object validation.
Installation
yarn add pure-validation
API
getInitState
Returns an empty object - initial state of validation.
getFieldValidityExtension
Returns a new object with new field name and its validity state.
prop | type | required | description |
---|---|---|---|
fieldName | string | true | A field name |
isOk | bool | true | A validity value |
setFieldValidity
Returns a new object with new field names and their validity states.
prop | type | required | description |
---|---|---|---|
fields | object | true | An object with list of field names and their validity states |
fieldName | string | true | A field name |
isOk | bool | true | A validity value |
setFieldsValidity
Returns a new object with new field names and their validity states.
prop | type | required | description |
---|---|---|---|
fields | object | true | An object with list of field names and their validity states |
fieldValidityExtensions | array | true | An array of objects with field names and their validity states. |
isFieldValid
prop | type | required | description |
---|---|---|---|
field | object | true | An object with field name to check |
isAllFieldsValid
prop | type | required | description |
---|---|---|---|
fields | object | true | An object with field names and their values to check |
isStringEmptyLike
prop | type | required | description |
---|---|---|---|
value | string | true | A value to check |
isEmailLike
prop | type | required | description |
---|---|---|---|
value | string | true | A value to check |
isPhoneLike
prop | type | required | description |
---|---|---|---|
value | string | true | A value to check |
isUrlLike
prop | type | required | description |
---|---|---|---|
value | string | true | A value to check |
License
MIT
0.0.5
7 years ago
0.0.4
7 years ago
0.0.3
7 years ago
0.0.2
7 years ago
0.0.1
7 years ago
0.0.1-rc.2
7 years ago
0.0.1-rc.1
7 years ago
0.0.1-rc.0
7 years ago