forked from MapComplete/MapComplete
Refactoring: simplify working with 'DoesImageExist'
This commit is contained in:
parent
47f52e4513
commit
54e1f5d44c
2 changed files with 21 additions and 19 deletions
|
|
@ -22,6 +22,7 @@ import PointRenderingConfigJson from "../Json/PointRenderingConfigJson"
|
|||
import { PrevalidateLayer } from "./PrevalidateLayer"
|
||||
import { AvailableRasterLayers } from "../../RasterLayers"
|
||||
import { eliCategory } from "../../RasterLayerProperties"
|
||||
import licenses from "../../../assets/generated/license_info.json"
|
||||
|
||||
export class ValidateLanguageCompleteness extends DesugaringStep<ThemeConfig> {
|
||||
private readonly _languages: string[]
|
||||
|
|
@ -126,6 +127,21 @@ export class DoesImageExist extends DesugaringStep<string> {
|
|||
}
|
||||
return image
|
||||
}
|
||||
|
||||
private static licensePaths: Set<string>
|
||||
|
||||
public static constructWithLicenses(checkExistsSync?: (path: string) => boolean, ignore?: Set<string>) {
|
||||
if (!DoesImageExist.licensePaths) {
|
||||
|
||||
const licensePaths = new Set<string>()
|
||||
for (const i in licenses) {
|
||||
licensePaths.add(licenses[i].path)
|
||||
}
|
||||
DoesImageExist.licensePaths = licensePaths
|
||||
}
|
||||
return new DoesImageExist(DoesImageExist.licensePaths, checkExistsSync, ignore)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class OverrideShadowingCheck extends DesugaringStep<ThemeConfigJson> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue