Merge branch 'MAILWEB-6067-improve-circular-dependencies-prevention' into 'main'
[ProtonMail-WebClient.git] / packages / drive-store / lib / _nodes / utils.ts
blobda317e2781485f84bcca77dd6bbf7e489e1d08fd
1 import type { DecryptedLink } from '../../store';
2 import type { DecryptedNode } from './interface';
4 /**
5  * Converts a Drive store object to a DecryptedNode.
6  */
7 export const decryptedLinkToNode = (link: DecryptedLink, volumeId?: string): DecryptedNode => {
8     return {
9         volumeId: volumeId || link.volumeId,
10         nodeId: link.linkId,
11         parentNodeId: link.parentLinkId,
13         name: link.name,
14         hash: link.hash,
15         createTime: link.createTime,
16         mimeType: link.mimeType,
17         signatureAddress: link.signatureAddress,
18         nameSignatureAddress: link.nameSignatureAddress,
19         isCorruptedNode: link.corruptedLink,
20         trashed: link.trashed,
21         trashedByParent: link.trashedByParent,
22     } satisfies DecryptedNode;