Btw. you are already casting return value of match to a boolean by using ! - I would suggest using 2x! instead of inline conditional:

return !!apiSource.match( uriPattern )