Provided diagnosis is correct had issues because of an improper falsy check (which is why given the choice, I prefere strictly typed languages)
All checks were successful
Publish to Private NPM Registry / publish (push) Successful in 32s
All checks were successful
Publish to Private NPM Registry / publish (push) Successful in 32s
This commit is contained in:
parent
5fe7028949
commit
be000be1a0
1 changed files with 4 additions and 4 deletions
|
|
@ -104,7 +104,7 @@ export function Controller<T extends { new (...args: any[]): BaseController }>(b
|
|||
// Loop over all the methods in the decorated class looking for methods that use the GET decorator
|
||||
Object.getOwnPropertyNames(target.prototype)
|
||||
// Find all methods that have a Get metadata key (GET decorator)
|
||||
.filter((method) => Reflect.getMetadata(GET_METADATA_KEY, target.prototype, method))
|
||||
.filter((method) => typeof Reflect.getMetadata(GET_METADATA_KEY, target.prototype, method) !== 'undefined')
|
||||
.map((method) => {
|
||||
// Get the method
|
||||
let fn = target.prototype[method];
|
||||
|
|
@ -165,7 +165,7 @@ export function Controller<T extends { new (...args: any[]): BaseController }>(b
|
|||
// Loop over all the methods in the decorated class looking for methods that use the POST decorator
|
||||
Object.getOwnPropertyNames(target.prototype)
|
||||
// Find all methods that have a Post metadata key (POST decorator)
|
||||
.filter((method) => Reflect.getMetadata(POST_METADATA_KEY, target.prototype, method))
|
||||
.filter((method) => typeof Reflect.getMetadata(POST_METADATA_KEY, target.prototype, method) !== 'undefined')
|
||||
.map((method) => {
|
||||
// Get the method
|
||||
const fn = target.prototype[method];
|
||||
|
|
@ -217,7 +217,7 @@ export function Controller<T extends { new (...args: any[]): BaseController }>(b
|
|||
// Loop over all the methods in the decorated class looking for methods that use the `@PUT` decorator
|
||||
Object.getOwnPropertyNames(target.prototype)
|
||||
// Find all methods that have the associated metadata key (`@PUT` decorator)
|
||||
.filter((method) => Reflect.getMetadata(PUT_METADATA_KEY, target.prototype, method))
|
||||
.filter((method) => typeof Reflect.getMetadata(PUT_METADATA_KEY, target.prototype, method) !== 'undefined')
|
||||
.map((method) => {
|
||||
// Get the method
|
||||
const fn = target.prototype[method];
|
||||
|
|
@ -264,7 +264,7 @@ export function Controller<T extends { new (...args: any[]): BaseController }>(b
|
|||
// Loop over all the methods in the decorated class looking for methods that use the `@DELETE` decorator
|
||||
Object.getOwnPropertyNames(target.prototype)
|
||||
// Find all methods that have the associated metadata key (`@DELETE` decorator)
|
||||
.filter((method) => Reflect.getMetadata(DELETE_METADATA_KEY, target.prototype, method))
|
||||
.filter((method) => typeof Reflect.getMetadata(DELETE_METADATA_KEY, target.prototype, method) !== 'undefined')
|
||||
.map((method) => {
|
||||
// Get the method
|
||||
const fn = target.prototype[method];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue