fix: make asset names case-insensitive

This commit is contained in:
bangonicdd
2025-02-16 03:56:15 +09:00
parent 9773dc48a9
commit 7c3563679e

View File

@@ -303,11 +303,11 @@ async function replaceAsync(string, regexp, replacerFunction) {
} }
async function getAssetSrc(assetArr: string[][], name: string, assetPaths: {[key: string]:{path: string, ext?: string}}) { async function getAssetSrc(assetArr: string[][], name: string, assetPaths: {[key: string]:{path: string, ext?: string}}) {
name = name.toLocaleLowerCase() const lowerName = name.toLocaleLowerCase()
for (const asset of assetArr) { for (const asset of assetArr) {
if (trimmer(asset[0].toLocaleLowerCase()) !== trimmer(name)) continue if (trimmer(asset[0].toLocaleLowerCase()) !== trimmer(lowerName)) continue
const assetPath = await getFileSrc(asset[1]) const assetPath = await getFileSrc(asset[1])
assetPaths[asset[0].toLocaleLowerCase()] = { assetPaths[name] = {
path: assetPath, path: assetPath,
ext: asset[2] ext: asset[2]
} }