migrate importing transaction dialog to composition API and typescript

This commit is contained in:
MaysWind
2025-02-04 01:29:11 +08:00
parent 61c5f75006
commit 376f5b2650
8 changed files with 1540 additions and 1364 deletions
+16
View File
@@ -1,3 +1,5 @@
import type { ImportFileTypeAndExtensions } from '@/core/file.ts';
import { isString } from './common.ts';
export function getFileExtension(filename: string): string {
@@ -9,6 +11,20 @@ export function getFileExtension(filename: string): string {
return parts[parts.length - 1];
}
export function findExtensionByType(items: ImportFileTypeAndExtensions[] | undefined, type: string): string | undefined {
if (!items || items.length < 1) {
return undefined;
}
for (const item of items) {
if (item.type === type) {
return item.extensions;
}
}
return undefined;
}
export function isFileExtensionSupported(filename: string, supportedExtensions: string): boolean {
if (!supportedExtensions) {
return false;