Refactoring: change order of parameters and remove parameter for Conversion.ts

This commit is contained in:
Pieter Vander Vennet 2025-05-16 15:48:55 +02:00
parent 49fc8e4bcf
commit 72e06448fc
20 changed files with 147 additions and 213 deletions

View file

@ -27,7 +27,7 @@ export class PrevalidateLayer extends DesugaringStep<LayerConfigJson> {
doesImageExist: DoesImageExist,
studioValidations: boolean
) {
super("Runs various checks against common mistakes for a layer", [], "PrevalidateLayer")
super("PrevalidateLayer", "Runs various checks against common mistakes for a layer")
this._path = path
this._isBuiltin = isBuiltin
this._doesImageExist = doesImageExist
@ -57,6 +57,7 @@ export class PrevalidateLayer extends DesugaringStep<LayerConfigJson> {
}
} else {
if (json.source === "special" || json.source === "special:library") {
// pass
} else if (json.source && json.source["osmTags"] === undefined) {
context
.enters("source", "osmTags")
@ -232,11 +233,6 @@ export class PrevalidateLayer extends DesugaringStep<LayerConfigJson> {
}
}
try {
} catch (e) {
context.err("Could not validate layer due to: " + e + e.stack)
}
if (this._studioValidations) {
if (!json.description) {
context.enter("description").err("A description is required")
@ -358,7 +354,7 @@ export class PrevalidateLayer extends DesugaringStep<LayerConfigJson> {
if (pointRendering.marker === undefined) {
continue
}
for (const icon of pointRendering?.marker) {
for (const icon of pointRendering?.marker ?? []) {
const indexM = pointRendering?.marker.indexOf(icon)
if (!icon.icon) {
continue