Fix failing CI test, update funding & license year

This commit is contained in:
Faisal Salman 2023-02-28 12:25:57 +07:00
parent c6b4c867d5
commit 9ee128ae2b
6 changed files with 22 additions and 19 deletions

2
.github/FUNDING.yml vendored
View File

@ -1,6 +1,6 @@
# These are supported funding model platforms # These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] github: faisalman
patreon: # Replace with a single Patreon username patreon: # Replace with a single Patreon username
open_collective: ua-parser-js open_collective: ua-parser-js
ko_fi: # Replace with a single Ko-fi username ko_fi: # Replace with a single Ko-fi username

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2012-2021 Faisal Salman <<f@faisalman.com>> Copyright (c) 2012-2023 Faisal Salman <<f@faisalman.com>>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -197,6 +197,10 @@
{ {
"type": "paypal", "type": "paypal",
"url": "https://paypal.me/faisalman" "url": "https://paypal.me/faisalman"
},
{
"type": "github",
"url": "https://github.com/sponsors/faisalman"
} }
] ]
} }

View File

@ -90,10 +90,10 @@ The methods are self explanatory, here's a small overview on all the available m
--- ---
* `getResult() : UAResult` * `getResult()`
* returns `{ ua: '', browser: UABrowser {}, cpu: UACPU {}, device: UADevice {}, engine: UAEngine {}, os: UAOS {} }` * returns `{ ua: '', browser: UABrowser {}, cpu: UACPU {}, device: UADevice {}, engine: UAEngine {}, os: UAOS {} }`
* `getBrowser() : UABrowser` * `getBrowser()`
* returns `{ name: '', version: '' }` * returns `{ name: '', version: '' }`
```sh ```sh
@ -117,7 +117,7 @@ Vivaldi, Waterfox, WeChat, Weibo, Yandex, baidu, iCab, w3m, Whale Browser...
# 'browser.version' determined dynamically # 'browser.version' determined dynamically
``` ```
* `getDevice() : UADevice` * `getDevice()`
* returns `{ model: '', type: '', vendor: '' }` * returns `{ model: '', type: '', vendor: '' }`
```sh ```sh
@ -141,7 +141,7 @@ Siemens, Sony[Ericsson], Sprint, Tesla, Vivo, Vodafone, Xbox, Xiaomi, Zebra, ZTE
# 'device.model' determined dynamically # 'device.model' determined dynamically
``` ```
* `getEngine() : UAEngine` * `getEngine()`
* returns `{ name: '', version: '' }` * returns `{ name: '', version: '' }`
```sh ```sh
@ -152,7 +152,7 @@ NetSurf, Presto, Tasman, Trident, w3m, WebKit
# 'engine.version' determined dynamically # 'engine.version' determined dynamically
``` ```
* `getOS() : UAOS` * `getOS()`
* returns `{ name: '', version: '' }` * returns `{ name: '', version: '' }`
```sh ```sh
@ -169,7 +169,7 @@ Ubuntu, Unix, VectorLinux, Viera, watchOS, WebOS, Windows [Phone/Mobile], Zenwal
# 'os.version' determined dynamically # 'os.version' determined dynamically
``` ```
* `getCPU() : UACPU` * `getCPU()`
* returns `{ architecture: '' }` * returns `{ architecture: '' }`
```sh ```sh
@ -177,7 +177,7 @@ Ubuntu, Unix, VectorLinux, Viera, watchOS, WebOS, Windows [Phone/Mobile], Zenwal
68k, amd64, arm[64/hf], avr, ia[32/64], irix[64], mips[64], pa-risc, ppc, sparc[64] 68k, amd64, arm[64/hf], avr, ia[32/64], irix[64], mips[64], pa-risc, ppc, sparc[64]
``` ```
* `getUA() : string` * `getUA()`
* returns UA string of current instance * returns UA string of current instance
* `setUA(uastring)` * `setUA(uastring)`
@ -479,7 +479,7 @@ Made with [contributors-img](https://contrib.rocks).
MIT License MIT License
Copyright (c) 2012-2021 Faisal Salman <<f@faisalman.com>> Copyright (c) 2012-2023 Faisal Salman <<f@faisalman.com>>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
/* UAParser.js v1.1.34 /* UAParser.js v1.1.34
Copyright © 2012-2021 Faisal Salman <f@faisalman.com> Copyright © 2012-2023 Faisal Salman <f@faisalman.com>
MIT License *//* MIT License *//*
Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.
Supports browser & node.js environment. Supports browser & node.js environment.
@ -802,8 +802,7 @@
UAItem.prototype.then = function (callback) { UAItem.prototype.then = function (callback) {
return callback(this.data); return callback(this.data);
}; };
UAItem.createUAData = function (data) {
var createUAData = function (data) {
return (function () { return (function () {
var propIs = data.propIs; var propIs = data.propIs;
var ignoreIs = data.ignoreIs; var ignoreIs = data.ignoreIs;
@ -840,7 +839,7 @@
}; };
function UABrowser () { function UABrowser () {
this.data = createUAData({ this.data = UAItem.createUAData({
props : [NAME, VERSION, MAJOR], props : [NAME, VERSION, MAJOR],
propIs : [NAME], propIs : [NAME],
ignoreIs : ' ?browser$', ignoreIs : ' ?browser$',
@ -850,7 +849,7 @@
UABrowser.prototype = new UAItem(); UABrowser.prototype = new UAItem();
function UACPU () { function UACPU () {
this.data = createUAData({ this.data = UAItem.createUAData({
props : [ARCHITECTURE], props : [ARCHITECTURE],
propIs : [ARCHITECTURE], propIs : [ARCHITECTURE],
propToStr : [ARCHITECTURE] propToStr : [ARCHITECTURE]
@ -859,7 +858,7 @@
UACPU.prototype = new UAItem(); UACPU.prototype = new UAItem();
function UADevice () { function UADevice () {
this.data = createUAData({ this.data = UAItem.createUAData({
props : [TYPE, MODEL, VENDOR], props : [TYPE, MODEL, VENDOR],
propIs : [TYPE, MODEL, VENDOR], propIs : [TYPE, MODEL, VENDOR],
propToStr : [VENDOR, MODEL] propToStr : [VENDOR, MODEL]
@ -868,7 +867,7 @@
UADevice.prototype = new UAItem(); UADevice.prototype = new UAItem();
function UAEngine () { function UAEngine () {
this.data = createUAData({ this.data = UAItem.createUAData({
props : [NAME, VERSION], props : [NAME, VERSION],
propIs : [NAME], propIs : [NAME],
propToStr : [NAME, VERSION] propToStr : [NAME, VERSION]
@ -877,7 +876,7 @@
UAEngine.prototype = new UAItem(); UAEngine.prototype = new UAItem();
function UAOS () { function UAOS () {
this.data = createUAData({ this.data = UAItem.createUAData({
props : [NAME, VERSION], props : [NAME, VERSION],
propIs : [NAME], propIs : [NAME],
ignoreIs : ' ?os$', ignoreIs : ' ?os$',

View File

@ -228,7 +228,7 @@ describe('is() utility method', function () {
uap.setUA(""); uap.setUA("");
assert.strictEqual(uap.getDevice().model, undefined); assert.strictEqual(uap.getDevice().model, undefined);
assert.strictEqual(uap.getDevice().is("undefined"), true); assert.strictEqual(uap.getDevice().is("undefined"), false);
assert.strictEqual(uap.getDevice().is(undefined), true); assert.strictEqual(uap.getDevice().is(undefined), true);
}); });