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

factorial-form

Package Overview
Dependencies
Maintainers
5
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

factorial-form

Factorial form library

  • 3.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
69
decreased by-61.02%
Maintainers
5
Weekly downloads
 
Created
Source

Factorial form

Minimal library for dealing with form state.

Build Status JavaScript Style Guide

Installation

npm install factorial-form --save
yarn add factorial-form

Example

import { Form } from 'factorial-form'

const attributes = {
  name: 'paco',
  salary: 18000,
  created_at: 1497521766937,
  metadata: {
    friends: 12
  }
}
const schema = {
  name: 'string',
  salary: 'cents',
  age: 'timestamp',
  metadata: {
    friends: 'number'
  }
}

const form = new Form(attributes, schema)
const field = form.get('name')

field.value // => 'paco'
form.isDirty // => false

field.set('pepe')
field.value // => 'pepe'
field.isDirty // => true
form.isDirty // => true

Where is it used?

Developed and battle tested in production in Factorial

FAQs

Package last updated on 19 Dec 2022

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