Files
iD/modules/actions/delete_multiple.js
Peter Newman 4205ca1d07 Fix the seemingly safe spellings found by codespell
Untested, only checked by inspection.

(cherry picked from commit 2c47a11008)
2020-08-10 17:32:37 +01:00

27 lines
624 B
JavaScript

import { actionDeleteNode } from './delete_node';
import { actionDeleteRelation } from './delete_relation';
import { actionDeleteWay } from './delete_way';
export function actionDeleteMultiple(ids) {
var actions = {
way: actionDeleteWay,
node: actionDeleteNode,
relation: actionDeleteRelation
};
var action = function(graph) {
ids.forEach(function(id) {
if (graph.hasEntity(id)) { // It may have been deleted already.
graph = actions[graph.entity(id).type](id)(graph);
}
});
return graph;
};
return action;
}