mirror of
https://github.com/lancedikson/bowser
synced 2024-10-27 20:34:22 +00:00
Fix travis warnings
This commit is contained in:
parent
d0dfa37e50
commit
97aa1e1972
@ -82,7 +82,7 @@ class Parser {
|
|||||||
parseBrowser() {
|
parseBrowser() {
|
||||||
this.parsedResult.browser = {};
|
this.parsedResult.browser = {};
|
||||||
|
|
||||||
const browserDescriptor = Utils.find(browserParsersList, _browser => {
|
const browserDescriptor = Utils.find(browserParsersList, (_browser) => {
|
||||||
if (typeof _browser.test === 'function') {
|
if (typeof _browser.test === 'function') {
|
||||||
return _browser.test(this);
|
return _browser.test(this);
|
||||||
}
|
}
|
||||||
@ -165,7 +165,7 @@ class Parser {
|
|||||||
parseOS() {
|
parseOS() {
|
||||||
this.parsedResult.os = {};
|
this.parsedResult.os = {};
|
||||||
|
|
||||||
const os = Utils.find(osParsersList, _os => {
|
const os = Utils.find(osParsersList, (_os) => {
|
||||||
if (typeof _os.test === 'function') {
|
if (typeof _os.test === 'function') {
|
||||||
return _os.test(this);
|
return _os.test(this);
|
||||||
}
|
}
|
||||||
@ -241,7 +241,7 @@ class Parser {
|
|||||||
parsePlatform() {
|
parsePlatform() {
|
||||||
this.parsedResult.platform = {};
|
this.parsedResult.platform = {};
|
||||||
|
|
||||||
const platform = Utils.find(platformParsersList, _platform => {
|
const platform = Utils.find(platformParsersList, (_platform) => {
|
||||||
if (typeof _platform.test === 'function') {
|
if (typeof _platform.test === 'function') {
|
||||||
return _platform.test(this);
|
return _platform.test(this);
|
||||||
}
|
}
|
||||||
@ -292,7 +292,7 @@ class Parser {
|
|||||||
parseEngine() {
|
parseEngine() {
|
||||||
this.parsedResult.engine = {};
|
this.parsedResult.engine = {};
|
||||||
|
|
||||||
const engine = Utils.find(enginesParsersList, _engine => {
|
const engine = Utils.find(enginesParsersList, (_engine) => {
|
||||||
if (typeof _engine.test === 'function') {
|
if (typeof _engine.test === 'function') {
|
||||||
return _engine.test(this);
|
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) {
|
if (platformMatchingDefinition) {
|
||||||
const platformResult = this.satisfies(platformsAndOSes[platformMatchingDefinition]);
|
const platformResult = this.satisfies(platformsAndOSes[platformMatchingDefinition]);
|
||||||
|
|
||||||
|
23
src/utils.js
23
src/utils.js
@ -244,11 +244,14 @@ export default class Utils {
|
|||||||
if (Array.prototype.find) {
|
if (Array.prototype.find) {
|
||||||
return Array.prototype.find.call(arr, predicate);
|
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];
|
const value = arr[i];
|
||||||
if (!predicate(value, i)) continue;
|
if (!predicate(value, i)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -258,19 +261,19 @@ export default class Utils {
|
|||||||
* @param {Object} ...objs
|
* @param {Object} ...objs
|
||||||
* @return {Object}
|
* @return {Object}
|
||||||
*/
|
*/
|
||||||
static assign(obj) {
|
static assign(obj, ...assigners) {
|
||||||
let i;
|
let i;
|
||||||
let l;
|
let l;
|
||||||
let k;
|
|
||||||
if (Object.assign) {
|
if (Object.assign) {
|
||||||
return Object.assign.apply(Object, arguments);
|
return Object.assign(obj, ...assigners);
|
||||||
}
|
}
|
||||||
for (i = 1, l = arguments.length; i < l; i++) {
|
for (i = 0, l = assigners.length; i < l; i+=1) {
|
||||||
const assigner = arguments[i];
|
const assigner = assigners[i];
|
||||||
if (typeof assigner !== "object") continue;
|
if (typeof assigner !== 'object') {
|
||||||
for (k in assigner) {
|
continue;
|
||||||
obj[k] = assigner[k]
|
|
||||||
}
|
}
|
||||||
|
const keys = Object.keys(assigner);
|
||||||
|
keys.forEach(key => obj[key] = assigner[key]);
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user