feat: refactor cipher login data type for improved clarity

This commit is contained in:
shuaiplus
2026-05-18 02:13:01 +08:00
parent c50247b8fe
commit 04ebfc7021
+4 -2
View File
@@ -19,6 +19,8 @@ import {
import { readResponseBytesWithProgress } from '../download'; import { readResponseBytesWithProgress } from '../download';
import { loadVaultCoreSyncSnapshot } from './vault-sync'; import { loadVaultCoreSyncSnapshot } from './vault-sync';
type CipherLoginData = NonNullable<Cipher['login']>;
export async function getFolders(authedFetch: AuthedFetch, cacheKey: string): Promise<Folder[]> { export async function getFolders(authedFetch: AuthedFetch, cacheKey: string): Promise<Folder[]> {
const body = await loadVaultCoreSyncSnapshot(authedFetch, cacheKey); const body = await loadVaultCoreSyncSnapshot(authedFetch, cacheKey);
return body.folders || []; return body.folders || [];
@@ -737,8 +739,8 @@ async function repairCipherLoginUris(
return { return {
login: { login: {
...encryptedLogin, ...encryptedLogin,
uris: uris as Cipher['login']['uris'], uris: uris as CipherLoginData['uris'],
} as Cipher['login'], } as CipherLoginData,
changed, changed,
}; };
} }