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

yiming-liao / logry / 18441766080

12 Oct 2025 08:57AM UTC coverage: 95.92% (-0.3%) from 96.196%
18441766080

push

github

yiming-liao
chore(release): bump version to 1.2.3

434 of 498 branches covered (87.15%)

Branch coverage included in aggregate %.

3939 of 4061 relevant lines covered (97.0%)

3.66 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!
28
    return "";
×
29
  }
×
30

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

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

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