Skip to content

Commit

Permalink
chore: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Codetrauma committed Oct 9, 2024
1 parent 3bfbb6b commit 33cf958
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
6 changes: 4 additions & 2 deletions src/entries/Background/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ import { setStorage } from './db';
) {
const url = new URL(sender.tab.url);
const hostname = url.hostname;
const localStorage: { [key: string]: string } = request.storage.localStorage;
const sessionStorage: { [key: string]: string } = request.storage.sessionStorage;
const localStorage: { [key: string]: string } =
request.storage.localStorage;
const sessionStorage: { [key: string]: string } =
request.storage.sessionStorage;

for (const [key, value] of Object.entries(localStorage || {})) {
await setStorage(hostname, `localStorage:${key}`, value);
Expand Down
11 changes: 6 additions & 5 deletions src/utils/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ export const makePlugin = async (

const localStorageEntries: { [key: string]: string } = {};
for (const [key, value] of Object.entries(cache)) {
if (key.startsWith("localStorage")) {
localStorageEntries[key.replace("localStorage:", "")] = value;
if (key.startsWith('localStorage')) {
localStorageEntries[key.replace('localStorage:', '')] = value;
}
}
localStorage[host] = localStorageEntries;
Expand All @@ -267,14 +267,15 @@ export const makePlugin = async (
}

if (config?.sessionStorage) {
const sessionStorage: { [hostname: string]: { [key: string]: string } } = {};
const sessionStorage: { [hostname: string]: { [key: string]: string } } =
{};
for (const host of config.sessionStorage) {
const cache = await getStorageByHost(host);

const sessionStorageEntries: { [key: string]: string } = {};
for (const [key, value] of Object.entries(cache)) {
if (key.startsWith("sessionStorage")) {
sessionStorageEntries[key.replace("sessionStorage:", "")] = value;
if (key.startsWith('sessionStorage')) {
sessionStorageEntries[key.replace('sessionStorage:', '')] = value;
}
}
sessionStorage[host] = sessionStorageEntries;
Expand Down

0 comments on commit 33cf958

Please sign in to comment.