From 07e1af2873063bdc7125cd4995b29e71ddddf8f3 Mon Sep 17 00:00:00 2001 From: macleodbroad-wf Date: Tue, 1 Aug 2017 10:40:49 -0400 Subject: [PATCH] lint lib (#3308) --- lib/hammerUtil.js | 2 -- lib/util.js | 15 ++++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/hammerUtil.js b/lib/hammerUtil.js index caafb7de..9a8f4892 100644 --- a/lib/hammerUtil.js +++ b/lib/hammerUtil.js @@ -1,5 +1,3 @@ -var Hammer = require('./module/hammer'); - /** * Register a touch event, taking place before a gesture * @param {Hammer} hammer A hammer instance diff --git a/lib/util.js b/lib/util.js index 5bef259f..eb166694 100644 --- a/lib/util.js +++ b/lib/util.js @@ -141,7 +141,7 @@ exports.fillIfDefined = function (a, b, allowDeletion = false) { * @param {... Object} b * @return {Object} a */ -exports.protoExtend = function (a, b) { +exports.protoExtend = function (a, b) { // eslint-disable-line no-unused-vars for (var i = 1; i < arguments.length; i++) { var other = arguments[i]; for (var prop in other) { @@ -158,7 +158,7 @@ exports.protoExtend = function (a, b) { * @param {... Object} b * @return {Object} a */ -exports.extend = function (a, b) { +exports.extend = function (a, b) { // eslint-disable-line no-unused-vars for (var i = 1; i < arguments.length; i++) { var other = arguments[i]; for (var prop in other) { @@ -178,7 +178,7 @@ exports.extend = function (a, b) { * @param {Object} b * @return {Object} a */ -exports.selectiveExtend = function (props, a, b) { +exports.selectiveExtend = function (props, a, b) { // eslint-disable-line no-unused-vars if (!Array.isArray(props)) { throw new Error('Array with property names expected as first argument'); } @@ -951,15 +951,16 @@ exports.hexToRGB = function (hex) { * @returns {*} */ exports.overrideOpacity = function (color, opacity) { + var rgb; if (color.indexOf("rgba") != -1) { return color; } else if (color.indexOf("rgb") != -1) { - var rgb = color.substr(color.indexOf("(") + 1).replace(")", "").split(","); + rgb = color.substr(color.indexOf("(") + 1).replace(")", "").split(","); return "rgba(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + "," + opacity + ")" } else { - var rgb = exports.hexToRGB(color); + rgb = exports.hexToRGB(color); if (rgb == null) { return color; } @@ -967,7 +968,7 @@ exports.overrideOpacity = function (color, opacity) { return "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + "," + opacity + ")" } } -} +}; /** * @@ -1461,7 +1462,7 @@ exports.binarySearchValue = function (orderedItems, target, field, sidePreferenc var high = orderedItems.length - 1; var prevValue, value, nextValue, middle; - var comparator = comparator != undefined ? comparator : function (a, b) { + comparator = comparator != undefined ? comparator : function (a, b) { return a == b ? 0 : a < b ? -1 : 1 };