1
0
mirror of https://github.com/lancedikson/bowser synced 2024-10-27 20:34:22 +00:00

Fix travis warnings

This commit is contained in:
Oliver foster 2019-12-19 10:36:51 +00:00
parent d0dfa37e50
commit 97aa1e1972
2 changed files with 21 additions and 15 deletions

View File

@ -82,7 +82,7 @@ class Parser {
parseBrowser() {
this.parsedResult.browser = {};
const browserDescriptor = Utils.find(browserParsersList, _browser => {
const browserDescriptor = Utils.find(browserParsersList, (_browser) => {
if (typeof _browser.test === 'function') {
return _browser.test(this);
}
@ -165,7 +165,7 @@ class Parser {
parseOS() {
this.parsedResult.os = {};
const os = Utils.find(osParsersList, _os => {
const os = Utils.find(osParsersList, (_os) => {
if (typeof _os.test === 'function') {
return _os.test(this);
}
@ -241,7 +241,7 @@ class Parser {
parsePlatform() {
this.parsedResult.platform = {};
const platform = Utils.find(platformParsersList, _platform => {
const platform = Utils.find(platformParsersList, (_platform) => {
if (typeof _platform.test === 'function') {
return _platform.test(this);
}
@ -292,7 +292,7 @@ class Parser {
parseEngine() {
this.parsedResult.engine = {};
const engine = Utils.find(enginesParsersList, _engine => {
const engine = Utils.find(enginesParsersList, (_engine) => {
if (typeof _engine.test === 'function') {
return _engine.test(this);
}
@ -380,7 +380,10 @@ class Parser {
}
}
const platformMatchingDefinition = Utils.find(platformsAndOSNames, name => (this.isPlatform(name)));
const platformMatchingDefinition = Utils.find(
platformsAndOSNames,
name => (this.isPlatform(name))
);
if (platformMatchingDefinition) {
const platformResult = this.satisfies(platformsAndOSes[platformMatchingDefinition]);

View File

@ -244,11 +244,14 @@ export default class Utils {
if (Array.prototype.find) {
return Array.prototype.find.call(arr, predicate);
}
for (i = 0, l = arr.length; i < l; i++ ) {
for (i = 0, l = arr.length; i < l; i+=1) {
const value = arr[i];
if (!predicate(value, i)) continue;
if (!predicate(value, i)) {
continue;
}
return value;
}
return undefined;
}
/**
@ -258,19 +261,19 @@ export default class Utils {
* @param {Object} ...objs
* @return {Object}
*/
static assign(obj) {
static assign(obj, ...assigners) {
let i;
let l;
let k;
if (Object.assign) {
return Object.assign.apply(Object, arguments);
return Object.assign(obj, ...assigners);
}
for (i = 1, l = arguments.length; i < l; i++) {
const assigner = arguments[i];
if (typeof assigner !== "object") continue;
for (k in assigner) {
obj[k] = assigner[k]
for (i = 0, l = assigners.length; i < l; i+=1) {
const assigner = assigners[i];
if (typeof assigner !== 'object') {
continue;
}
const keys = Object.keys(assigner);
keys.forEach(key => obj[key] = assigner[key]);
}
return obj;
}