New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

formular

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

formular - npm Package Compare versions

Comparing version 2.1.7 to 2.1.8

10

lib/Form.d.ts

@@ -5,7 +5,8 @@ import Field, { FieldOpts, Validator } from './Field';

};
declare type FormFieldOpts<T> = {
[K in keyof T]: FieldOpts<T[K]> | Validator[];
};
export declare type FormOpts<T extends Object> = {
name?: string;
fields: {
[K in keyof T]: FieldOpts<T[K]> | Validator[];
};
fields: FormFieldOpts<T>;
initialValues?: Partial<{

@@ -32,3 +33,4 @@ [K in keyof T]: T[K];

constructor(opts: FormOpts<FieldValues>);
private _setupFields;
attachFields(fieldOpts: FormFieldOpts<FieldValues> | Partial<FormFieldOpts<FieldValues>>): void;
detachFields(fieldNames: Array<keyof FieldValues>): void;
setState(values: Partial<State>): void;

@@ -35,0 +37,0 @@ setValues(values: Obj): void;

12

lib/Form.js

@@ -67,7 +67,7 @@ var __assign = (this && this.__assign) || function () {

this._events = new Events();
this._setupFields();
this.attachFields(this.opts.fields);
}
Form.prototype._setupFields = function () {
Form.prototype.attachFields = function (fieldOpts) {
var _this = this;
var fieldNames = Object.keys(this.opts.fields);
var fieldNames = Object.keys(fieldOpts);
fieldNames.forEach(function (fieldName) {

@@ -91,2 +91,8 @@ var initialValue = _this.opts.initialValues && _this.opts.initialValues[fieldName];

};
Form.prototype.detachFields = function (fieldNames) {
var _this = this;
fieldNames.forEach(function (fieldName) {
delete _this.fields[fieldName];
});
};
Form.prototype.setState = function (values) {

@@ -93,0 +99,0 @@ this.state = __assign(__assign({}, this.state), values);

{
"name": "formular",
"version": "2.1.7",
"version": "2.1.8",
"author": "Pavel Ivanov",

@@ -5,0 +5,0 @@ "description": "Build forms in React. Easy-Peasy!",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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