react-prefixer
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -21,4 +21,6 @@ "use strict"; | ||
var div = document.createElement("div"); | ||
var _CssSupportsPolyfill = require("./CssSupportsPolyfill"); | ||
var _CssSupportsPolyfill2 = _interopRequireDefault(_CssSupportsPolyfill); | ||
function camelToKebab(str) { | ||
@@ -28,16 +30,2 @@ return str.replace(/\W+/g, "-").replace(/([a-z\d])([A-Z])/g, "$1-$2").toLowerCase(); | ||
function isPropertySupported(prop) { | ||
return typeof div.style[prop] === "string"; | ||
} | ||
function isValueSupported(prop, value, defaultValue) { | ||
div.style[prop] = defaultValue; | ||
try { | ||
div.style[prop] = value; | ||
} catch (e) {} | ||
return div.style[prop] === value; | ||
} | ||
function applyPrefixes(obj) { | ||
@@ -50,3 +38,3 @@ if (typeof obj === "object" && !!obj) { | ||
obj[key] = applyPrefixes(obj[key]); | ||
} else if (_properties2["default"].indexOf(key) !== -1 && !isPropertySupported(key)) { | ||
} else if (_properties2["default"].indexOf(key) !== -1 && !(0, _CssSupportsPolyfill2["default"])(key)) { | ||
var value = obj[key]; | ||
@@ -60,4 +48,4 @@ | ||
if (key === "display" && obj[key] === "flex" && !isValueSupported("display", "flex", "block")) { | ||
obj[key] = _prefix2["default"] === "ms" ? "-ms-flexbox" : _prefix2["default"].css + "flex"; | ||
if (realKey === "display" && obj[realKey] === "flex" && !(0, _CssSupportsPolyfill2["default"])("display", "flex")) { | ||
obj[realKey] = _prefix2["default"] === "ms" ? "-ms-flexbox" : _prefix2["default"].css + "flex"; | ||
} | ||
@@ -67,3 +55,3 @@ | ||
_animatableValues2["default"].forEach(function (animatableValue) { | ||
if (!isPropertySupported(animatableValue)) { | ||
if (!(0, _CssSupportsPolyfill2["default"])(animatableValue)) { | ||
var kebabValue = camelToKebab(animatableValue), | ||
@@ -70,0 +58,0 @@ re = new RegExp(kebabValue, "g"); |
@@ -36,3 +36,3 @@ { | ||
}, | ||
"version": "1.1.2" | ||
"version": "1.1.3" | ||
} |
Sorry, the diff of this file is not supported yet
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
73694
19
107