Passed
Pull Request — master (#406)
by
unknown
02:02 queued 14s
created

server/src/Infrastructure/Common/ExtendedRouting/WithName.ts   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 13
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 1
mnd 0
bc 0
fnc 1
bpm 0
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A WithName.ts ➔ WithName 0 9 1
1
export const ROUTE_NAME_METADATA = '__route_name__';
2
3
export function WithName(routeName: string | Symbol): MethodDecorator {
4
  return (
5
    _target: object,
6
    _key: string | symbol,
7
    descriptor: TypedPropertyDescriptor<any>
8
  ) => {
9
    Reflect.defineMetadata(ROUTE_NAME_METADATA, routeName, descriptor.value);
10
    return descriptor;
11
  };
12
}
13