feat: enhance URI handling and TOTP field extraction in import functions

This commit is contained in:
shuaiplus
2026-04-25 16:35:35 +08:00
parent 15ee922777
commit 4a63c077f5
4 changed files with 126 additions and 27 deletions
+4
View File
@@ -563,9 +563,13 @@ async function encryptUris(
mac: Uint8Array
): Promise<Array<Record<string, unknown>>> {
const out: Array<Record<string, unknown>> = [];
const seen = new Set<string>();
for (const entry of uris || []) {
const trimmed = String(entry?.uri || '').trim();
if (!trimmed) continue;
const key = trimmed.toLowerCase();
if (seen.has(key)) continue;
seen.add(key);
const preservedExtra =
entry?.extra && typeof entry.extra === 'object'
? { ...entry.extra }