MCPcopy Create free account
hub / github.com/ProtonDriveApps/sdk / parseInvitationUid

Function parseInvitationUid

cli/src/commands/sharing/invitations.ts:9–25  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

7}
8
9export function parseInvitationUid(input: string): {
10 isForPhotos: boolean;
11 uid: string;
12} {
13 if (input.startsWith('drive~')) {
14 return {
15 isForPhotos: false,
16 uid: input.slice('drive~'.length),
17 };
18 } else if (input.startsWith('photos~')) {
19 return {
20 isForPhotos: true,
21 uid: input.slice('photos~'.length),
22 };
23 }
24 throw new ValidationError(`Invalid invitation UID: ${input}`);
25}

Callers 2

actionMethod · 0.90
actionMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected