patch.js
This file
Path
__tests__/patch.js
700 lines · 12.8 KiB · JavaScript
Last changed by
run prettier with master config before mergingMichel Weststratebefore adoptionae80361
History of this fileTake it
The walk stopped after 200 commits: lines older than 53e9ce8 point at it.
perf: proxy assignaleclarsonbefore adoption53e9ce8
line 1why, one step back1"use strict"chore: update import paths in testsaleclarsonbefore adoptioncdc09b1
line 2why, one step back2import produce, {setUseProxies, applyPatches} from "../src/index"perf: proxy assignaleclarsonbefore adoption53e9ce8
lines 3–5why, one step back34jest.setTimeout(1000)5Merge pull request #437 from runnez/es5-map-and-set-supportMichel Weststratebefore adoption85656cb
line 6why, one step back6function runPatchTest(base, producer, patches, inversePathes) {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 7–38why, one step back7 function runPatchTestHelper() {8 let recordedPatches9 let recordedInversePatches1011 const res = produce(base, producer, (p, i) => {12 recordedPatches = p13 recordedInversePatches = i14 })1516 test("produces the correct patches", () => {17 expect(recordedPatches).toEqual(patches)18 if (inversePathes) expect(recordedInversePatches).toEqual(inversePathes)19 })2021 test("patches are replayable", () => {22 expect(applyPatches(base, recordedPatches)).toEqual(res)23 })2425 test("patches can be reversed", () => {26 expect(applyPatches(res, recordedInversePatches)).toEqual(base)27 })28 }2930 describe(`proxy`, () => {31 setUseProxies(true)32 runPatchTestHelper()33 })3435 describe(`es5`, () => {36 setUseProxies(false)37 runPatchTestHelper()38 })perf: proxy assignaleclarsonbefore adoption53e9ce8
line 39why, one step back39}run prettier with master config before mergingMichel Weststratebefore adoptionae80361
line 40why, one step back40perf: proxy assignaleclarsonbefore adoption53e9ce8
line 41why, one step back41describe("applyPatches", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 42–78why, one step back42 it("mutates the base state when it is a draft", () => {43 produce({a: 1}, draft => {44 const result = applyPatches(draft, [45 {op: "replace", path: ["a"], value: 2}46 ])47 expect(result).toBe(draft)48 expect(draft.a).toBe(2)49 })50 })51 it("produces a copy of the base state when not a draft", () => {52 const base = {a: 1}53 const result = applyPatches(base, [{op: "replace", path: ["a"], value: 2}])54 expect(result).not.toBe(base)55 expect(result.a).toBe(2)56 expect(base.a).toBe(1)57 })58 it('throws when `op` is not "add", "replace", nor "remove"', () => {59 expect(() => {60 const patch = {op: "copy", from: [0], path: [1]}61 applyPatches([2], [patch])62 }).toThrowErrorMatchingSnapshot()63 })64 it("throws when `path` cannot be resolved", () => {65 // missing parent66 expect(() => {67 const patch = {op: "add", path: ["a", "b"], value: 1}68 applyPatches({}, [patch])69 }).toThrowErrorMatchingSnapshot()7071 // missing grand-parent72 expect(() => {73 const patch = {op: "add", path: ["a", "b", "c"], value: 1}74 applyPatches({}, [patch])75 }).toThrowErrorMatchingSnapshot()76 })77})78perf: proxy assignaleclarsonbefore adoption53e9ce8
line 79why, one step back79describe("simple assignment - 1", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 80–88why, one step back80 runPatchTest(81 {x: 3},82 d => {83 d.x++84 },85 [{op: "replace", path: ["x"], value: 4}]86 )87})88perf: proxy assignaleclarsonbefore adoption53e9ce8
line 89why, one step back89describe("simple assignment - 2", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 90–98why, one step back90 runPatchTest(91 {x: {y: 4}},92 d => {93 d.x.y++94 },95 [{op: "replace", path: ["x", "y"], value: 5}]96 )97})98feat: improved array patchesIlyas Kabirovbefore adoptioncb5707f
line 99why, one step back99describe("simple assignment - 3", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 100–108why, one step back100 runPatchTest(101 {x: [{y: 4}]},102 d => {103 d.x[0].y++104 },105 [{op: "replace", path: ["x", 0, "y"], value: 5}]106 )107})108feat: `Map` drafts and patcheskeenondrumsbefore adoption30db0f3
line 109why, one step back109describe("simple assignment - 4", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 110–119why, one step back110 runPatchTest(111 new Map([["x", {y: 4}]]),112 d => {113 d.get("x").y++114 },115 [{op: "replace", path: ["x", "y"], value: 5}],116 [{op: "replace", path: ["x", "y"], value: 4}]117 )118})119feat: `Map` drafts and patcheskeenondrumsbefore adoption30db0f3
line 120why, one step back120describe("simple assignment - 5", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 121–130why, one step back121 runPatchTest(122 {x: new Map([["y", 4]])},123 d => {124 d.x.set("y", 5)125 },126 [{op: "replace", path: ["x", "y"], value: 5}],127 [{op: "replace", path: ["x", "y"], value: 4}]128 )129})130fix: Map.prototype.set should return a draftAndrey Goncharovbefore adoption7001201
line 131why, one step back131describe("simple assignment - 6", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 132–146why, one step back132 runPatchTest(133 new Map([["x", 1]]),134 d => {135 // Map.prototype.set should return the Map itself136 const res = d.set("x", 2)137 res.set("y", 3)138 },139 [140 {op: "replace", path: ["x"], value: 2},141 {op: "add", path: ["y"], value: 3}142 ],143 [{op: "replace", path: ["x"], value: 1}, {op: "remove", path: ["y"]}]144 )145})146feat: add support of non-primitive keys for `Maps`keenondrumsbefore adoption6501ec5
line 147why, one step back147describe("simple assignment - 7", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 148–166why, one step back148 const key1 = {prop: "val1"}149 const key2 = {prop: "val2"}150 runPatchTest(151 {x: new Map([[key1, 4]])},152 d => {153 d.x.set(key1, 5)154 d.x.set(key2, 6)155 },156 [157 {op: "replace", path: ["x", key1], value: 5},158 {op: "add", path: ["x", key2], value: 6}159 ],160 [161 {op: "replace", path: ["x", key1], value: 4},162 {op: "remove", path: ["x", key2]}163 ]164 )165})166perf: proxy assignaleclarsonbefore adoption53e9ce8
line 167why, one step back167describe("delete 1", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 168–176why, one step back168 runPatchTest(169 {x: {y: 4}},170 d => {171 delete d.x172 },173 [{op: "remove", path: ["x"]}]174 )175})176feat: `Map` drafts and patcheskeenondrumsbefore adoption30db0f3
line 177why, one step back177describe("delete 2", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 178–187why, one step back178 runPatchTest(179 new Map([["x", 1]]),180 d => {181 d.delete("x")182 },183 [{op: "remove", path: ["x"]}],184 [{op: "add", path: ["x"], value: 1}]185 )186})187feat: `Map` drafts and patcheskeenondrumsbefore adoption30db0f3
line 188why, one step back188describe("delete 3", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 189–198why, one step back189 runPatchTest(190 {x: new Map([["y", 1]])},191 d => {192 d.x.delete("y")193 },194 [{op: "remove", path: ["x", "y"]}],195 [{op: "add", path: ["x", "y"], value: 1}]196 )197})198feat: add support of non-primitive keys for `Maps`keenondrumsbefore adoption6501ec5
line 199why, one step back199describe("delete 5", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 200–215why, one step back200 const key1 = {prop: "val1"}201 const key2 = {prop: "val2"}202 runPatchTest(203 {x: new Map([[key1, 1], [key2, 2]])},204 d => {205 d.x.delete(key1)206 d.x.delete(key2)207 },208 [{op: "remove", path: ["x", key1]}, {op: "remove", path: ["x", key2]}],209 [210 {op: "add", path: ["x", key1], value: 1},211 {op: "add", path: ["x", key2], value: 2}212 ]213 )214})215feat: add support of non-primitive keys for `Maps`keenondrumsbefore adoption6501ec5
line 216why, one step back216describe("delete 6", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 217–226why, one step back217 runPatchTest(218 new Set(["x", 1]),219 d => {220 d.delete("x")221 },222 [{op: "remove", path: [0], value: "x"}],223 [{op: "add", path: [0], value: "x"}]224 )225})226feat: add support of non-primitive keys for `Maps`keenondrumsbefore adoption6501ec5
line 227why, one step back227describe("delete 7", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 228–237why, one step back228 runPatchTest(229 {x: new Set(["y", 1])},230 d => {231 d.x.delete("y")232 },233 [{op: "remove", path: ["x", 0], value: "y"}],234 [{op: "add", path: ["x", 0], value: "y"}]235 )236})237perf: proxy assignaleclarsonbefore adoption53e9ce8
line 238why, one step back238describe("renaming properties", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 239–364why, one step back239 describe("nested object (no changes)", () => {240 runPatchTest(241 {a: {b: 1}},242 d => {243 d.x = d.a244 delete d.a245 },246 [{op: "add", path: ["x"], value: {b: 1}}, {op: "remove", path: ["a"]}]247 )248 })249250 describe("nested map (no changes)", () => {251 runPatchTest(252 new Map([["a", new Map([["b", 1]])]]),253 d => {254 d.set("x", d.get("a"))255 d.delete("a")256 },257 [258 {op: "add", path: ["x"], value: new Map([["b", 1]])},259 {op: "remove", path: ["a"]}260 ],261 [262 {op: "remove", path: ["x"]},263 {op: "add", path: ["a"], value: new Map([["b", 1]])}264 ]265 )266 })267268 describe("nested object (with changes)", () => {269 runPatchTest(270 {a: {b: 1, c: 1}},271 d => {272 let a = d.a273 a.b = 2 // change274 delete a.c // delete275 a.y = 2 // add276277 // rename278 d.x = a279 delete d.a280 },281 [282 {op: "add", path: ["x"], value: {b: 2, y: 2}},283 {op: "remove", path: ["a"]}284 ]285 )286 })287288 describe("nested map (with changes)", () => {289 runPatchTest(290 new Map([["a", new Map([["b", 1], ["c", 1]])]]),291 d => {292 let a = d.get("a")293 a.set("b", 2) // change294 a.delete("c") // delete295 a.set("y", 2) // add296297 // rename298 d.set("x", a)299 d.delete("a")300 },301 [302 {op: "add", path: ["x"], value: new Map([["b", 2], ["y", 2]])},303 {op: "remove", path: ["a"]}304 ],305 [306 {op: "remove", path: ["x"]},307 {op: "add", path: ["a"], value: new Map([["b", 1], ["c", 1]])}308 ]309 )310 })311312 describe("deeply nested object (with changes)", () => {313 runPatchTest(314 {a: {b: {c: 1, d: 1}}},315 d => {316 let b = d.a.b317 b.c = 2 // change318 delete b.d // delete319 b.y = 2 // add320321 // rename322 d.a.x = b323 delete d.a.b324 },325 [326 {op: "add", path: ["a", "x"], value: {c: 2, y: 2}},327 {op: "remove", path: ["a", "b"]}328 ]329 )330 })331332 describe("deeply nested map (with changes)", () => {333 runPatchTest(334 new Map([["a", new Map([["b", new Map([["c", 1], ["d", 1]])]])]]),335 d => {336 let b = d.get("a").get("b")337 b.set("c", 2) // change338 b.delete("d") // delete339 b.set("y", 2) // add340341 // rename342 d.get("a").set("x", b)343 d.get("a").delete("b")344 },345 [346 {347 op: "add",348 path: ["a", "x"],349 value: new Map([["c", 2], ["y", 2]])350 },351 {op: "remove", path: ["a", "b"]}352 ],353 [354 {op: "remove", path: ["a", "x"]},355 {356 op: "add",357 path: ["a", "b"],358 value: new Map([["c", 1], ["d", 1]])359 }360 ]361 )362 })363})364perf: proxy assignaleclarsonbefore adoption53e9ce8
line 365why, one step back365describe("minimum amount of changes", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 366–379why, one step back366 runPatchTest(367 {x: 3, y: {a: 4}, z: 3},368 d => {369 d.y.a = 4370 d.y.b = 5371 Object.assign(d, {x: 4, y: {a: 2}})372 },373 [374 {op: "replace", path: ["x"], value: 4},375 {op: "replace", path: ["y"], value: {a: 2}}376 ]377 )378})379perf: proxy assignaleclarsonbefore adoption53e9ce8
line 380why, one step back380describe("arrays - prepend", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 381–389why, one step back381 runPatchTest(382 {x: [1, 2, 3]},383 d => {384 d.x.unshift(4)385 },386 [{op: "add", path: ["x", 0], value: 4}]387 )388})389feat: improved array patchesIlyas Kabirovbefore adoptioncb5707f
line 390why, one step back390describe("arrays - multiple prepend", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 391–403why, one step back391 runPatchTest(392 {x: [1, 2, 3]},393 d => {394 d.x.unshift(4)395 d.x.unshift(5)396 },397 [398 {op: "add", path: ["x", 0], value: 5},399 {op: "add", path: ["x", 1], value: 4}400 ]401 )402})403perf: proxy assignaleclarsonbefore adoption53e9ce8
line 404why, one step back404describe("arrays - splice middle", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 405–413why, one step back405 runPatchTest(406 {x: [1, 2, 3]},407 d => {408 d.x.splice(1, 1)409 },410 [{op: "remove", path: ["x", 1]}]411 )412})413feat: improved array patchesIlyas Kabirovbefore adoptioncb5707f
line 414why, one step back414describe("arrays - multiple splice", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 415–429why, one step back415 runPatchTest(416 [0, 1, 2, 3, 4, 5, 0],417 d => {418 d.splice(4, 2, 3)419 d.splice(1, 2, 3)420 },421 [422 {op: "replace", path: [1], value: 3},423 {op: "replace", path: [2], value: 3},424 {op: "remove", path: [5]},425 {op: "remove", path: [4]}426 ]427 )428})429feat: improved array patchesIlyas Kabirovbefore adoptioncb5707f
line 430why, one step back430describe("arrays - modify and shrink", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 431–443why, one step back431 runPatchTest(432 {x: [1, 2, 3]},433 d => {434 d.x[0] = 4435 d.x.length = 2436 },437 [438 {op: "replace", path: ["x", 0], value: 4},439 {op: "replace", path: ["x", "length"], value: 2}440 ]441 )442})443perf: proxy assignaleclarsonbefore adoption53e9ce8
line 444why, one step back444describe("arrays - prepend then splice middle", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 445–457why, one step back445 runPatchTest(446 {x: [1, 2, 3]},447 d => {448 d.x.unshift(4)449 d.x.splice(2, 1)450 },451 [452 {op: "replace", path: ["x", 0], value: 4},453 {op: "replace", path: ["x", 1], value: 1}454 ]455 )456})457perf: proxy assignaleclarsonbefore adoption53e9ce8
line 458why, one step back458describe("arrays - splice middle then prepend", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 459–471why, one step back459 runPatchTest(460 {x: [1, 2, 3]},461 d => {462 d.x.splice(1, 1)463 d.x.unshift(4)464 },465 [466 {op: "replace", path: ["x", 0], value: 4},467 {op: "replace", path: ["x", 1], value: 1}468 ]469 )470})471perf: proxy assignaleclarsonbefore adoption53e9ce8
line 472why, one step back472describe("arrays - truncate", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 473–485why, one step back473 runPatchTest(474 {x: [1, 2, 3]},475 d => {476 d.x.length -= 2477 },478 [{op: "replace", path: ["x", "length"], value: 1}],479 [480 {op: "add", path: ["x", 1], value: 2},481 {op: "add", path: ["x", 2], value: 3}482 ]483 )484})485perf: proxy assignaleclarsonbefore adoption53e9ce8
line 486why, one step back486describe("arrays - pop twice", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 487–496why, one step back487 runPatchTest(488 {x: [1, 2, 3]},489 d => {490 d.x.pop()491 d.x.pop()492 },493 [{op: "replace", path: ["x", "length"], value: 1}]494 )495})496perf: proxy assignaleclarsonbefore adoption53e9ce8
line 497why, one step back497describe("arrays - push multiple", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 498–510why, one step back498 runPatchTest(499 {x: [1, 2, 3]},500 d => {501 d.x.push(4, 5)502 },503 [504 {op: "add", path: ["x", 3], value: 4},505 {op: "add", path: ["x", 4], value: 5}506 ],507 [{op: "replace", path: ["x", "length"], value: 3}]508 )509})510feat: improved array patchesIlyas Kabirovbefore adoptioncb5707f
line 511why, one step back511describe("arrays - splice (expand)", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 512–529why, one step back512 runPatchTest(513 {x: [1, 2, 3]},514 d => {515 d.x.splice(1, 1, 4, 5, 6)516 },517 [518 {op: "replace", path: ["x", 1], value: 4},519 {op: "add", path: ["x", 2], value: 5},520 {op: "add", path: ["x", 3], value: 6}521 ],522 [523 {op: "replace", path: ["x", 1], value: 2},524 {op: "remove", path: ["x", 3]},525 {op: "remove", path: ["x", 2]}526 ]527 )528})529feat: improved array patchesIlyas Kabirovbefore adoptioncb5707f
line 530why, one step back530describe("arrays - splice (shrink)", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 531–548why, one step back531 runPatchTest(532 {x: [1, 2, 3, 4, 5]},533 d => {534 d.x.splice(1, 3, 6)535 },536 [537 {op: "replace", path: ["x", 1], value: 6},538 {op: "remove", path: ["x", 3]},539 {op: "remove", path: ["x", 2]}540 ],541 [542 {op: "replace", path: ["x", 1], value: 2},543 {op: "add", path: ["x", 2], value: 3},544 {op: "add", path: ["x", 3], value: 4}545 ]546 )547})548feat: `Set` draftsAndrey Goncharovbefore adoption4355b63
line 549why, one step back549describe("sets - add - 1", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 550–559why, one step back550 runPatchTest(551 new Set([1]),552 d => {553 d.add(2)554 },555 [{op: "add", path: [1], value: 2}],556 [{op: "remove", path: [1], value: 2}]557 )558})559feat: `Set` draftsAndrey Goncharovbefore adoption4355b63
line 560why, one step back560describe("sets - add, delete, add - 1", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 561–572why, one step back561 runPatchTest(562 new Set([1]),563 d => {564 d.add(2)565 d.delete(2)566 d.add(2)567 },568 [{op: "add", path: [1], value: 2}],569 [{op: "remove", path: [1], value: 2}]570 )571})572feat: `Set` draftsAndrey Goncharovbefore adoption4355b63
line 573why, one step back573describe("sets - add, delete, add - 2", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 574–585why, one step back574 runPatchTest(575 new Set([2, 1]),576 d => {577 d.add(2)578 d.delete(2)579 d.add(2)580 },581 [],582 []583 )584})585feat: `Set` draftsAndrey Goncharovbefore adoption4355b63
line 586why, one step back586describe("sets - mutate - 1", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 587–614why, one step back587 const findById = (set, id) => {588 for (const item of set) {589 if (item.id === id) return item590 }591 }592 runPatchTest(593 new Set([{id: 1, val: "We"}, {id: 2, val: "will"}]),594 d => {595 const obj1 = findById(d, 1)596 const obj2 = findById(d, 2)597 obj1.val = "rock"598 obj2.val = "you"599 },600 [601 {op: "remove", path: [0], value: {id: 1, val: "We"}},602 {op: "remove", path: [1], value: {id: 2, val: "will"}},603 {op: "add", path: [0], value: {id: 1, val: "rock"}},604 {op: "add", path: [1], value: {id: 2, val: "you"}}605 ],606 [607 {op: "remove", path: [1], value: {id: 2, val: "you"}},608 {op: "remove", path: [0], value: {id: 1, val: "rock"}},609 {op: "add", path: [1], value: {id: 2, val: "will"}},610 {op: "add", path: [0], value: {id: 1, val: "We"}}611 ]612 )613})614perf: proxy assignaleclarsonbefore adoption53e9ce8
line 615why, one step back615describe("simple replacement", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 616–618why, one step back616 runPatchTest({x: 3}, _d => 4, [{op: "replace", path: [], value: 4}])617})618perf: proxy assignaleclarsonbefore adoption53e9ce8
line 619why, one step back619describe("same value replacement - 1", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 620–629why, one step back620 runPatchTest(621 {x: {y: 3}},622 d => {623 const a = d.x624 d.x = a625 },626 []627 )628})629perf: proxy assignaleclarsonbefore adoption53e9ce8
line 630why, one step back630describe("same value replacement - 2", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 631–641why, one step back631 runPatchTest(632 {x: {y: 3}},633 d => {634 const a = d.x635 d.x = 4636 d.x = a637 },638 []639 )640})641perf: proxy assignaleclarsonbefore adoption53e9ce8
line 642why, one step back642describe("same value replacement - 3", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 643–651why, one step back643 runPatchTest(644 {x: 3},645 d => {646 d.x = 3647 },648 []649 )650})651perf: proxy assignaleclarsonbefore adoption53e9ce8
line 652why, one step back652describe("same value replacement - 4", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 653–662why, one step back653 runPatchTest(654 {x: 3},655 d => {656 d.x = 4657 d.x = 3658 },659 []660 )661})662feat: `Map` drafts and patcheskeenondrumsbefore adoption30db0f3
line 663why, one step back663describe("same value replacement - 5", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 664–674why, one step back664 runPatchTest(665 new Map([["x", 3]]),666 d => {667 d.set("x", 4)668 d.set("x", 3)669 },670 [],671 []672 )673})674feat: `Set` draftsAndrey Goncharovbefore adoption4355b63
line 675why, one step back675describe("same value replacement - 6", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 676–686why, one step back676 runPatchTest(677 new Set(["x", 3]),678 d => {679 d.delete("x")680 d.add("x")681 },682 [],683 []684 )685})686perf: proxy assignaleclarsonbefore adoption53e9ce8
line 687why, one step back687describe("simple delete", () => {run prettier with master config before mergingMichel Weststratebefore adoptionae80361
lines 688–699why, one step back688 runPatchTest(689 {x: 2},690 d => {691 delete d.x692 },693 [694 {695 op: "remove",696 path: ["x"]697 }698 ]699 )perf: proxy assignaleclarsonbefore adoption53e9ce8
line 700why, one step back700})