Skip to content

Commit 378dca5

Browse files
committed
refactor: few minor tweaks
1 parent 58fff01 commit 378dca5

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

.gitattributes

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
package-lock.json linguist-generated
2-
pnpm-lock.yaml linguist-generated
1+
# https://git-scm.com/docs/gitattributes
2+
# https://git-scm.com/book/en/Customizing-Git-Git-Attributes
3+
* text=auto
4+
5+
# https://docs.github.com/en/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github
6+
# https://github.com/github-linguist/linguist/blob/master/docs/overrides.md
37
public linguist-generated

src/ext/content-scripts/api.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ async function getValue(key, defaultValue) {
2121
}
2222
const prefixedKey = `${sid}---${key}`;
2323
const results = await browser.storage.local.get(prefixedKey);
24-
return results[prefixedKey] ?? defaultValue ?? undefined;
24+
if (prefixedKey in results) return results[prefixedKey];
25+
if (defaultValue !== undefined) return defaultValue;
26+
return undefined;
2527
}
2628

2729
async function deleteValue(key) {

0 commit comments

Comments
 (0)