Better tracking of cached data, only load data if needed

This commit is contained in:
Pieter Vander Vennet 2021-09-30 04:13:23 +02:00
parent 32cbd6e2c1
commit 4f456e8a7f
13 changed files with 349 additions and 185 deletions

View file

@ -97,7 +97,7 @@ export default class SimpleMetaTagger {
continue;
}
for (const unit of units) {
if(unit === undefined){
if (unit === undefined) {
continue
}
if (unit.appliesToKeys === undefined) {
@ -108,7 +108,12 @@ export default class SimpleMetaTagger {
continue;
}
const value = feature.properties[key]
const [, denomination] = unit.findDenomination(value)
const denom = unit.findDenomination(value)
if (denom === undefined) {
// no valid value found
break;
}
const [, denomination] = denom;
let canonical = denomination?.canonicalValue(value) ?? undefined;
if (canonical === value) {
break;