mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 13:38:26 +02:00
Convert lodah-es and d3 to named imports for validations
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import _ from 'lodash';
|
||||
import _isEmpty from 'lodash-es/isEmpty';
|
||||
|
||||
import { t } from '../util/locale';
|
||||
import { utilTagText } from '../util/index';
|
||||
|
||||
@@ -11,7 +12,7 @@ export function validationDeprecatedTag() {
|
||||
var change = changes.created[i],
|
||||
deprecatedTags = change.deprecatedTags();
|
||||
|
||||
if (!_.isEmpty(deprecatedTags)) {
|
||||
if (!_isEmpty(deprecatedTags)) {
|
||||
var tags = utilTagText({ tags: deprecatedTags });
|
||||
warnings.push({
|
||||
id: 'deprecated_tags',
|
||||
|
||||
@@ -3,7 +3,6 @@ import { t } from '../util/locale';
|
||||
|
||||
export function validationDisconnectedHighway() {
|
||||
|
||||
|
||||
function isDisconnectedHighway(entity, graph) {
|
||||
if (!entity.tags.highway) return false;
|
||||
if (entity.geometry(graph) !== 'line') return false;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { t } from '../util/locale';
|
||||
|
||||
|
||||
export function validationManyDeletions() {
|
||||
var threshold = 100;
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import _ from 'lodash';
|
||||
import _without from 'lodash-es/without';
|
||||
import { t } from '../util/locale';
|
||||
|
||||
|
||||
export function validationMissingTag() {
|
||||
|
||||
// Slightly stricter check than Entity#isUsed (#3091)
|
||||
function hasTags(entity, graph) {
|
||||
return _.without(Object.keys(entity.tags), 'area', 'name').length > 0 ||
|
||||
return _without(Object.keys(entity.tags), 'area', 'name').length > 0 ||
|
||||
graph.parentRelations(entity).length > 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import { osmIsSimpleMultipolygonOuterMember } from '../osm';
|
||||
|
||||
export function validationOldMultipolygon() {
|
||||
|
||||
|
||||
return function validation(changes, graph) {
|
||||
var warnings = [];
|
||||
for (var i = 0; i < changes.created.length; i++) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ from 'lodash';
|
||||
import _isEmpty from 'lodash-es/isEmpty';
|
||||
import { t } from '../util/locale';
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { t } from '../util/locale';
|
||||
export function validationTagSuggestsArea() {
|
||||
|
||||
function tagSuggestsArea(tags) {
|
||||
if (_.isEmpty(tags)) return false;
|
||||
if (_isEmpty(tags)) return false;
|
||||
|
||||
var presence = ['landuse', 'amenities', 'tourism', 'shop'];
|
||||
for (var i = 0; i < presence.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user