Socket
Socket
Sign inDemoInstall

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.2 to 6.0.3

14

es/index.js

@@ -1,4 +0,10 @@

import isPlainObject from 'lodash/isPlainObject';
import forEach from 'lodash/forEach';
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 objectEach from 'fast-loops/lib/objectEach';
import arrayEach from 'fast-loops/lib/arrayEach';
function isPlainObject(obj) {
return (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && !Array.isArray(obj);
}
function extendStyle(style, extension, extendPlugin, type, renderer) {

@@ -17,7 +23,7 @@ // extend conditional style objects

function extend(style, type, renderer) {
forEach(style, function (value, property) {
objectEach(style, function (value, property) {
if (property === 'extend') {
var extensions = [].concat(value);
forEach(extensions, function (extension) {
arrayEach(extensions, function (extension) {
return extendStyle(style, extension, extend, type, renderer);

@@ -24,0 +30,0 @@ });

@@ -7,12 +7,18 @@ 'use strict';

var _isPlainObject = require('lodash/isPlainObject');
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; };
var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
var _objectEach = require('fast-loops/lib/objectEach');
var _forEach = require('lodash/forEach');
var _objectEach2 = _interopRequireDefault(_objectEach);
var _forEach2 = _interopRequireDefault(_forEach);
var _arrayEach = require('fast-loops/lib/arrayEach');
var _arrayEach2 = _interopRequireDefault(_arrayEach);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function isPlainObject(obj) {
return (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && !Array.isArray(obj);
}
function extendStyle(style, extension, extendPlugin, type, renderer) {

@@ -31,11 +37,11 @@ // extend conditional style objects

function extend(style, type, renderer) {
(0, _forEach2.default)(style, function (value, property) {
(0, _objectEach2.default)(style, function (value, property) {
if (property === 'extend') {
var extensions = [].concat(value);
(0, _forEach2.default)(extensions, function (extension) {
(0, _arrayEach2.default)(extensions, function (extension) {
return extendStyle(style, extension, extend, type, renderer);
});
delete style[property];
} else if ((0, _isPlainObject2.default)(value)) {
} else if (isPlainObject(value)) {
// support nested extend as well

@@ -42,0 +48,0 @@ style[property] = extend(value, type, renderer);

{
"name": "fela-plugin-extend",
"version": "6.0.2",
"version": "6.0.3",
"description": "Fela plugin to extend style objects",

@@ -27,4 +27,4 @@ "main": "lib/index.js",

"css-in-js-utils": "2.0.0",
"lodash": "^4.17.4"
"fast-loops": "^1.0.0"
}
}
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