This just replaces the function that validates the args that goes into @hasRole(). Thankfully the existing tests helped me ensure the exact same behaviour was kept. I also added a couple of more tests too. joi is a really nice library but it is a heavyweight solution for such a small piece of validation.
This just replaces the function that validates the args that goes into
@hasRole()
. Thankfully the existing tests helped me ensure the exact same behaviour was kept. I also added a couple of more tests too.joi
is a really nice library but it is a heavyweight solution for such a small piece of validation.