Socket
Socket
Sign inDemoInstall

@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 3.3.7 to 3.3.8

2

dist/form/form.utils.d.ts

@@ -1,1 +0,1 @@

export declare const toFlatErrors: (errors: Record<string, any>, setErrors: (fieldName: string, errors: string[]) => void) => void;
export declare const toFlatErrors: (errors: Record<string, any>, setErrors: (fieldName: string, errors: string[]) => void, prefix?: string) => void;

@@ -1,16 +0,14 @@

export var toFlatErrors = function (errors, setErrors) {
Object.keys(errors).forEach(function (namePart) {
var v = errors[namePart];
if (Array.isArray(v) && typeof v[0] === 'string') {
setErrors(namePart, v);
export var toFlatErrors = function (errors, setErrors, prefix) {
if (prefix === void 0) { prefix = ''; }
Object.entries(errors).forEach(function (_a) {
var namePart = _a[0], errorField = _a[1];
var name = (prefix ? prefix + "." : '') + namePart;
if ((Array.isArray(errorField) && typeof errorField[0] === 'string') ||
typeof errorField === 'string') {
setErrors(name, typeof errorField === 'string' ? [errorField] : errorField);
}
else {
var newObj = Object.entries(v).reduce(function (r, _a) {
var name = _a[0], value = _a[1];
r[namePart + "." + name] = value;
return r;
}, {});
toFlatErrors(newObj, setErrors);
toFlatErrors(errorField, setErrors, name);
}
});
};
{
"name": "@altiore/form",
"version": "3.3.7",
"version": "3.3.8",
"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