1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | import deleteFromArray from './deleteFromArray' // simplified version of TreeIndex for arrays class ArrayTree { add(path, val) { if (!this[path]) { this[path] = [] } this[path].push(val) } remove(path, val) { if (this[path]) { deleteFromArray(this[path], val) } } } export default ArrayTree |