Socket
Socket
Sign inDemoInstall

ffield

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ffield

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


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
55.7 kB
Created
Weekly downloads
 

Readme

Source

ffield

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


API

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

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.

Keywords

FAQs

Last updated on 29 Jul 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc