• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

AJGranowski / reddit-expanded-community-filter-userscript / 10765121853

09 Sep 2024 01:52AM UTC coverage: 90.951%. Remained the same
10765121853

push

github

web-flow
Bump rollup-plugin-userscript from 0.3.2 to 0.3.4 (#348)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

78 of 96 branches covered (81.25%)

Branch coverage included in aggregate %.

314 of 335 relevant lines covered (93.73%)

5.21 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/userscript/Storage.ts
1
enum STORAGE_KEY {
3✔
2
    DEBUG = "debug",
3✔
3
    TOTAL_MUTED_POSTS = "totalMutedPosts"
3✔
4
}
5

6
const DEFAULT_VALUES = {
3✔
7
    [STORAGE_KEY.DEBUG]: false as boolean,
8
    [STORAGE_KEY.TOTAL_MUTED_POSTS]: 0 as number
9
};
10

11
/**
12
 * Wrapper for GM_getValue and GM_setValue with strict checks on the key values.
13
 */
14
class Storage {
15
    get<K extends keyof typeof DEFAULT_VALUES>(key: K): typeof DEFAULT_VALUES[K] {
16
        return this.getValue(key, DEFAULT_VALUES[key]);
1✔
17
    }
18

19
    set<K extends keyof typeof DEFAULT_VALUES>(key: K, value: typeof DEFAULT_VALUES[K]): void {
20
        this.setValue(key, value);
1✔
21
    }
22

23
    /* istanbul ignore next */
24
    protected getValue<T>(name: string, defaultValue?: T): T {
25
        return GM_getValue(name, defaultValue);
26
    }
27

28
    /* istanbul ignore next */
29
    protected setValue(name: string, value: any): void {
30
        return GM_setValue(name, value);
31
    }
32
}
33

34
export { Storage, STORAGE_KEY };
3✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc