Refactoring of the climbing theme

This commit is contained in:
Pieter Vander Vennet 2022-04-23 15:20:54 +02:00
parent c36bce8100
commit bc953abe48
15 changed files with 1099 additions and 1001 deletions

View file

@ -161,7 +161,11 @@ export default class LayerConfig extends WithContextLoader {
this.calculatedTags = [];
for (const kv of json.calculatedTags) {
const index = kv.indexOf("=");
let key = kv.substring(0, index);
let key = kv.substring(0, index).trim();
const r = "[a-z_][a-z0-9:]*"
if(key.match(r) === null){
throw "At "+context+" invalid key for calculated tag: "+key+"; it should match "+r
}
const isStrict = key.endsWith(':')
if (isStrict) {
key = key.substr(0, key.length - 1)