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

yiming-liao / logry / 16290302677

15 Jul 2025 10:04AM UTC coverage: 96.831% (+0.7%) from 96.15%
16290302677

push

github

yiming-liao
fix(core/handler-manager): prevent duplicate handler IDs and expose internal maps

Avoids memory leaks by ensuring handler IDs are unique.
Exported loggerMap and coreMap to support internal testing.

443 of 492 branches covered (90.04%)

Branch coverage included in aggregate %.

13 of 15 new or added lines in 3 files covered. (86.67%)

22 existing lines in 5 files now uncovered.

3987 of 4083 relevant lines covered (97.65%)

4.82 hits per line

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

77.27
/src/modules/formatters/utils/resolve-scope-string.ts
1
import type { NormalizedScope, RawScope } from "@/shared/types/log-fields";
1✔
2

1✔
3
export type ResolveScopeStringOptions = {
1✔
4
  /** Full normalized scope string, e.g. "user.auth.login" */
1✔
5
  scope: NormalizedScope;
1✔
6
  /** Raw scope e.g. ["user","auth","login"] */
1✔
7
  rawScope: RawScope;
1✔
8
  /** Return only the last segment of the scope */
1✔
9
  showOnlyLatest?: boolean;
1✔
10
  /** Custom separator to join raw segments */
1✔
11
  customSeparator?: string;
1✔
12
};
1✔
13

1✔
14
/**
1✔
15
 * Resolve the final scope string based on formatting options.
1✔
16
 *
1✔
17
 * - If `showOnlyLatest` is true, returns the last segment.
1✔
18
 * - If `customSeparator` is provided, joins raw scope with it.
1✔
19
 * - Otherwise, returns the normalized scope string.
1✔
20
 */
1✔
21
export const resolveScopeString = ({
1✔
22
  scope,
2✔
23
  rawScope,
2✔
24
  showOnlyLatest = false,
2✔
25
  customSeparator,
2✔
26
}: ResolveScopeStringOptions): string => {
2✔
27
  if (!Array.isArray(rawScope) || rawScope.length === 0) {
2!
UNCOV
28
    return "";
×
UNCOV
29
  }
×
30

2✔
31
  if (showOnlyLatest) {
2!
UNCOV
32
    return rawScope[rawScope.length - 1];
×
UNCOV
33
  }
×
34

2✔
35
  if (customSeparator) {
2✔
36
    return rawScope.join(customSeparator);
2✔
37
  }
2✔
UNCOV
38

×
UNCOV
39
  return scope;
×
UNCOV
40
};
×
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