inline-style-prefixer
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -5,2 +5,5 @@ # Changelog | ||
### 3.0.2 | ||
* performance improvements (up to 30% faster) | ||
### 3.0.1 | ||
@@ -7,0 +10,0 @@ * performance improvements (~10% faster) ( [#115](https://github.com/rofrischmann/inline-style-prefixer/pull/115) ) ( [#116](https://github.com/rofrischmann/inline-style-prefixer/pull/116) ) |
{ | ||
"name": "inline-style-prefixer", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Run-time Autoprefixer for JavaScript style objects", | ||
@@ -67,2 +67,4 @@ "main": "dynamic/index.js", | ||
"gh-pages": "^0.12.0", | ||
"gitbook": "^3.2.2", | ||
"gitbook-cli": "^2.3.0", | ||
"istanbul": "1.0.0-alpha.2", | ||
@@ -69,0 +71,0 @@ "mocha": "^2.4.5", |
@@ -60,3 +60,3 @@ 'use strict'; | ||
style = (0, _prefixProperty2.default)(prefixMap, property, style); | ||
(0, _prefixProperty2.default)(prefixMap, property, style); | ||
} | ||
@@ -63,0 +63,0 @@ } |
@@ -15,25 +15,9 @@ 'use strict'; | ||
function prefixProperty(prefixProperties, property, style) { | ||
if (!prefixProperties.hasOwnProperty(property)) { | ||
return style; | ||
if (prefixProperties.hasOwnProperty(property)) { | ||
var requiredPrefixes = prefixProperties[property]; | ||
for (var i = 0, len = requiredPrefixes.length; i < len; ++i) { | ||
style[requiredPrefixes[i] + (0, _capitalizeString2.default)(property)] = style[property]; | ||
} | ||
} | ||
// We need to preserve the order of the styles while inserting new prefixed | ||
// styles. Object order is not guaranteed, but this is better than nothing. | ||
// Note that this is brittle and is likely to break in older versions of | ||
// Node (e.g. Node 4). | ||
var newStyle = {}; | ||
Object.keys(style).forEach(function (styleProperty) { | ||
if (styleProperty === property) { | ||
// We've found the style we need to prefix. | ||
var requiredPrefixes = prefixProperties[property]; | ||
for (var i = 0, len = requiredPrefixes.length; i < len; ++i) { | ||
newStyle[requiredPrefixes[i] + (0, _capitalizeString2.default)(property)] = style[property]; | ||
} | ||
} | ||
newStyle[styleProperty] = style[styleProperty]; | ||
}); | ||
return newStyle; | ||
} | ||
module.exports = exports['default']; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
90323
32
50
1541