Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ianobermiller committed Apr 25, 2015
1 parent 8a3f889 commit 2cbd7e6
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions modules/prefix.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
* shenanigans.
*/

var camelCase = require('lodash/string/camelCase');
'use strict';

var kebabCase = require('lodash/string/kebabCase');

var jsCssMap = {
Expand All @@ -25,11 +26,11 @@ for (var js in jsCssMap) {
if ((js + testProp) in domStyle) {
jsVendorPrefix = js;
cssVendorPrefix = jsCssMap[js];
break
break;
}
}

function _getPrefixedProperty(property) {
var _getPrefixedProperty = function (property) {
if (prefixedPropertyCache.hasOwnProperty(property)) {
return prefixedPropertyCache[property];
}
Expand All @@ -56,9 +57,9 @@ function _getPrefixedProperty(property) {

// unsupported
return prefixedPropertyCache[property] = false;
}
};

function _getPrefixedValue(property, value) {
var _getPrefixedValue = function (property, value) {
// don't test numbers or numbers with units (e.g. 10em)
if (typeof value !== 'string' || !isNaN(parseInt(value, 10))) {
return value;
Expand Down Expand Up @@ -97,16 +98,15 @@ function _getPrefixedValue(property, value) {
}

return prefixedValueCache[cacheKey] = false;
}
};

/**
* Returns a new style object with vendor prefixes added to property names
* and values.
*/
function prefix(style, mode /* 'css' or 'js' */) {
// Returns a new style object with vendor prefixes added to property names
// and values.
/*eslint-disable no-console */
var prefix = function (style, mode /* 'css' or 'js' */) {
mode = mode || 'js';
var newStyle = {};
Object.keys(style).forEach(function(property) {
Object.keys(style).forEach(function (property) {
var value = style[property];

var newProperty = _getPrefixedProperty(property);
Expand All @@ -127,6 +127,7 @@ function prefix(style, mode /* 'css' or 'js' */) {
newStyle[newProperty[mode]] = newValue;
});
return newStyle;
}
};
/*eslint-enable no-console */

module.exports = prefix;

0 comments on commit 2cbd7e6

Please sign in to comment.