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

yiming-liao / logry / 15723642167

18 Jun 2025 04:06AM UTC coverage: 96.458% (-0.5%) from 96.994%
15723642167

push

github

yiming-liao
docs(readme): minor wording updates

456 of 481 branches covered (94.8%)

Branch coverage included in aggregate %.

4283 of 4432 relevant lines covered (96.64%)

3.08 hits per line

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

87.5
/src/modules/handler-manager/utils/is-handler-class.ts
1
import type { HandlerClass } from "@/modules/handler-manager/types";
1✔
2

1✔
3
/**
1✔
4
 * Checks if the given object is a HandlerClass.
1✔
5
 *
1✔
6
 * A HandlerClass is an object with a "handle" method.
1✔
7
 *
1✔
8
 * @param obj - The object to check.
1✔
9
 * @returns True if obj has a "handle" function, false otherwise.
1✔
10
 */
1✔
11
export const isHandlerClass = (obj: unknown): obj is HandlerClass => {
1✔
12
  // Return false if not an object or null
7✔
13
  if (typeof obj !== "object" || obj === null) {
7!
14
    return false;
×
15
  }
×
16

7✔
17
  // Type assertion for checking "handle" method existence
7✔
18
  const maybeHandler = obj as Record<string, unknown>;
7✔
19

7✔
20
  // Check if "handle" is a function
7✔
21
  return typeof maybeHandler.handle === "function";
7✔
22
};
7✔
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