Skip to content

Commit 63b928d

Browse files
committed
Update Gaming
1 parent 2d03315 commit 63b928d

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

  • src/Analyser/Header/Useragent/Device

src/Analyser/Header/Useragent/Device/Gaming.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ class Gaming {
1717
/* Nintendo Wii and DS */
1818

1919
static detectNintendo(ua) {
20+
/* Switch */
21+
22+
if (/Nintendo Switch/u.test(ua)) {
23+
this.data.os.reset();
24+
this.data.device.setIdentification({
25+
manufacturer: 'Nintendo',
26+
model: 'Switch',
27+
type: Constants.deviceType.GAMING,
28+
subtype: Constants.deviceSubType.CONSOLE,
29+
});
30+
}
31+
2032
/* Wii */
2133

2234
if (/Nintendo Wii/u.test(ua)) {
@@ -172,7 +184,7 @@ class Gaming {
172184

173185
/* PlayStation 4 */
174186

175-
if (/PlayStation 4/iu.test(ua)) {
187+
if (/PlayStation 4/iu.test(ua) || /\(PS4/u.test(ua)) {
176188
this.data.os.reset();
177189
this.data.os.identifyVersion(/PlayStation 4 ([0-9.]*)/u, ua);
178190

0 commit comments

Comments
 (0)