From be5ccaf0c1a558d6038a81d9d32d0038e5017290 Mon Sep 17 00:00:00 2001 From: Bauke Date: Sat, 12 Aug 2023 11:16:55 +0200 Subject: [PATCH] Explicitly use the AnonymizeUsernamesData type for Value. --- source/storage/exports.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/storage/exports.ts b/source/storage/exports.ts index 131075c..e54db1b 100644 --- a/source/storage/exports.ts +++ b/source/storage/exports.ts @@ -1,6 +1,9 @@ import {createValue, type Value} from "@holllo/webextension-storage"; import browser from "webextension-polyfill"; -import {type AnonymizeUsernamesData} from "./anonymize-usernames.js"; +import { + type AnonymizeUsernamesData, + ReplacementType, +} from "./anonymize-usernames.js"; import {Data, Feature, MiscellaneousFeature} from "./enums.js"; import {collectHideTopicsData} from "./hide-topics.js"; import {defaultKnownGroups} from "./known-groups.js"; @@ -75,12 +78,12 @@ export const storageValues = { value: false, storage: browser.storage.sync, }), - [Feature.AnonymizeUsernames]: createValue({ + [Feature.AnonymizeUsernames]: createValue({ deserialize: (input) => JSON.parse(input) as AnonymizeUsernamesData, serialize: (input) => JSON.stringify(input), key: Feature.AnonymizeUsernames, value: { - replacementType: "numerical", + replacementType: ReplacementType.Numerical, }, storage: browser.storage.sync, }),