0.2.5 • Published 4 years ago

ffield v0.2.5

Weekly downloads
1
License
GPL-3.0-or-later
Repository
github
Last release
4 years ago

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

ParamType
obj*
val*

ffield~fieldTypeToJsType(fieldType) ⇒ string

Convert field type to native js type.

Kind: inner method of ffield

ParamType
fieldTypestring

ffield~validateField(field, fieldValidator)

Validate a field object.

Kind: inner method of ffield

ParamTypeDescription
fieldObjectField object to validate.
fieldValidatorfunctionFunctional 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

ParamTypeDefaultDescription
fieldTypestringField'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.

ParamTypeDefaultDescription
fieldObjectField 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.

ParamTypeDescription
fieldObjectField object to clone.
0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.1

4 years ago

0.1.4

4 years ago

0.2.2

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago