Remove lodash isNaN, isNumber, isString, bind, uniqBy

(re: 6087)
This commit is contained in:
Bryan Housel
2019-03-27 23:11:08 -04:00
parent 6fb8fcb86b
commit 3896b2282f
12 changed files with 130 additions and 74 deletions
+6 -11
View File
@@ -1,6 +1,3 @@
import _invert from 'lodash-es/invert';
import _mapValues from 'lodash-es/mapValues';
import { event as d3_event } from 'd3-selection';
import { actionCopyEntities, actionMove } from '../actions';
@@ -32,7 +29,9 @@ export function behaviorPaste(context) {
context.perform(action);
var copies = action.copies();
var originals = _invert(_mapValues(copies, 'id'));
var originals = new Set();
Object.values(copies).forEach(function(entity) { originals.add(entity.id); });
for (var id in copies) {
var oldEntity = oldGraph.entity(id);
var newEntity = copies[id];
@@ -41,13 +40,9 @@ export function behaviorPaste(context) {
// Exclude child nodes from newIDs if their parent way was also copied.
var parents = context.graph().parentWays(newEntity);
var parentCopied = false;
for (var i = 0; i < parents.length; i++) {
if (originals[parents[i].id]) {
parentCopied = true;
break;
}
}
var parentCopied = parents.some(function(parent) {
return originals.has(parent.id);
});
if (!parentCopied) {
newIDs.push(newEntity.id);