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

snatalenko / node-cqrs / 21877149956

10 Feb 2026 06:20PM UTC coverage: 85.292% (-9.1%) from 94.396%
21877149956

Pull #28

github

web-flow
Merge 1d0a1ad0d into 828e39903
Pull Request #28: TypeScript and event dispatching pipeline refactoring

673 of 1010 branches covered (66.63%)

935 of 1061 new or added lines in 68 files covered. (88.12%)

49 existing lines in 13 files now uncovered.

1270 of 1489 relevant lines covered (85.29%)

33.79 hits per line

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

81.82
/src/utils/getHandler.ts
1
import type { IMessageHandler } from '../interfaces/index.ts';
2

3
/**
4
 * Gets a handler for a specific message type, prefers a public (w\o _ prefix) method, if available
5
 */
6
export function getHandler(context: { [key: string]: any }, messageType: string): IMessageHandler | null {
44✔
7
        if (!context || typeof context !== 'object')
620!
UNCOV
8
                throw new TypeError('context argument required');
×
9
        if (typeof messageType !== 'string' || !messageType.length)
620✔
UNCOV
10
                throw new TypeError('messageType argument must be a non-empty string');
×
11

12
        if (messageType in context && typeof context[messageType] === 'function')
620✔
13
                return context[messageType];
486✔
14

15
        const privateHandlerName = `_${messageType}`;
134✔
16
        if (privateHandlerName in context && typeof context[privateHandlerName] === 'function')
134✔
17
                return context[privateHandlerName];
80✔
18

19
        return null;
54✔
20
}
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