Skip to content

Commit

Permalink
fix: set again
Browse files Browse the repository at this point in the history
  • Loading branch information
djalmajr committed Aug 20, 2023
1 parent 62998a1 commit 5445349
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]]) : Number.isNaN(+path[i+1]) && [] || {};
: val[path[i]] ? copy(val[path[i]]) : path[i+1]*0 === 0 && [] || {};
}
return src;
}) as SetFn;

0 comments on commit 5445349

Please sign in to comment.