ffield

0.2.5 • Public • Published

ffield

Small Node.js library for creating and validating data fields.


API

ffield

ffield~FIELD_TYPE

Field data types.

Kind: inner constant of ffield

ffield~JS_TYPE

Representation of native JS types.

Kind: inner constant of ffield

ffield~objHasVal(obj, val) ⇒ boolean

Checks if specified object has a property with the specified value.

Kind: inner method of ffield

Param Type
obj *
val *

ffield~fieldTypeToJsType(fieldType) ⇒ string

Convert field type to native js type.

Kind: inner method of ffield

Param Type
fieldType string

ffield~validateField(field, fieldValidator)

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)

ffield~createField(fieldType, fieldData)

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.

ffield~updateField(field, newData) ⇒ Object

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.

ffield~cloneField(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.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.2.53latest

Version History

VersionDownloads (Last 7 Days)Published
0.2.53
0.2.40
0.2.30
0.2.20
0.2.10
0.1.40
0.1.30
0.1.20
0.1.10
0.1.00

Package Sidebar

Install

npm i ffield

Weekly Downloads

3

Version

0.2.5

License

GPL-3.0-or-later

Unpacked Size

57.1 kB

Total Files

6

Last publish

Collaborators

  • tominflux