Skip to content

Commit

Permalink
chore(store): prefer Object.keys over Object.entries
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkdev98 committed Jun 4, 2023
1 parent 2b77a28 commit 99d9968
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/store/src/generator-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,14 @@ export function generatedUpdateHelper(entity, input) {
hasSet: false,
};

for (const [key, updateSpec] of Object.entries(input.update)) {
for (const key of Object.keys(input.update)) {
// Can't update 'undefined', needs to be 'null' if allowed
if (updateSpec === undefined) {
if (input.update[key] === undefined) {
continue;
}

const updateSpec = input.update[key];

// isPlainObject equivalent, but handling Object.create(null)
if (
!(
Expand Down

0 comments on commit 99d9968

Please sign in to comment.