From 6c6fa089c736f493eb442ba56b92f6493cc179e2 Mon Sep 17 00:00:00 2001 From: duzhaoyang Date: Fri, 21 Sep 2018 14:02:38 +0800 Subject: [PATCH] getReorderPatch support patch of array --- test/keys.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/keys.js b/test/keys.js index 0790603e..a430c497 100644 --- a/test/keys.js +++ b/test/keys.js @@ -792,7 +792,12 @@ function getReorderPatch(patches) { for (var key in patches) { if (key !== "a" && patches.hasOwnProperty(key)) { var patch = patches[key] - if (patch.type === VPatch.ORDER) { + if (Array.isArray(patch)) { + var orderPathes = patch.filter(p => p.type === VPatch.ORDER) + if (orderPathes.length >= 1) { + return orderPathes[0] + } + } else if (patch.type === VPatch.ORDER) { return patch } }