fela-plugin-unit
Advanced tools
Comparing version 5.0.13 to 5.0.14
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" | ||
} | ||
} |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
1
7439
86
+ Addedlodash@^4.17.4
+ Addedcss-in-js-utils@2.0.1(transitive)
+ Addedisobject@3.0.1(transitive)
+ Addedlodash@4.17.21(transitive)
- Removedfela-utils@^7.0.5
- Removedcss-in-js-utils@2.0.0(transitive)
- Removedfela-utils@7.0.5(transitive)
Updatedcss-in-js-utils@^2.0.0