diff --git a/modules/actions/deprecate_tags.js b/modules/actions/deprecate_tags.js deleted file mode 100644 index 939b0132d..000000000 --- a/modules/actions/deprecate_tags.js +++ /dev/null @@ -1,45 +0,0 @@ -import _assign from 'lodash-es/assign'; -import _clone from 'lodash-es/clone'; -import _omit from 'lodash-es/omit'; -import _toPairs from 'lodash-es/toPairs'; - -import { dataDeprecated } from '../../data'; - - -export function actionDeprecateTags(entityId) { - - return function(graph) { - var entity = graph.entity(entityId), - newtags = _clone(entity.tags), - change = false, - rule; - - // This handles dataDeprecated tags with a single condition - for (var i = 0; i < dataDeprecated.length; i++) { - - rule = dataDeprecated[i]; - var match = _toPairs(rule.old)[0], - replacements = rule.replace ? _toPairs(rule.replace) : null; - - if (entity.tags[match[0]] && match[1] === '*') { - - var value = entity.tags[match[0]]; - if (replacements && !newtags[replacements[0][0]]) { - newtags[replacements[0][0]] = value; - } - delete newtags[match[0]]; - change = true; - - } else if (entity.tags[match[0]] === match[1]) { - newtags = _assign({}, rule.replace || {}, _omit(newtags, match[0])); - change = true; - } - } - - if (change) { - return graph.replace(entity.update({tags: newtags})); - } else { - return graph; - } - }; -} diff --git a/modules/actions/index.js b/modules/actions/index.js index 636802d0b..acb76f3ff 100644 --- a/modules/actions/index.js +++ b/modules/actions/index.js @@ -13,7 +13,6 @@ export { actionDeleteMultiple } from './delete_multiple'; export { actionDeleteNode } from './delete_node'; export { actionDeleteRelation } from './delete_relation'; export { actionDeleteWay } from './delete_way'; -export { actionDeprecateTags } from './deprecate_tags'; export { actionDiscardTags } from './discard_tags'; export { actionDisconnect } from './disconnect'; export { actionJoin } from './join';