Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fela-plugin-unit

Package Overview
Dependencies
Maintainers
1
Versions
111
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fela-plugin-unit - npm Package Compare versions

Comparing version 5.0.13 to 5.0.14

7

es/index.js
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
import isUnitlessProperty from 'css-in-js-utils/lib/isUnitlessProperty';
import isPlainObject from 'lodash/isPlainObject';
import { isObject, warning } from 'fela-utils';
function addUnitIfNeeded(property, value, propertyUnit) {

@@ -23,3 +22,3 @@ var valueType = typeof value === 'undefined' ? 'undefined' : _typeof(value);

if (isObject(cssValue)) {
if (isPlainObject(cssValue)) {
style[property] = addUnit(cssValue, defaultUnit, propertyMap);

@@ -47,4 +46,2 @@ } else if (Array.isArray(cssValue)) {

process.env.NODE_ENV !== "production" ? warning(defaultUnit.match(/ch|em|ex|rem|vh|vw|vmin|vmax|px|cm|mm|in|pc|pt|mozmm|%/) !== null, 'You are using an invalid unit "' + defaultUnit + '". 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) {

@@ -51,0 +48,0 @@ return addUnit(style, defaultUnit, propertyMap);

@@ -15,4 +15,6 @@ 'use strict';

var _felaUtils = require('fela-utils');
var _isPlainObject = require('lodash/isPlainObject');
var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -36,3 +38,3 @@

if ((0, _felaUtils.isObject)(cssValue)) {
if ((0, _isPlainObject2.default)(cssValue)) {
style[property] = addUnit(cssValue, defaultUnit, propertyMap);

@@ -60,4 +62,2 @@ } else if (Array.isArray(cssValue)) {

process.env.NODE_ENV !== "production" ? (0, _felaUtils.warning)(defaultUnit.match(/ch|em|ex|rem|vh|vw|vmin|vmax|px|cm|mm|in|pc|pt|mozmm|%/) !== null, 'You are using an invalid unit "' + defaultUnit + '". 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) {

@@ -64,0 +64,0 @@ return addUnit(style, defaultUnit, propertyMap);

{
"name": "fela-plugin-unit",
"version": "5.0.13",
"version": "5.0.14",
"description": "Fela plugin to automatically add units if required",

@@ -23,5 +23,5 @@ "main": "lib/index.js",

"dependencies": {
"css-in-js-utils": "2.0.0",
"fela-utils": "^7.0.5"
"css-in-js-utils": "^2.0.0",
"lodash": "^4.17.4"
}
}
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