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

jumpinjackie / mapguide-react-layout / 15160437878

21 May 2025 11:00AM UTC coverage: 21.631% (-42.6%) from 64.24%
15160437878

Pull #1552

github

web-flow
Merge 8b7153d9e into 236e2ea07
Pull Request #1552: Feature/package updates 2505

839 of 1165 branches covered (72.02%)

11 of 151 new or added lines in 25 files covered. (7.28%)

1332 existing lines in 50 files now uncovered.

4794 of 22163 relevant lines covered (21.63%)

6.89 hits per line

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

3.45
/src/api/session-store.ts
1
import { strStartsWith } from '../utils/string';
1✔
2
import { QueryMapFeaturesResponse } from './contracts/query';
3
import { AsyncLazy } from './lazy';
4

5
/**
6
 * session-store.ts
7
 * 
8
 * A thin-wrapper layer over local storage for storing any data related to viewer sessions
9
 */
10

11
/**
12
 * @since 0.12
13
 */
UNCOV
14
export async function clearSessionStore(): Promise<void> {
×
15
    try {
×
16
        for (const key in window.localStorage) {
×
17
            if (strStartsWith(key, "selection_")) {
×
18
                window.localStorage.removeItem(key);
×
UNCOV
19
            }
×
UNCOV
20
        }
×
UNCOV
21
    } catch (e) {
×
22

UNCOV
23
    }
×
UNCOV
24
}
×
25

UNCOV
26
function encodeKey(sessionId: string, mapName: string) {
×
27
    return `selection_${sessionId}_${mapName}`;
×
UNCOV
28
}
×
29

UNCOV
30
export async function persistSelectionSetToLocalStorage(sessionId: string, mapName: string, resp: QueryMapFeaturesResponse): Promise<void> {
×
31
    const key = encodeKey(sessionId, mapName);
×
32
    const value = JSON.stringify(resp);
×
33
    try {
×
34
        window.localStorage.setItem(key, value);
×
UNCOV
35
    } catch (e) {
×
36

UNCOV
37
    }
×
UNCOV
38
}
×
39

UNCOV
40
export async function retrieveSelectionSetFromLocalStorage(sessionId: AsyncLazy<string>, mapName: string): Promise<QueryMapFeaturesResponse | undefined> {
×
41
    const key = encodeKey(await sessionId.getValueAsync(), mapName);
×
42
    const content = window.localStorage.getItem(key);
×
43
    if (content) {
×
44
        return JSON.parse(content);
×
UNCOV
45
    }
×
UNCOV
46
}
×
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