BREAKING CHANGE - Add new property to browser: type

This commit is contained in:
Faisal Salman
2024-06-02 23:04:25 +07:00
parent 1a22c6951f
commit 39590f112d
8 changed files with 25 additions and 14 deletions

View File

@@ -62,6 +62,7 @@ declare namespace UAParser {
NAME: 'name';
VERSION: 'version';
MAJOR: 'major';
TYPE: 'type';
};
static readonly CPU: {
ARCHITECTURE: 'architecture';

View File

@@ -847,7 +847,7 @@
var defaultProps = (function () {
var props = { init : {}, isIgnore : {}, isIgnoreRgx : {}, toString : {}};
setProps.call(props.init, [
[UA_BROWSER, [NAME, VERSION, MAJOR]],
[UA_BROWSER, [NAME, VERSION, MAJOR, TYPE]],
[UA_CPU, [ARCHITECTURE]],
[UA_DEVICE, [TYPE, MODEL, VENDOR]],
[UA_ENGINE, [NAME, VERSION]],
@@ -1225,7 +1225,7 @@
}
UAParser.VERSION = LIBVERSION;
UAParser.BROWSER = enumerize([NAME, VERSION, MAJOR]);
UAParser.BROWSER = enumerize([NAME, VERSION, MAJOR, TYPE]);
UAParser.CPU = enumerize([ARCHITECTURE]);
UAParser.DEVICE = enumerize([MODEL, VENDOR, TYPE, CONSOLE, MOBILE, SMARTTV, TABLET, WEARABLE, EMBEDDED]);
UAParser.ENGINE = UAParser.OS = enumerize([NAME, VERSION]);