@felte/common
Advanced tools
Comparing version 1.0.0-next.4 to 1.0.0-next.5
@@ -97,3 +97,3 @@ import { isFormControl, isFieldSetElement, isInputElement } from './typeGuards.js'; | ||
if (Array.isArray(_get(defaultData, elName)) && el.checked) { | ||
_update(defaultData, elName, (value) => { | ||
defaultData = _update(defaultData, elName, (value) => { | ||
if (typeof index !== 'undefined' && !Array.isArray(value)) | ||
@@ -100,0 +100,0 @@ value = []; |
import { _get } from './get.js'; | ||
import { _cloneDeep } from './cloneDeep.js'; | ||
@@ -6,3 +7,6 @@ /** @ignore */ | ||
if (Object(obj) !== obj) | ||
obj = {}; // When obj is not an object | ||
obj = {}; | ||
// When obj is not an object | ||
else if (typeof obj !== 'undefined') | ||
obj = _cloneDeep(obj); | ||
// If not yet an array, get the keys from the string-path | ||
@@ -9,0 +13,0 @@ const newPath = path.toString().match(/[^.[\]]+/g) || []; |
@@ -181,3 +181,6 @@ 'use strict'; | ||
if (Object(obj) !== obj) | ||
obj = {}; // When obj is not an object | ||
obj = {}; | ||
// When obj is not an object | ||
else if (typeof obj !== 'undefined') | ||
obj = _cloneDeep(obj); | ||
// If not yet an array, get the keys from the string-path | ||
@@ -398,3 +401,3 @@ const newPath = path.toString().match(/[^.[\]]+/g) || []; | ||
if (Array.isArray(_get(defaultData, elName)) && el.checked) { | ||
_update(defaultData, elName, (value) => { | ||
defaultData = _update(defaultData, elName, (value) => { | ||
if (typeof index !== 'undefined' && !Array.isArray(value)) | ||
@@ -401,0 +404,0 @@ value = []; |
{ | ||
"name": "@felte/common", | ||
"version": "1.0.0-next.4", | ||
"version": "1.0.0-next.5", | ||
"description": "Common utilities for Felte packages", | ||
@@ -5,0 +5,0 @@ "author": "Pablo Berganza <pablo@berganza.dev>", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
457224
6412