Skip to content

Commit

Permalink
fix: set
Browse files Browse the repository at this point in the history
  • Loading branch information
djalmajr committed Aug 20, 2023
1 parent 2f59015 commit 844f6a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const set = curry((path: any, value: any, source: any) => {
// prettier-ignore
val = val[path[i]] = i === path.length - 1
? typeof value === 'function' ? value(val[path[i]]) : value
: val[path[i]] ? copy(val[path[i]]) : +path[i+1] && [] || {};
: val[path[i]] ? copy(val[path[i]]) : Number.isNaN(+path[i+1]) && [] || {};
}
return src;
}) as SetFn;

0 comments on commit 844f6a3

Please sign in to comment.