refactor: improve type safety, Svelte 5 reactivity, and API resilience

This commit is contained in:
Scott Idem
2026-01-16 17:29:33 -05:00
parent 09d1aa6720
commit ecb6ba5250
15 changed files with 6089 additions and 74 deletions

View File

@@ -96,7 +96,8 @@ export const split_iv_and_base64 = function split_iv_and_base64(combined: string
}
const [iv_hex, encrypted_base64_string] = combined.split(':');
const base64 = encrypted_base64_string;
const iv = new Uint8Array(iv_hex.match(/.{1,2}/g).map((byte) => parseInt(byte, 16)));
const match_result = iv_hex.match(/.{1,2}/g);
const iv = new Uint8Array((match_result || []).map((byte) => parseInt(byte, 16)));
if (log_lvl) {
console.log(`IV: ${iv}; Encrypted:`, base64);
}