kopia lustrzana https://github.com/FacilMap/facilmap
Fix type errors
rodzic
082fa4379c
commit
d7f3524d91
|
@ -24,11 +24,11 @@
|
|||
const itemIconRefs = reactive(new Map<string, HTMLElement>());
|
||||
|
||||
const legend1Html = computed(() => {
|
||||
return props.legend1 ? markdownBlock(props.legend1) : "";
|
||||
return props.legend1 ? markdownBlock(props.legend1, true) : "";
|
||||
});
|
||||
|
||||
const legend2Html = computed(() => {
|
||||
return props.legend2 ? markdownBlock(props.legend2) : "";
|
||||
return props.legend2 ? markdownBlock(props.legend2, true) : "";
|
||||
});
|
||||
|
||||
function toggleFilter(typeInfo: LegendType, item?: LegendItem): void {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import fetch from "node-fetch";
|
||||
import * as yauzl from "yauzl-promise";
|
||||
import * as svgo from "svgo";
|
||||
import cheerio from "cheerio";
|
||||
import { load, type Element } from "cheerio";
|
||||
import { writeFile } from "fs/promises";
|
||||
import { fileURLToPath } from "url";
|
||||
import { Readable } from "stream";
|
||||
|
@ -30,11 +30,11 @@ async function updateIcons() {
|
|||
function cleanIcon(icon: string): string {
|
||||
const optimized = svgo.optimize(icon);
|
||||
|
||||
const $ = cheerio.load(optimized.data, {
|
||||
const $ = load(optimized.data, {
|
||||
xmlMode: true
|
||||
});
|
||||
|
||||
for (const el of $("*").toArray() as cheerio.TagElement[]) {
|
||||
for (const el of $("*").toArray() as Element[]) {
|
||||
el.name = el.name.replace(/^svg:/, "");
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ export default defineConfig({
|
|||
formats: ['es']
|
||||
},
|
||||
rollupOptions: {
|
||||
external: (id) => !id.startsWith("./") && !id.startsWith("../") && /* resolved internal modules */ !id.startsWith("/")
|
||||
external: (id) => id.includes("/node_modules/") || (!id.startsWith("./") && !id.startsWith("../") && /* resolved internal modules */ !id.startsWith("/"))
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Ładowanie…
Reference in New Issue