1
0
mirror of https://github.com/lancedikson/bowser synced 2026-03-02 03:40:27 +00:00

Move getWindowsVersionName to utils

This commit is contained in:
Denis Demchenko
2018-06-30 19:40:10 +03:00
parent 3530ca1c70
commit 9cb04fcbae
3 changed files with 29 additions and 18 deletions

View File

@@ -1,20 +1,7 @@
import { getFirstMatch } from './utils';
function getWindowsVersionName(version) {
switch (version) {
case 'NT': return 'NT';
case 'XP': return 'XP';
case 'NT 5.0': return '2000';
case 'NT 5.1': return 'XP';
case 'NT 5.2': return '2003';
case 'NT 6.0': return 'Vista';
case 'NT 6.1': return '7';
case 'NT 6.2': return '8';
case 'NT 6.3': return '8.1';
case 'NT 10.0': return '10';
default: return undefined;
}
}
import {
getFirstMatch,
getWindowsVersionName,
} from './utils';
export default [
/* Windows Phone */

View File

@@ -34,6 +34,22 @@ class Utils {
}
return void (0);
}
static getWindowsVersionName(version) {
switch (version) {
case 'NT': return 'NT';
case 'XP': return 'XP';
case 'NT 5.0': return '2000';
case 'NT 5.1': return 'XP';
case 'NT 5.2': return '2003';
case 'NT 6.0': return 'Vista';
case 'NT 6.1': return '7';
case 'NT 6.2': return '8';
case 'NT 6.3': return '8.1';
case 'NT 10.0': return '10';
default: return undefined;
}
}
}
module.exports = Utils;