@felte/common
Advanced tools
Comparing version 1.0.0-next.18 to 1.0.0-next.19
@@ -103,3 +103,3 @@ 'use strict'; | ||
return rsValue; | ||
const keys = Object.keys(source); | ||
const keys = Array.from(new Set(Object.keys(obj).concat(Object.keys(source)))); | ||
for (const key of keys) { | ||
@@ -384,2 +384,20 @@ rsValue = customizer(obj[key], source[key]); | ||
function isEqual(val1, val2) { | ||
if (val1 === val2) | ||
return true; | ||
if (Array.isArray(val1) && Array.isArray(val2)) { | ||
if (val1.length !== val2.length) | ||
return false; | ||
return val1.every((v, i) => isEqual(v, val2[i])); | ||
} | ||
if (_isPlainObject(val1) && _isPlainObject(val2)) { | ||
const keys1 = Object.keys(val1); | ||
const keys2 = Object.keys(val2); | ||
if (keys1.length !== keys2.length) | ||
return false; | ||
return keys1.every((k) => isEqual(val1[k], val2[k])); | ||
} | ||
return false; | ||
} | ||
/** | ||
@@ -556,2 +574,3 @@ * @ignore | ||
exports.isElement = isElement; | ||
exports.isEqual = isEqual; | ||
exports.isFieldSetElement = isFieldSetElement; | ||
@@ -558,0 +577,0 @@ exports.isFieldValue = isFieldValue; |
@@ -21,4 +21,5 @@ export { _some } from './utils/some.js'; | ||
export { createId } from './utils/createId.js'; | ||
export { isEqual } from './utils/isEqual.js'; | ||
export { isElement, isFieldSetElement, isFormControl, isInputElement, isSelectElement, isTextAreaElement } from './utils/typeGuards.js'; | ||
export { addAttrsFromFieldset, getFormControls, getFormDefaultValues, getInputTextOrNumber, setControlValue, setForm } from './utils/domUtils.js'; | ||
//# sourceMappingURL=index.js.map |
@@ -17,3 +17,3 @@ import { _cloneDeep } from './cloneDeep.js'; | ||
return rsValue; | ||
const keys = Object.keys(source); | ||
const keys = Array.from(new Set(Object.keys(obj).concat(Object.keys(source)))); | ||
for (const key of keys) { | ||
@@ -20,0 +20,0 @@ rsValue = customizer(obj[key], source[key]); |
@@ -21,2 +21,3 @@ export { _some } from "./utils/some"; | ||
export { createId } from "./utils/createId"; | ||
export { isEqual } from "./utils/isEqual"; | ||
export * from "./utils/typeGuards"; | ||
@@ -23,0 +24,0 @@ export * from "./utils/domUtils"; |
{ | ||
"name": "@felte/common", | ||
"version": "1.0.0-next.18", | ||
"version": "1.0.0-next.19", | ||
"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
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
176460
81
1625