Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

forma

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

forma

WIP

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

forma Build Status

WIP

TODO

Install

$ npm install --save forma

Usage

// TODO

Rule Definitions

TODO

Schemas

TODO

API

rule(block, toString)

Returns: Function or String

Generates a function to validate a single value/field.

Important: Do not use this to validate Arrays or Objects!

block

Type: Object

The rule's block definition – see Rule Definitions for more.

toString

Type: Boolean
Default: false

validate(schema, data)

Returns: Object or false

Instantly validate the data against a ruleset.

Note: Meant for singleton/one-off validations!
Use forma.compile() if you plan to reuse the same schema multiple times.

schema

Type: Object

The set of rule definitions for your incoming data object – see Schemas for more.

data

Type: Object

The value object to be validated.

compile(schema)

Returns: Function

Generates an optimized function that can be reused to validate incoming data.

Note: Ideal for repeat validations – huge performance boost!
Use forma.validate() if you only plan to validate once.

schema

Type: Object

The set of rule definitions for your incoming data object – see Schemas for more.

Benchmarks

TODO

License

MIT © Luke Edwards

FAQs

Package last updated on 11 Dec 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc