Small Node.js library for creating and validating data fields.
npm install ffield---
* ffield
* ~FIELD_TYPE
* ~JS_TYPE
* ~objHasVal(obj, val) ⇒ boolean
* ~fieldTypeToJsType(fieldType) ⇒ string
* ~validateField(field, fieldValidator)
* ~createField(fieldType, fieldData)
* ~updateField(field, newData) ⇒ Object
* ~cloneField(field) ⇒ Object
Kind: inner constant of ffield
Kind: inner constant of ffield
Kind: inner method of ffield
| Param | Type |
| --- | --- |
| obj | \* |
| val | \* |
Kind: inner method of ffield
| Param | Type |
| --- | --- |
| fieldType | string |
Kind: inner method of ffield
| Param | Type | Description |
| --- | --- | --- |
| field | Object | Field object to validate. |
| fieldValidator | function | Functional field validator. (true = valid) |
Kind: inner method of ffield
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| fieldType | string | | Field's data type. |
| fieldData | \* | | Field's data content. |
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. |
Kind: inner method of ffield
Returns: Object - Cloned field object.
| Param | Type | Description |
| --- | --- | --- |
| field | Object | Field object to clone. |