1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-10-18 07:25:15 +02:00
bitwarden-browser/apps/browser/src/platform/storage/port-name.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
332 B
TypeScript
Raw Normal View History

export function portName(storageLocation: chrome.storage.StorageArea) {
switch (storageLocation) {
case chrome.storage.local:
return "local";
case chrome.storage.sync:
return "sync";
case chrome.storage.session:
return "session";
default:
throw new Error("Unknown storage location");
}
}