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

yiming-liao / logry / 15999984610

01 Jul 2025 12:57PM UTC coverage: 92.796% (-0.4%) from 93.154%
15999984610

push

github

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

447 of 501 branches covered (89.22%)

Branch coverage included in aggregate %.

4190 of 4496 relevant lines covered (93.19%)

4.66 hits per line

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

77.42
/src/modules/normalizers/utils/try-custom-normalizer.ts
1
import { internalError } from "@/internal";
1✔
2

1✔
3
type TryCustomNormalizerOptions<Input, Result> = {
1✔
4
  label: string;
1✔
5
  input: Input;
1✔
6
  customNormalizer?: (input: Input) => Result;
1✔
7
};
1✔
8

1✔
9
/**
1✔
10
 * Safely executes a custom normalizer if provided.
1✔
11
 *
1✔
12
 * @param label - Label for error reporting.
1✔
13
 * @param input - Input to pass into the custom normalizer.
1✔
14
 * @param customNormalizer - Optional custom normalizer function.
1✔
15
 * @returns Result of the custom normalizer or undefined on failure.
1✔
16
 */
1✔
17
export const tryCustomNormalizer = <Input, Result>({
1✔
18
  label,
40✔
19
  input,
40✔
20
  customNormalizer,
40✔
21
}: TryCustomNormalizerOptions<Input, Result>): Result | undefined => {
40✔
22
  if (typeof customNormalizer === "function") {
40!
23
    try {
×
24
      return customNormalizer(input);
×
25
    } catch (error) {
×
26
      internalError({ error, message: `custom ${label} normalizer failed.` });
×
27
    }
×
28
  }
×
29
};
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