Skip to content

Commit

Permalink
remove vivaldi detection (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
DamonOehlman committed Mar 7, 2020
1 parent 59ce37d commit fa96e75
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
12 changes: 5 additions & 7 deletions src/index.ts
Expand Up @@ -5,7 +5,7 @@ interface DetectedInfo<
N extends string,
O,
V = null
> {
> {
readonly type: T;
readonly name: N;
readonly version: V;
Expand All @@ -19,7 +19,7 @@ export class BrowserInfo
public readonly name: Browser,
public readonly version: string,
public readonly os: OperatingSystem | null,
) {}
) { }
}

export class NodeInfo
Expand All @@ -28,19 +28,19 @@ export class NodeInfo
public readonly name: 'node' = 'node';
public readonly os: NodeJS.Platform = process.platform;

constructor(public readonly version: string) {}
constructor(public readonly version: string) { }
}

export class SearchBotDeviceInfo
implements
DetectedInfo<'bot-device', Browser, OperatingSystem | null, string> {
DetectedInfo<'bot-device', Browser, OperatingSystem | null, string> {
public readonly type = 'bot-device';
constructor(
public readonly name: Browser,
public readonly version: string,
public readonly os: OperatingSystem | null,
public readonly bot: string,
) {}
) { }
}

export class BotInfo implements DetectedInfo<'bot', 'bot', null, null> {
Expand All @@ -56,7 +56,6 @@ export type Browser =
| 'edge'
| 'edge-ios'
| 'yandexbrowser'
| 'vivaldi'
| 'kakaotalk'
| 'samsung'
| 'silk'
Expand Down Expand Up @@ -120,7 +119,6 @@ const userAgentRules: UserAgentRule[] = [
['edge', /Edge\/([0-9\._]+)/],
['edge-ios', /EdgiOS\/([0-9\._]+)/],
['yandexbrowser', /YaBrowser\/([0-9\._]+)/],
['vivaldi', /Vivaldi\/([0-9\.]+)/],
['kakaotalk', /KAKAOTALK\s([0-9\.]+)/],
['samsung', /SamsungBrowser\/([0-9\.]+)/],
['silk', /\bSilk\/([0-9._-]+)\b/],
Expand Down
10 changes: 0 additions & 10 deletions test/logic.js
Expand Up @@ -208,16 +208,6 @@ test('detects Yandex Browser', function(t) {
t.end();
});

test('detects Vivaldi Browser', function(t) {
assertAgentString(
t,
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36 Vivaldi/1.2.490.43',
{ type: 'browser', name: 'vivaldi', version: '1.2.490', os: 'Mac OS' },
);

t.end();
});

test('detects Kakaotalk Browser', function(t) {
assertAgentString(
t,
Expand Down

0 comments on commit fa96e75

Please sign in to comment.