We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a5ee118 commit ae86296Copy full SHA for ae86296
src/index.ts
@@ -153,7 +153,11 @@ const operatingSystemRules: OperatingSystemRule[] = [
153
['Search Bot', SEARCHBOT_OS_REGEX],
154
];
155
156
-export function detect(): BrowserInfo | BotInfo | NodeInfo | null {
+export function detect(userAgent?: string): BrowserInfo | BotInfo | NodeInfo | null {
157
+ if (!!userAgent) {
158
+ return parseUserAgent(userAgent);
159
+ }
160
+
161
if (typeof navigator !== 'undefined') {
162
return parseUserAgent(navigator.userAgent);
163
}
0 commit comments