refactoring: Fix generate:layeroverview

This commit is contained in:
Pieter Vander Vennet 2023-03-29 17:56:42 +02:00
parent 41e6a2c760
commit 9b2f92dedc
25 changed files with 194 additions and 216 deletions

View file

@ -4,7 +4,6 @@ import licenses from "../assets/generated/license_info.json"
import { LayoutConfigJson } from "../Models/ThemeConfig/Json/LayoutConfigJson"
import { LayerConfigJson } from "../Models/ThemeConfig/Json/LayerConfigJson"
import Constants from "../Models/Constants"
import * as fakedom from "fake-dom"
import {
DetectDuplicateFilters,
DoesImageExist,
@ -226,9 +225,6 @@ class LayerOverviewUtils {
}
main(args: string[]) {
if (fakedom === undefined) {
throw "Fakedom not initialized"
}
const forceReload = args.some((a) => a == "--force")
const licensePaths = new Set<string>()
@ -339,7 +335,7 @@ class LayerOverviewUtils {
const context = "While building builtin layer " + sharedLayerPath
const fixed = prepLayer.convertStrict(parsed, context)
if (fixed.source.osmTags["and"] === undefined) {
if (typeof fixed.source !== "string" && fixed.source.osmTags["and"] === undefined) {
fixed.source.osmTags = { and: [fixed.source.osmTags] }
}