mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-05 18:48:41 +00:00
fix: make syntax extension comparison case insensitive and remove '.'
This commit is contained in:
@@ -70,7 +70,7 @@ export function extractError(resData: unknown): string | null {
|
|||||||
export function syntaxFromExtension(extension: string): string | null {
|
export function syntaxFromExtension(extension: string): string | null {
|
||||||
const ext = extension.startsWith('.') ? extension.slice(1) : extension;
|
const ext = extension.startsWith('.') ? extension.slice(1) : extension;
|
||||||
for (const [key, value] of Object.entries(syntaxes)) {
|
for (const [key, value] of Object.entries(syntaxes)) {
|
||||||
if (value.extension === `.${ext}`) {
|
if (value.extension.toLowerCase() === ext.toLowerCase()) {
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user