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

ialopezg / corejs / #5

03 Nov 2023 08:38PM UTC coverage: 42.153% (-47.5%) from 89.623%
#5

push

ialopezg
feat: add microservice feature

10 of 84 branches covered (0.0%)

Branch coverage included in aggregate %.

49 of 77 new or added lines in 20 files covered. (63.64%)

155 existing lines in 21 files now uncovered.

221 of 464 relevant lines covered (47.63%)

0.51 hits per line

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

83.33
/src/common/decorators/controller.decorator.ts
1
import 'reflect-metadata';
1✔
2

3
import { ControllerMetadata } from '../interfaces';
4
import { PATH_METADATA } from '../constants';
1✔
5
import { isUndefined } from '@ialopezg/commonjs';
1✔
6

7
const defaultMetadata = { [PATH_METADATA]: '/' };
1✔
8

9
/**
10
 * Provides the Controller functionality to the annotated class.
11
 *
12
 * The annotated object will act a global path handler for an
13
 * application resource or endpoint.
14
 *
15
 * @param {ControllerMetadata} metadata Controller feature definitions.
16
 *
17
 * @constructor
18
 */
19
export const Controller = (
1✔
20
  metadata: ControllerMetadata = defaultMetadata,
2✔
21
): ClassDecorator => {
22
  if (isUndefined(metadata[PATH_METADATA])) {
3!
NEW
23
    metadata[PATH_METADATA] = '/';
×
24
  }
25

26
  return (target) => {
3✔
27
    Reflect.defineMetadata(PATH_METADATA, metadata[PATH_METADATA], target);
3✔
28
  };
29
};
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