From ddf730356b498a2ab43fe768ad64e47901f87c99 Mon Sep 17 00:00:00 2001 From: Soreine Date: Wed, 9 Nov 2016 18:02:18 +0100 Subject: [PATCH] more readable code --- src/models/node.js | 2 +- src/transforms/operations.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/models/node.js b/src/models/node.js index 1585ce957..9925b9d8d 100644 --- a/src/models/node.js +++ b/src/models/node.js @@ -1110,7 +1110,7 @@ const Node = { }) } - const nodes = this.nodes.splice(index, 0, node) + const nodes = this.nodes.insert(index, node) return this.merge({ nodes }) }, diff --git a/src/transforms/operations.js b/src/transforms/operations.js index 3a49f5e40..0367deb81 100644 --- a/src/transforms/operations.js +++ b/src/transforms/operations.js @@ -216,7 +216,7 @@ export function removeNodeOperation(transform, path) { const { document } = state const node = document.assertPath(path) const inversePath = path.slice(0, -1) - const inverseIndex = path.slice(-1) + const inverseIndex = path[path.length - 1] const inverse = [{ type: 'insert_node',