Socket
Socket
Sign inDemoInstall

fela

Package Overview
Dependencies
Maintainers
1
Versions
123
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fela - npm Package Compare versions

Comparing version 3.0.3 to 3.0.4

lib/plugins/placeholderPrefixer.js

28

lib/plugins/unit.js

@@ -29,16 +29,19 @@ 'use strict';

function addUnit(style, unit) {
function addUnit(style, unit, propertyMap) {
Object.keys(style).forEach(function (property) {
if (!(0, _unitlessCssProperty2.default)(property)) {
(function () {
var value = style[property];
if (Array.isArray(value)) {
style[property] = value.map(function (value) {
return addUnitIfNeeded(property, value, unit);
});
} else if (value instanceof Object) {
style[property] = addUnit(value, unit);
} else {
style[property] = addUnitIfNeeded(property, value, unit);
}
var value = style[property];
var propertyUnit = propertyMap[property] || unit;
if (Array.isArray(value)) {
style[property] = value.map(function (value) {
return addUnitIfNeeded(property, value, propertyUnit);
});
} else if (value instanceof Object) {
style[property] = addUnit(value, unit, propertyMap);
} else {
style[property] = addUnitIfNeeded(property, value, propertyUnit);
}
})();
}

@@ -52,2 +55,3 @@ });

var unit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'px';
var propertyMap = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

@@ -57,3 +61,3 @@ process.env.NODE_ENV !== "production" ? (0, _warning2.default)(unit.match(/ch|em|ex|rem|vh|vw|vmin|vmax|px|cm|mm|in|pc|pt|mozmm|%/) !== null, 'You are using an invalid unit `' + unit + '`. Consider using one of the following ch, em, ex, rem, vh, vw, vmin, vmax, px, cm, mm, in, pc, pt, mozmm or %.') : void 0;

return function (style) {
return addUnit(style, unit);
return addUnit(style, unit, propertyMap);
};

@@ -60,0 +64,0 @@ };

{
"name": "fela",
"version": "3.0.3",
"version": "3.0.4",
"description": "Fast & Dynamic Styling in JavaScript",

@@ -5,0 +5,0 @@ "main": "index.js",

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