Small Node.js library for creating and validating data fields.
Field data types.
Kind: inner constant of ffield
Representation of native JS types.
Kind: inner constant of ffield
Checks if specified object has a property with the specified value.
Kind: inner method of ffield
Param | Type |
---|---|
obj | * |
val | * |
Convert field type to native js type.
Kind: inner method of ffield
Param | Type |
---|---|
fieldType | string |
Validate a field object.
Kind: inner method of ffield
Param | Type | Description |
---|---|---|
field | Object |
Field object to validate. |
fieldValidator | function |
Functional field validator. (true = valid) |
Create a field object. Native js type of fieldData must match equivalent fieldType.
Kind: inner method of ffield
Param | Type | Default | Description |
---|---|---|---|
fieldType | string |
Field's data type. | |
fieldData | * |
|
Field's data content. |
Update the data of a field object. (Performs validation on updated field object too.)
Kind: inner method of ffield
Returns: Object
- Updated field object.
Param | Type | Default | Description |
---|---|---|---|
field | Object |
Field object to update. | |
newData | * |
|
New data to apply to field object. |
Clone a field object. (Performs validation on cloned field object too.)
Kind: inner method of ffield
Returns: Object
- Cloned field object.
Param | Type | Description |
---|---|---|
field | Object |
Field object to clone. |