MCPcopy Index your code
hub / github.com/darkreader/darkreader / migrateAutomationSettings

Method migrateAutomationSettings

src/background/user-storage.ts:48–67  ·  view source on GitHub ↗
(settings: UserSettings)

Source from the content-addressed store, hash-verified

46 // and not something we can encounter for, except for doing always two extra requests to explicitly
47 // check for this case which is inefficient usage of requesting storage.
48 private static migrateAutomationSettings(settings: UserSettings): void {
49 if (typeof settings.automation === 'string') {
50 const automationMode = settings.automation;
51 const automationBehavior: UserSettings['automation']['behavior'] = (settings as any).automationBehaviour;
52 if (settings.automation === '') {
53 settings.automation = {
54 enabled: false,
55 mode: automationMode,
56 behavior: automationBehavior,
57 };
58 } else {
59 settings.automation = {
60 enabled: true,
61 mode: automationMode,
62 behavior: automationBehavior,
63 };
64 }
65 delete (settings as any).automationBehaviour;
66 }
67 }
68
69 private static migrateSiteListsV2(deprecated: any): Partial<UserSettings> {
70 const settings: Partial<UserSettings> = {};

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected