Skip to content

Commit

Permalink
feat: add has check for reflect
Browse files Browse the repository at this point in the history
  • Loading branch information
aaydin-tr committed Apr 8, 2024
1 parent 3735181 commit 74aaa32
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/decorators/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ export function Controller(prefix: string, options?: ControllerOptions) {
fnName: value,
method,
pathHasParams,
// TODO reflect has check
before: Reflect.getMetadata("before", target.prototype, value) || [],
after: Reflect.getMetadata("after", target.prototype, value) || [],
before: Reflect.hasMetadata("before", target.prototype) ? Reflect.getMetadata("before", target.prototype, value) : [],
after: Reflect.hasMetadata("after", target.prototype) ? Reflect.getMetadata("after", target.prototype, value) : [],
});
}
}
Expand Down

0 comments on commit 74aaa32

Please sign in to comment.