Skip to content

Commit

Permalink
chore: fix hasAuthorities check
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikThePendric committed Oct 16, 2023
1 parent badbee5 commit 7de8bb1
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ const hasAuthority = (authorities, authority) => {
`"hasAuthority" requires "authority" to be a populated string but received ${authority}`
)
}
if (!(Array.isArray(authorities) || authorities instanceof Set)) {
if (
!(Array.isArray(authorities) || typeof authorities?.has === 'function')
) {
throw new Error(
`"hasAuthority" requires "authorities" to be an array or set of authorities (strings)`
)
Expand Down

0 comments on commit 7de8bb1

Please sign in to comment.