mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-22 09:37:17 +00:00
Try to handle windows/linux slashes
This commit is contained in:
parent
95401d1b51
commit
4a79701587
1 changed files with 3 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import JSZip, { JSZipObject } from "jszip";
|
||||
import JSZip, { file, JSZipObject } from "jszip";
|
||||
|
||||
export function assert(condition: boolean, message: string) {
|
||||
if (!condition) {
|
||||
|
|
@ -18,7 +18,8 @@ export function getCaseInsensitiveFile(
|
|||
zip: JSZip,
|
||||
filePath: string
|
||||
): JSZipObject | null {
|
||||
return zip.file(new RegExp(filePath, "i"))[0] ?? null;
|
||||
const normalized = filePath.replace(/[\/\\]/g, `[/\\\\]`);
|
||||
return zip.file(new RegExp(normalized, "i"))[0] ?? null;
|
||||
}
|
||||
|
||||
export function num(str: string | void): number | null {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue