vuex-undo-redo icon indicating copy to clipboard operation
vuex-undo-redo copied to clipboard

Fix redo/undo bug. Now checks if object is Array before Object.assign

Open huberf opened this issue 5 years ago • 0 comments

Ran into this bug while using the plugin. If a Vuex mutator is called with an Array (e.g. ["a", "b", "c"]) on undo/redo it will pass in an object with keys of the index (e.g. {0: "a", 1: "b", 2: "c"}). This PR fixes that by checking if the object is an Array and if so, it effectively calls Object.assign([], obj) instead of Object.assign({}, obj).

Let me know if there are any stylistic compatibility issues I should fix.

huberf avatar Jun 26 '19 18:06 huberf