Chore: small cleanups, formatting

This commit is contained in:
Pieter Vander Vennet 2025-01-11 02:39:08 +01:00
parent dce838b130
commit 35cbaa7c33
7 changed files with 24 additions and 43 deletions

View file

@ -32,7 +32,7 @@ export abstract class Conversion<TIn, TOut> {
this.name = name
}
public convertStrict(json: TIn, context?: ConversionContext): TOut {
public convertStrict(json: NonNullable<TIn>, context?: ConversionContext): TOut {
context ??= ConversionContext.construct([], [])
context = context.inOperation(this.name)
@ -276,7 +276,7 @@ export class Fuse<T> extends DesugaringStep<T> {
"This fused pipeline of the following steps: " +
steps.map((s) => s.name).join(", "),
Utils.Dedup([].concat(...steps.map((step) => step.modifiedAttributes))),
"Fuse(" + steps.map((s) => s.name).join(", ") + ")"
"Fuse"
)
this.steps = Utils.NoNull(steps)
}

View file

@ -1000,4 +1000,11 @@ export class PrepareLayer extends Fuse<LayerConfigJson> {
new PruneFilters()
)
}
convert(json: LayerConfigJson, context: ConversionContext): LayerConfigJson {
if(json === undefined || json === null){
throw "Error: prepareLayer got null"
}
return super.convert(json, context)
}
}

View file

@ -472,7 +472,7 @@ class PreparePersonalTheme extends DesugaringStep<ThemeConfigJson> {
class WarnForUnsubstitutedLayersInTheme extends DesugaringStep<ThemeConfigJson> {
constructor() {
super(
"Generates a warning if a theme uses an unsubstituted layer",
"Generates a warning if a theme uses an inline layer; we recommend splitting of all layers in separate files",
["layers"],
"WarnForUnsubstitutedLayersInTheme"
)