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

@altiore/form

Package Overview
Dependencies
Maintainers
1
Versions
187
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@altiore/form - npm Package Compare versions

Comparing version 0.3.19 to 0.3.20

24

dist/form/form.js

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

import React, { useCallback, useRef, useState, } from 'react';
import cloneDeep from 'lodash/cloneDeep';
import get from 'lodash/get';
import isEqual from 'lodash/isEqual';
import set from 'lodash/set';
import unset from 'lodash/unset';
import { FormContext } from '../@common/form-context';

@@ -80,8 +82,20 @@ /**

var values = {};
formData.forEach(function (value, key) {
var keyArr = key.split('.');
set(values, keyArr, value);
formData.forEach(function (value, name) {
set(values, name, value);
});
onSubmit(values);
}, [onSubmit]);
var resValues = cloneDeep(values);
Object.keys(fields)
.reverse()
.forEach(function (fieldKey) {
var items = fields[fieldKey].items;
if (Array.isArray(items)) {
var value = items.map(function (index) {
return cloneDeep(get(resValues, fieldKey))[index];
});
unset(resValues, fieldKey);
set(resValues, fieldKey, value);
}
});
onSubmit(resValues);
}, [fields, onSubmit]);
return (React.createElement("form", { onSubmit: handleSubmit, ref: formRef },

@@ -88,0 +102,0 @@ React.createElement(FormContext.Provider, { value: {

{
"name": "@altiore/form",
"version": "0.3.19",
"version": "0.3.20",
"description": "Form helper for building powerful forms",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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