Skip to content

Commit

Permalink
lint lib (almende#3308)
Browse files Browse the repository at this point in the history
  • Loading branch information
macleodbroad-wf authored and Primoz Susa committed Jan 3, 2019
1 parent 2c9badf commit 3bcc039
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 0 additions & 2 deletions lib/hammerUtil.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
var Hammer = require('./module/hammer');

/**
* Register a touch event, taking place before a gesture
* @param {Hammer} hammer A hammer instance
Expand Down
15 changes: 8 additions & 7 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -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');
}
Expand Down Expand Up @@ -951,23 +951,24 @@ 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;
}
else {
return "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + "," + opacity + ")"
}
}
}
};

/**
*
Expand Down Expand Up @@ -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
};

Expand Down

0 comments on commit 3bcc039

Please sign in to comment.