Socket
Socket
Sign inDemoInstall

react-prefixer

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-prefixer - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

lib/CssSupportsPolyfill.js

26

lib/index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc