Merge master

This commit is contained in:
Pieter Vander Vennet 2024-08-09 17:02:59 +02:00
commit 51fa48a01f
151 changed files with 16260 additions and 1872 deletions

View file

@ -160,7 +160,7 @@ export default class Constants {
"teardrop",
"teardrop_with_hole_green",
"triangle",
"wifi"
"wifi",
] as const
public static readonly defaultPinIcons: string[] = <any>Constants._defaultPinIcons
/**

View file

@ -1100,7 +1100,10 @@ class MiscTagRenderingChecks extends DesugaringStep<TagRenderingConfigJson> {
continue
}
if (txt.indexOf(json.freeform.key) >= 0 && txt.indexOf("{" + json.freeform.key + "}") < 0) {
if (
txt.indexOf(json.freeform.key) >= 0 &&
txt.indexOf("{" + json.freeform.key + "}") < 0
) {
context
.enter("render")
.err(
@ -1109,7 +1112,6 @@ class MiscTagRenderingChecks extends DesugaringStep<TagRenderingConfigJson> {
continue
}
context
.enter("render")
.err(

View file

@ -366,18 +366,16 @@ export default class TagRenderingConfig {
throw `${ctx}: Invalid mapping: "if" is defined as an array. Use {"and": <your conditions>} or {"or": <your conditions>} instead`
}
if(mapping.addExtraTags !== undefined && !Array.isArray(mapping.addExtraTags)){
if (mapping.addExtraTags !== undefined && !Array.isArray(mapping.addExtraTags)) {
throw `${ctx}.addExtraTags: expected a list, but got a ${typeof mapping.addExtraTags}`
}
if (mapping.addExtraTags !== undefined && multiAnswer) {
const usedKeys = mapping.addExtraTags?.flatMap(et => TagUtils.Tag(et).usedKeys())
if(usedKeys.some(key => TagUtils.Tag(mapping.if).usedKeys().indexOf(key ) > 0)){
const usedKeys = mapping.addExtraTags?.flatMap((et) => TagUtils.Tag(et).usedKeys())
if (usedKeys.some((key) => TagUtils.Tag(mapping.if).usedKeys().indexOf(key) > 0)) {
throw `${ctx}: Invalid mapping: got a multi-Answer with addExtraTags which also modifies one of the keys; this is not allowed`
}
}
let hideInAnswer: boolean | TagsFilter = false
if (typeof mapping.hideInAnswer === "boolean") {
hideInAnswer = mapping.hideInAnswer