forked from MapComplete/MapComplete
Typing: make 'and' and 'or' in TagsFilter readonly
This commit is contained in:
parent
fbf5ce6fec
commit
e3a0a1dbcb
1 changed files with 3 additions and 3 deletions
|
@ -675,7 +675,7 @@ export class TagUtils {
|
|||
* TagUtils.containsEquivalents([new Tag("key","value")], [ new Tag("other_key","value")]) // => false
|
||||
* TagUtils.containsEquivalents([new Tag("key","value")], [ new Tag("key","other_value")]) // => false
|
||||
*/
|
||||
public static containsEquivalents(guards: TagsFilter[], listToFilter: TagsFilter[]): boolean {
|
||||
public static containsEquivalents(guards: ReadonlyArray<TagsFilter>, listToFilter: ReadonlyArray<TagsFilter>): boolean {
|
||||
return listToFilter.some((tf) => guards.some((guard) => guard.shadows(tf)))
|
||||
}
|
||||
|
||||
|
@ -731,7 +731,7 @@ export class TagUtils {
|
|||
}
|
||||
if (typeof json != "string") {
|
||||
if (json["and"] !== undefined && json["or"] !== undefined) {
|
||||
throw `${context}: Error while parsing a TagConfig: got an object where both 'and' and 'or' are defined. Did you override a value? Perhaps use \`"=parent": { ... }\` instead of \"parent": {...}\` to trigger a replacement and not a fuse of values. The value is ${JSON.stringify(
|
||||
throw `${context}: Error while parsing a TagConfig: got an object where both 'and' and 'or' are defined. Did you override a value? Perhaps use \`"=parent": { ... }\` instead of "parent": {...}\` to trigger a replacement and not a fuse of values. The value is ${JSON.stringify(
|
||||
json
|
||||
)}`
|
||||
}
|
||||
|
@ -925,7 +925,7 @@ export class TagUtils {
|
|||
return 0
|
||||
}
|
||||
|
||||
private static joinL(tfs: TagsFilter[], seperator: string, toplevel: boolean) {
|
||||
private static joinL(tfs: ReadonlyArray<TagsFilter>, seperator: string, toplevel: boolean) {
|
||||
const joined = tfs.map((e) => TagUtils.toString(e, false)).join(seperator)
|
||||
if (toplevel) {
|
||||
return joined
|
||||
|
|
Loading…
Reference in a new issue