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
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
github: faisalman
patreon: # Replace with a single Patreon username
open_collective: ua-parser-js
ko_fi: # Replace with a single Ko-fi username

View File

@ -1,6 +1,6 @@
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
of this software and associated documentation files (the "Software"), to deal

View File

@ -197,6 +197,10 @@
{
"type": "paypal",
"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 {} }`
* `getBrowser() : UABrowser`
* `getBrowser()`
* returns `{ name: '', version: '' }`
```sh
@ -117,7 +117,7 @@ Vivaldi, Waterfox, WeChat, Weibo, Yandex, baidu, iCab, w3m, Whale Browser...
# 'browser.version' determined dynamically
```
* `getDevice() : UADevice`
* `getDevice()`
* returns `{ model: '', type: '', vendor: '' }`
```sh
@ -141,7 +141,7 @@ Siemens, Sony[Ericsson], Sprint, Tesla, Vivo, Vodafone, Xbox, Xiaomi, Zebra, ZTE
# 'device.model' determined dynamically
```
* `getEngine() : UAEngine`
* `getEngine()`
* returns `{ name: '', version: '' }`
```sh
@ -152,7 +152,7 @@ NetSurf, Presto, Tasman, Trident, w3m, WebKit
# 'engine.version' determined dynamically
```
* `getOS() : UAOS`
* `getOS()`
* returns `{ name: '', version: '' }`
```sh
@ -169,7 +169,7 @@ Ubuntu, Unix, VectorLinux, Viera, watchOS, WebOS, Windows [Phone/Mobile], Zenwal
# 'os.version' determined dynamically
```
* `getCPU() : UACPU`
* `getCPU()`
* returns `{ architecture: '' }`
```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]
```
* `getUA() : string`
* `getUA()`
* returns UA string of current instance
* `setUA(uastring)`
@ -479,7 +479,7 @@ Made with [contributors-img](https://contrib.rocks).
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
of this software and associated documentation files (the "Software"), to deal

View File

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

View File

@ -228,7 +228,7 @@ describe('is() utility method', function () {
uap.setUA("");
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);
});