Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function validationSuspiciousName() {
var type = 'suspicious_name';
// known list of generic names (e.g. "bar")
var discardNamesRegexes = filters.discardNames.map(function(discardName) {
return new RegExp(discardName, 'i');
});
var keysToTestForGenericValues = ['amenity', 'building', 'leisure', 'man_made', 'shop', 'tourism'];
function isDiscardedSuggestionName(lowercaseName) {
for (var i = 0; i < discardNamesRegexes.length; i++) {
if (discardNamesRegexes[i].test(lowercaseName)) {
return true;
}
}
return false;
}
// test if the name is just the key or tag value (e.g. "park")
function nameMatchesRawTag(lowercaseName, tags) {