Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
/umd
npm-debug.log*
/gh-pages
package-lock.json
package-lock.json
yarn-error.log
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"classnames": "^2.2.5",
"lodash": "^4.17.4",
"lodash.debounce": "^4.0.8",
"lodash.findindex": "^4.6.0",
"lodash.isequal": "^4.5.0",
"lodash.omit": "^4.5.0",
"material-icons": "^0.1.0",
Expand Down
5 changes: 3 additions & 2 deletions src/selectors/nodes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {createSelector} from 'reselect';
import omit from 'lodash.omit';
import findIndex from 'lodash.findindex';

import {UPDATE_TYPE} from '../contants';

Expand Down Expand Up @@ -47,7 +48,7 @@ export const replaceNodeFromTree = (nodes, updatedNode, operation = NODE_OPERATI
return NODE_CHANGE_OPERATIONS[operation](nodes, updatedNode);
}

const parentIndex = nodes.findIndex(n => n.id === parents[0]);
const parentIndex = findIndex(nodes, n => n.id === parents[0]);
const preSiblings = nodes.slice(0, parentIndex);
const postSiblings = nodes.slice(parentIndex + 1);

Expand Down Expand Up @@ -94,4 +95,4 @@ export const addNode = node => ({
type: UPDATE_TYPE.ADD,
});

export const getRowIndexFromId = (flattenedTree, id) => flattenedTree.findIndex(node => node.id === id);
export const getRowIndexFromId = (flattenedTree, id) => findIndex(flattenedTree, node => node.id === id);
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6191,6 +6191,11 @@ lodash.debounce@^4.0.8:
version "4.0.8"
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"

lodash.findindex@^4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/lodash.findindex/-/lodash.findindex-4.6.0.tgz#a3245dee61fb9b6e0624b535125624bb69c11106"
integrity sha1-oyRd7mH7m24GJLU1ElYku2nBEQY=

lodash.flattendeep@^4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2"
Expand Down