forked from MapComplete/MapComplete
Refactoring: split 'Utils' into multiple files; fix some stray uppercase-method names
This commit is contained in:
parent
81be4db044
commit
3ec89826e4
97 changed files with 884 additions and 921 deletions
|
@ -34,6 +34,7 @@ import { ImmutableStore } from "../src/Logic/UIEventSource"
|
|||
import * as unitUsage from "../Docs/Schemas/UnitConfigJson.schema.json"
|
||||
import { ThemeConfigJson } from "../src/Models/ThemeConfig/Json/ThemeConfigJson"
|
||||
import { ServerSourceInfo, SourceOverview } from "../src/Models/SourceOverview"
|
||||
import { Lists } from "../src/Utils/Lists"
|
||||
|
||||
/**
|
||||
* Converts a markdown-file into a .json file, which a walkthrough/slideshow element can use
|
||||
|
@ -562,7 +563,7 @@ export class GenerateDocs extends Script {
|
|||
)
|
||||
)
|
||||
const serverInfos = Utils.DedupOnId(serverInfosDupl, (item) => item.url)
|
||||
const titles = Utils.Dedup(Utils.NoEmpty(serverInfos.map((s) => s.category)))
|
||||
const titles = Lists.dedup(Lists.noEmpty(serverInfos.map((s) => s.category)))
|
||||
titles.sort()
|
||||
|
||||
function getHost(item: ServerSourceInfo) {
|
||||
|
@ -597,7 +598,7 @@ export class GenerateDocs extends Script {
|
|||
md.push(items.length + " items")
|
||||
md.push(categoryExplanation[title])
|
||||
|
||||
const hosts = Utils.Dedup(items.map(getHost))
|
||||
const hosts = Lists.dedup(items.map(getHost))
|
||||
hosts.sort()
|
||||
if (title === "maplayer") {
|
||||
md.push(MarkdownUtils.list(hosts))
|
||||
|
@ -636,7 +637,7 @@ export class GenerateDocs extends Script {
|
|||
return [
|
||||
item.url,
|
||||
identicalDescription ? "" : item.description,
|
||||
Utils.NoEmpty([
|
||||
Lists.noEmpty([
|
||||
item.openData ? "OpenData" : "",
|
||||
sourceAvailable,
|
||||
selfHostable,
|
||||
|
@ -720,9 +721,7 @@ export class GenerateDocs extends Script {
|
|||
MarkdownUtils.list(
|
||||
Constants.priviliged_layers.map((id) => "[" + id + "](#" + id + ")")
|
||||
),
|
||||
...Utils.NoNull(
|
||||
Constants.priviliged_layers.map((id) => AllSharedLayers.sharedLayers.get(id))
|
||||
).map((l) =>
|
||||
...Lists.noNull(Constants.priviliged_layers.map((id) => AllSharedLayers.sharedLayers.get(id))).map((l) =>
|
||||
l.generateDocumentation({
|
||||
usedInThemes: themesPerLayer.get(l.id),
|
||||
layerIsNeededBy: layerIsNeededBy,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue