fela-plugin-extend
Advanced tools
Comparing version 6.0.1 to 6.0.2
@@ -1,2 +0,3 @@ | ||
import { isObject, arrayEach, objectEach } from 'fela-utils'; | ||
import isPlainObject from 'lodash/isPlainObject'; | ||
import forEach from 'lodash/forEach'; | ||
@@ -16,11 +17,11 @@ function extendStyle(style, extension, extendPlugin, type, renderer) { | ||
function extend(style, type, renderer) { | ||
objectEach(style, function (value, property) { | ||
forEach(style, function (value, property) { | ||
if (property === 'extend') { | ||
var extensions = [].concat(value); | ||
arrayEach(extensions, function (extension) { | ||
forEach(extensions, function (extension) { | ||
return extendStyle(style, extension, extend, type, renderer); | ||
}); | ||
delete style[property]; | ||
} else if (isObject(value)) { | ||
} else if (isPlainObject(value)) { | ||
// support nested extend as well | ||
@@ -27,0 +28,0 @@ style[property] = extend(value, type, renderer); |
@@ -7,4 +7,12 @@ 'use strict'; | ||
var _felaUtils = require('fela-utils'); | ||
var _isPlainObject = require('lodash/isPlainObject'); | ||
var _isPlainObject2 = _interopRequireDefault(_isPlainObject); | ||
var _forEach = require('lodash/forEach'); | ||
var _forEach2 = _interopRequireDefault(_forEach); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function extendStyle(style, extension, extendPlugin, type, renderer) { | ||
@@ -22,13 +30,12 @@ // extend conditional style objects | ||
function extend(style, type, renderer) { | ||
(0, _felaUtils.objectEach)(style, function (value, property) { | ||
(0, _forEach2.default)(style, function (value, property) { | ||
if (property === 'extend') { | ||
var extensions = [].concat(value); | ||
(0, _felaUtils.arrayEach)(extensions, function (extension) { | ||
(0, _forEach2.default)(extensions, function (extension) { | ||
return extendStyle(style, extension, extend, type, renderer); | ||
}); | ||
delete style[property]; | ||
} else if ((0, _felaUtils.isObject)(value)) { | ||
} else if ((0, _isPlainObject2.default)(value)) { | ||
// support nested extend as well | ||
@@ -35,0 +42,0 @@ style[property] = extend(value, type, renderer); |
{ | ||
"name": "fela-plugin-extend", | ||
"version": "6.0.1", | ||
"version": "6.0.2", | ||
"description": "Fela plugin to extend style objects", | ||
@@ -27,4 +27,4 @@ "main": "lib/index.js", | ||
"css-in-js-utils": "2.0.0", | ||
"fela-utils": "^7.0.5" | ||
"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
6112
67
11461
+ Addedlodash@^4.17.4
+ Addedlodash@4.17.21(transitive)
- Removedfela-utils@^7.0.5
- Removedfela-utils@7.0.5(transitive)