omrilotan / isbot

🤖/👨‍🦰 Detect bots/crawlers/spiders using the user agent string
https://isbot.js.org/
The Unlicense
933 stars 77 forks source link

Allow undefined in isbot interface #149

Closed omrilotan closed 3 years ago

omrilotan commented 3 years ago

Steps to reproduce

Using Typescript and Express, using the Request.get method interface returns string or undefined. This does not match the interface of isbot (string).

Expected behaviour

Accept undefined to allow simpler usage

Actual behaviour

Currently while using isbot(req.get('user-agent')) we have compilation exception

Additional details

image