Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@agape/forms
Advanced tools
Readme
Abstraction for describing a form and it's state
import fb from '@agape/forms'
const form = new FormGroup()
.string('foo')
.number('bar')
form.setValue({'foo': 'Hello World!', 'bar': 42 })
form.value; /*{'foo': 'Hello World!', 'bar': 42 }*/
form.patchValue({'foo': 'Hello there' })
form.value; /*{'foo': 'Hello there', 'bar': 42 }*/
Create forms simply and elegantly using a builder-style interface
FormGroup
Abstraction representing a collection of form fields
fields
The fields in the form group
value
The value of the form and corresponding fields
answers
Synonym for value
has( fieldName )
Does the form group contain a field with the given name
get( fieldName )
Retrieve the form field with the given name
number( name, label )
Create a new number field and add it to the form
string( name, label )
Create a new string field and add it to the form
patchValue({ name: value, ... })
Update form field values
setValue({...})
Set the value of the entire form group
FormField
Abstraction representing a single form field
type
The type of form field, either number
or string
name
The name of the form field
label
The label for the form field. Generated automatically from the name if not explicitly set.
length
The length of the form field.
FormBuilder
Create a new form using the form builder
import fb from '@agape/forms`
const form = fb.string('foo')
form instanceof FormGroup; /* true */
string(name, label, length)
Create a new form with a string field
number(name, label)
Create a new form with a number field
number
string
Currently only number
and string
field types are supported in this version.
Future versions will support boolean
, date
, time
, datetime
, text
, and
array
fields.
Maverik Minett maverik.minett@gmail.com
© 2023 Maverik Minett
MIT
FAQs
Abstraction for describing a form and it's state
We found that @agape/forms demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.