Skip to content

Commit

Permalink
Fix for empty number inputs breaking
Browse files Browse the repository at this point in the history
  • Loading branch information
Wholteza committed Jan 9, 2024
1 parent 956b480 commit c7d82b0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/helpers/dynamic-object-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ export const mutatePropOnPath = <K>(
return;
}

const propType = typeof dynamicObject[key];
if (propType !== typeof newValue) {
// TODO: Add a test for this
const oldValue = dynamicObject[key];
const propType = typeof oldValue;
if (propType !== typeof newValue && oldValue !== null) {
throw new Error(`The provided value is not of type ${propType}`);
}

Expand Down

0 comments on commit c7d82b0

Please sign in to comment.