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

Lumieducation / H5P-Nodejs-library / 0d8f1cd4-0ec4-49ce-875c-2d51ab440e1e

12 Jan 2025 06:42PM UTC coverage: 65.361% (+0.008%) from 65.353%
0d8f1cd4-0ec4-49ce-875c-2d51ab440e1e

push

circleci

web-flow
refactor: prettier v3 and respective code changes (#3860)

6212 of 10856 branches covered (57.22%)

Branch coverage included in aggregate %.

27 of 33 new or added lines in 9 files covered. (81.82%)

39 existing lines in 2 files now uncovered.

8657 of 11893 relevant lines covered (72.79%)

4535.74 hits per line

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

38.46
/packages/h5p-server/src/implementation/cache/CachedKeyValueStorage.ts
1
import { Cache, caching } from 'cache-manager';
12✔
2

3
import { IKeyValueStorage } from '../../types';
4

5
/**
6
 * Caches arbitrary key-value pairs.
7
 */
8
export default class CachedKeyValueStorage implements IKeyValueStorage {
12✔
9
    /**
10
     * @param cache the cache backend, if left undefined, an in-memory cache is
11
     * created.
12
     */
13
    constructor(
NEW
14
        private prefix: string,
×
NEW
15
        private cache?: Cache
×
16
    ) {
17
        if (!this.cache) {
×
18
            this.cache = caching({
×
19
                store: 'memory',
20
                ttl: 60 * 60 * 24,
21
                max: 2 ** 10
22
            });
23
        }
24
    }
25

26
    public async load(key: string): Promise<any> {
12✔
27
        return this.cache.get(`${this.prefix}-${key}`);
×
28
    }
29

30
    public async save(key: string, value: any): Promise<any> {
12✔
31
        return this.cache.set(`${this.prefix}-${key}`, value, { ttl: 0 });
×
32
    }
33
}
12✔
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

© 2026 Coveralls, Inc