forked from MapComplete/MapComplete
Merge: develop
This commit is contained in:
commit
9cffe6814e
154 changed files with 1199 additions and 41754 deletions
|
@ -244,8 +244,8 @@ export class And extends TagsFilter {
|
|||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < optimized.length; i++){
|
||||
const opt = optimized[i];
|
||||
for (let i = 0; i < optimized.length; i++) {
|
||||
const opt = optimized[i]
|
||||
if (opt instanceof Tag) {
|
||||
const k = opt.key
|
||||
const v = properties[k]
|
||||
|
@ -266,23 +266,24 @@ export class And extends TagsFilter {
|
|||
if (v === undefined) {
|
||||
continue
|
||||
}
|
||||
if(opt.invert){
|
||||
if (opt.invert) {
|
||||
// We should _not_ match this value
|
||||
// If 'v' is given, we already know what value it should be
|
||||
// If 'v' is the not-expected value, we have a conflict and return false
|
||||
// Otherwise, we can safely drop this value
|
||||
|
||||
const doesMatch = (typeof opt.value === "string" && v === opt.value) ||
|
||||
(v.match(<RegExp> opt.value) !== null)
|
||||
const doesMatch =
|
||||
(typeof opt.value === "string" && v === opt.value) ||
|
||||
v.match(<RegExp>opt.value) !== null
|
||||
|
||||
if(doesMatch){
|
||||
if (doesMatch) {
|
||||
// We have a conflict as 'opt' is inverted
|
||||
return false
|
||||
}else{
|
||||
} else {
|
||||
optimized.splice(i, 1)
|
||||
i--
|
||||
}
|
||||
}else if (v !== opt.value) {
|
||||
} else if (v !== opt.value) {
|
||||
// detected an internal conflict
|
||||
return false
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue