Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit 3311d74

Browse files
committed
perf(form): skip empty strings from cache in serialize
Skip elements with empty string from cache
1 parent 832efb5 commit 3311d74

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/form-serializer/lib/serializeForm.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ function collectElementByIDs(element) {
1818

1919
if (rootElement) {
2020
rootElement.recursiveChildren.forEach((element) => {
21-
if (element.id) {
21+
// eslint-disable-next-line no-underscore-dangle
22+
const isNotEmptyStringElement = element._meta && element._meta.get('id');
23+
24+
if (isNotEmptyStringElement) {
2225
dataStructures[element.id.toValue()] = element;
2326
}
2427
});

0 commit comments

Comments
 (0)