mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
@@ -1,6 +1,6 @@
|
||||
import _isEqual from 'lodash-es/isEqual';
|
||||
|
||||
import deepEqual from 'fast-deep-equal';
|
||||
import { diff3Merge } from 'node-diff3';
|
||||
|
||||
import { t } from '../util/locale';
|
||||
import { actionDeleteMultiple } from './delete_multiple';
|
||||
import { osmEntity } from '../osm';
|
||||
@@ -37,7 +37,7 @@ export function actionMergeRemoteChanges(id, localGraph, remoteGraph, formatUser
|
||||
|
||||
|
||||
function mergeNodes(base, remote, target) {
|
||||
if (_option === 'force_local' || _isEqual(target.nodes, remote.nodes)) {
|
||||
if (_option === 'force_local' || deepEqual(target.nodes, remote.nodes)) {
|
||||
return target;
|
||||
}
|
||||
if (_option === 'force_remote') {
|
||||
@@ -59,9 +59,9 @@ export function actionMergeRemoteChanges(id, localGraph, remoteGraph, formatUser
|
||||
// for all conflicts, we can assume c.a !== c.b
|
||||
// because `diff3Merge` called with `true` option to exclude false conflicts..
|
||||
var c = hunk.conflict;
|
||||
if (_isEqual(c.o, c.a)) { // only changed remotely
|
||||
if (deepEqual(c.o, c.a)) { // only changed remotely
|
||||
nodes.push.apply(nodes, c.b);
|
||||
} else if (_isEqual(c.o, c.b)) { // only changed locally
|
||||
} else if (deepEqual(c.o, c.b)) { // only changed locally
|
||||
nodes.push.apply(nodes, c.a);
|
||||
} else { // changed both locally and remotely
|
||||
_conflicts.push(t('merge_remote_changes.conflict.nodelist', { user: user(remote.user) }));
|
||||
@@ -142,7 +142,7 @@ export function actionMergeRemoteChanges(id, localGraph, remoteGraph, formatUser
|
||||
|
||||
|
||||
function mergeMembers(remote, target) {
|
||||
if (_option === 'force_local' || _isEqual(target.members, remote.members)) {
|
||||
if (_option === 'force_local' || deepEqual(target.members, remote.members)) {
|
||||
return target;
|
||||
}
|
||||
if (_option === 'force_remote') {
|
||||
@@ -155,7 +155,7 @@ export function actionMergeRemoteChanges(id, localGraph, remoteGraph, formatUser
|
||||
|
||||
|
||||
function mergeTags(base, remote, target) {
|
||||
if (_option === 'force_local' || _isEqual(target.tags, remote.tags)) {
|
||||
if (_option === 'force_local' || deepEqual(target.tags, remote.tags)) {
|
||||
return target;
|
||||
}
|
||||
if (_option === 'force_remote') {
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import _isEqual from 'lodash-es/isEqual';
|
||||
|
||||
import {
|
||||
geoAngle, geoChooseEdge, geoPathIntersections, geoPathLength,
|
||||
geoVecAdd, geoVecEqual, geoVecInterp, geoVecSubtract
|
||||
@@ -330,7 +328,7 @@ export function actionMove(moveIDs, tryDelta, projection, cache) {
|
||||
var hits = geoPathIntersections(movedPath, unmovedPath);
|
||||
|
||||
for (var j = 0; i < hits.length; i++) {
|
||||
if (_isEqual(hits[j], end)) continue;
|
||||
if (geoVecEqual(hits[j], end)) continue;
|
||||
var edge = geoChooseEdge(unmovedNodes, end, projection);
|
||||
_delta = geoVecSubtract(projection(edge.loc), start);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _isEqual from 'lodash-es/isEqual';
|
||||
import deepEqual from 'fast-deep-equal';
|
||||
|
||||
import {
|
||||
interpolateNumber as d3_interpolateNumber,
|
||||
@@ -120,7 +120,7 @@ export function behaviorBreathe() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_isEqual(currSelected.data(), _selected.data()) || currClassed !== _classed) {
|
||||
if (!deepEqual(currSelected.data(), _selected.data()) || currClassed !== _classed) {
|
||||
_selected.call(reset);
|
||||
_classed = currClassed;
|
||||
_selected = currSelected.call(calcAnimationParams);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import _isEqual from 'lodash-es/isEqual';
|
||||
|
||||
import deepEqual from 'fast-deep-equal';
|
||||
import { utilArrayDifference } from '../util';
|
||||
|
||||
|
||||
@@ -26,12 +25,12 @@ export function coreDifference(base, head) {
|
||||
h.loc[0] !== b.loc[0] || h.loc[1] !== b.loc[1]) return true;
|
||||
}
|
||||
if (h.nodes || b.nodes) {
|
||||
if (!_isEqual(h.nodes, b.nodes)) return true;
|
||||
if (!deepEqual(h.nodes, b.nodes)) return true;
|
||||
}
|
||||
if (h.members || b.members) {
|
||||
if (!_isEqual(h.members, b.members)) return true;
|
||||
if (!deepEqual(h.members, b.members)) return true;
|
||||
}
|
||||
return !_isEqual(h.tags, b.tags);
|
||||
return !deepEqual(h.tags, b.tags);
|
||||
}
|
||||
|
||||
|
||||
@@ -151,8 +150,8 @@ export function coreDifference(base, head) {
|
||||
addEntity(change.base, base, 'deleted');
|
||||
|
||||
} else if (change.base && change.head) { // modified vertex
|
||||
var moved = !_isEqual(change.base.loc, change.head.loc);
|
||||
var retagged = !_isEqual(change.base.tags, change.head.tags);
|
||||
var moved = !deepEqual(change.base.loc, change.head.loc);
|
||||
var retagged = !deepEqual(change.base.tags, change.head.tags);
|
||||
|
||||
if (moved) {
|
||||
addParents(change.head);
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import _isEqual from 'lodash-es/isEqual';
|
||||
|
||||
import { dispatch as d3_dispatch } from 'd3-dispatch';
|
||||
import { request as d3_request } from 'd3-request';
|
||||
|
||||
import deepEqual from 'fast-deep-equal';
|
||||
import turf_bboxClip from '@turf/bbox-clip';
|
||||
import stringify from 'fast-json-stable-stringify';
|
||||
import martinez from 'martinez-polygon-clipping';
|
||||
@@ -46,7 +45,7 @@ function vtToGeoJSON(data, tile, mergeCache) {
|
||||
if (geometry.type === 'MultiPolygon') {
|
||||
var isClipped = false;
|
||||
var featureClip = turf_bboxClip(feature, tile.extent.rectangle());
|
||||
if (!_isEqual(feature.geometry, featureClip.geometry)) {
|
||||
if (!deepEqual(feature.geometry, featureClip.geometry)) {
|
||||
// feature = featureClip;
|
||||
isClipped = true;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import _isEqual from 'lodash-es/isEqual';
|
||||
|
||||
import { dispatch as d3_dispatch } from 'd3-dispatch';
|
||||
import { select as d3_select } from 'd3-selection';
|
||||
import deepEqual from 'fast-deep-equal';
|
||||
|
||||
import { t } from '../util/locale';
|
||||
import { osmChangeset } from '../osm';
|
||||
@@ -508,7 +507,7 @@ export function uiCommit(context) {
|
||||
delete tags.changesets_count;
|
||||
}
|
||||
|
||||
if (!_isEqual(_changeset.tags, tags)) {
|
||||
if (!deepEqual(_changeset.tags, tags)) {
|
||||
_changeset = _changeset.update({ tags: tags });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
import _isEqual from 'lodash-es/isEqual';
|
||||
|
||||
import { dispatch as d3_dispatch } from 'd3-dispatch';
|
||||
|
||||
import {
|
||||
event as d3_event,
|
||||
selectAll as d3_selectAll
|
||||
} from 'd3-selection';
|
||||
import {event as d3_event, selectAll as d3_selectAll } from 'd3-selection';
|
||||
import deepEqual from 'fast-deep-equal';
|
||||
|
||||
import { t, textDirection } from '../util/locale';
|
||||
import { tooltip } from '../util/tooltip';
|
||||
@@ -286,7 +281,7 @@ export function uiEntityEditor(context) {
|
||||
tags = utilCleanTags(tags);
|
||||
}
|
||||
|
||||
if (!_isEqual(entity.tags, tags)) {
|
||||
if (!deepEqual(entity.tags, tags)) {
|
||||
if (_coalesceChanges) {
|
||||
context.overwrite(actionChangeTags(_entityID, tags), annotation);
|
||||
} else {
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
"alif-toolkit": "^1.2.5",
|
||||
"browser-polyfills": "~1.5.0",
|
||||
"diacritics": "1.3.0",
|
||||
"fast-deep-equal": "~2.0.1",
|
||||
"fast-json-stable-stringify": "2.0.0",
|
||||
"lodash-es": "4.17.11",
|
||||
"marked": "0.6.1",
|
||||
|
||||
Reference in New Issue
Block a user