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

fela-plugin-extend

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fela-plugin-extend - npm Package Compare versions

Comparing version 6.0.1 to 6.0.2

9

es/index.js

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