mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-24 00:54:03 +02:00
add ignore-list for presets which should not be checked for suspicious names
closes #10884
This commit is contained in:
@@ -11,6 +11,10 @@ export function validationSuspiciousName(context) {
|
||||
'aerialway', 'aeroway', 'amenity', 'building', 'craft', 'highway',
|
||||
'leisure', 'railway', 'man_made', 'office', 'shop', 'tourism', 'waterway'
|
||||
];
|
||||
const ignoredPresets = new Set([
|
||||
'amenity/place_of_worship/christian/jehovahs_witness',
|
||||
'__test__ignored_preset' // for unit tests
|
||||
]);
|
||||
let _waitingForNsi = false;
|
||||
|
||||
|
||||
@@ -48,6 +52,7 @@ export function validationSuspiciousName(context) {
|
||||
/** @param {string} name */
|
||||
function nameMatchesPresetName(name, preset) {
|
||||
if (!preset) return false;
|
||||
if (ignoredPresets.has(preset.id)) return false;
|
||||
|
||||
name = name.toLowerCase();
|
||||
return name === preset.name().toLowerCase() || preset.aliases().some(alias => name === alias.toLowerCase());
|
||||
|
||||
Reference in New Issue
Block a user