Skip to content
Myr

fix: comparison typo

Before adoption: this commit came in with the history the project adopted, so no landing records it.

This bug prevented Immer from _not_ generating a "replace" patch when the new value is identical to the old value.

authored by aleclarson · committed by Alec Larson · parent 551d877 · Browse files · 2 files+3 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+3 added−5 removed

  • tests:+2 added−4 removed
  • other:+1 added−1 removed

2 files+3 added−5 removed

modified:__tests__/patch.js+2 added-4 removed
290 unmodified lines
291 const a = d.x292 d.x = 4293 d.x = a294 },295 // immer does not detect this is not an actual change296 [{op: "replace", path: ["x"], value: {y: 3}}]295 []296 )297})298299describe("same value replacement - 3", () => {
12 unmodified lines
312 d => {313 d.x = 4314 d.x = 3315 },317 // immer does not detect this is not an actual change318 [{op: "replace", path: ["x"], value: 3}]316 []317 )318})319320describe("simple delete", () => {
13 unmodified lines
modified:src/patches.js+1 added-1 removed