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

Commit 8d560c5

Browse files
patricksmmskylef
authored andcommitted
perf(json): skip empty strings from cache in serialize
Skip elements with empty string from cache
1 parent bfee55f commit 8d560c5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/json-serializer/lib/serializeJSON.js

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

1111
if (rootElement) {
1212
rootElement.recursiveChildren.forEach((element) => {
13-
if (element.id) {
13+
// eslint-disable-next-line no-underscore-dangle
14+
const isNotEmptyStringElement = element._meta && element._meta.get('id');
15+
16+
if (isNotEmptyStringElement) {
1417
dataStructures[element.id.toValue()] = element;
1518
}
1619
});

0 commit comments

Comments
 (0)