1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-19 13:41:19 +02:00

remove old, undocumented node-level mutating methods

This commit is contained in:
Ian Storm Taylor
2016-09-13 12:38:02 -07:00
parent 3ef82a3fbc
commit 5edbe3d9b7

View File

@@ -932,46 +932,6 @@ const Node = {
return !!this.getClosest(key, parent => parent.isVoid)
},
/**
* Insert child `nodes` after child by `key`.
*
* @param {String or Node} key
* @param {List} nodes
* @return {Node} node
*/
insertChildrenAfter(key, nodes) {
const child = this.assertChild(key)
const index = this.nodes.indexOf(child)
nodes = this.nodes
.slice(0, index + 1)
.concat(nodes)
.concat(this.nodes.slice(index + 1))
return this.merge({ nodes })
},
/**
* Insert child `nodes` before child by `key`.
*
* @param {String or Node} key
* @param {List} nodes
* @return {Node} node
*/
insertChildrenBefore(key, nodes) {
const child = this.assertChild(key)
const index = this.nodes.indexOf(child)
nodes = this.nodes
.slice(0, index)
.concat(nodes)
.concat(this.nodes.slice(index))
return this.merge({ nodes })
},
/**
* Insert a `node` at `index`.
*
@@ -1129,34 +1089,6 @@ const Node = {
return node
},
/**
* Remove children after a child by `key`.
*
* @param {String or Node} key
* @return {Node} node
*/
removeChildrenAfter(key) {
const child = this.assertChild(key)
const index = this.nodes.indexOf(child)
const nodes = this.nodes.slice(0, index + 1)
return this.merge({ nodes })
},
/**
* Remove children after a child by `key`, including the child.
*
* @param {String or Node} key
* @return {Node} node
*/
removeChildrenAfterIncluding(key) {
const child = this.assertChild(key)
const index = this.nodes.indexOf(child)
const nodes = this.nodes.slice(0, index)
return this.merge({ nodes })
},
/**
* Remove a `node` from the children node map.
*