forked from MapComplete/MapComplete
Chore: housekeeping, linting
This commit is contained in:
parent
f942529755
commit
30d00eb06d
74 changed files with 998 additions and 623 deletions
|
|
@ -52,7 +52,14 @@ export abstract class Conversion<TIn, TOut> {
|
|||
throw new Error(
|
||||
[
|
||||
"Detected one or more errors, stopping now:",
|
||||
context.getAll("error").map((e) => `${e.context.path.join(".")} (in operation: ${e.context.operation.join(".")}): ${e.message}`)
|
||||
context
|
||||
.getAll("error")
|
||||
.map(
|
||||
(e) =>
|
||||
`${e.context.path.join(
|
||||
"."
|
||||
)} (in operation: ${e.context.operation.join(".")}): ${e.message}`
|
||||
),
|
||||
].join("\n\t")
|
||||
)
|
||||
}
|
||||
|
|
@ -107,7 +114,10 @@ export class Bypass<T> extends DesugaringStep<T> {
|
|||
private readonly _step: DesugaringStep<T>
|
||||
|
||||
constructor(applyIf: (t: T) => boolean, step: DesugaringStep<T>) {
|
||||
super("Bypass(" + step.name + ")", "Applies the step on the object, if the object satisfies the predicate")
|
||||
super(
|
||||
"Bypass(" + step.name + ")",
|
||||
"Applies the step on the object, if the object satisfies the predicate"
|
||||
)
|
||||
this._applyIf = applyIf
|
||||
this._step = step
|
||||
}
|
||||
|
|
@ -161,10 +171,7 @@ export class On<P, T> extends DesugaringStep<T> {
|
|||
private readonly step: (t: T) => Conversion<P, P>
|
||||
|
||||
constructor(key: string, step: Conversion<P, P> | ((t: T) => Conversion<P, P>)) {
|
||||
super(
|
||||
`On(${key}, ${step.name})`,
|
||||
"Applies " + step.name + " onto property `" + key + "`",
|
||||
)
|
||||
super(`On(${key}, ${step.name})`, "Applies " + step.name + " onto property `" + key + "`")
|
||||
if (typeof step === "function") {
|
||||
this.step = step
|
||||
} else {
|
||||
|
|
@ -264,7 +271,7 @@ export class Fuse<T> extends DesugaringStep<T> {
|
|||
"Fuse",
|
||||
(doc ?? "") +
|
||||
"This fused pipeline of the following steps: " +
|
||||
steps.map((s) => s.name).join(", "),
|
||||
steps.map((s) => s.name).join(", ")
|
||||
)
|
||||
this.steps = Utils.NoNull(steps)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue