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 5.0.12 to 6.0.0

11

es/index.js
import { isObject, arrayEach, objectEach } from 'fela-utils';
import assignStyle from 'css-in-js-utils/lib/assignStyle';
function extendStyle(style, extension, extendPlugin, type, renderer) {
var merge = renderer._mergeStyle || assignStyle;
function extendStyle(style, extension, extendPlugin, renderer) {
// extend conditional style objects
if (extension.hasOwnProperty('condition')) {
if (extension.condition) {
merge(style, extendPlugin(extension.style, type, renderer));
renderer._mergeStyle(style, extendPlugin(extension.style));
}
} else {
// extend basic style objects
merge(style, extension);
renderer._mergeStyle(style, extension);
}

@@ -24,3 +21,3 @@ }

arrayEach(extensions, function (extension) {
return extendStyle(style, extension, extend, type, renderer);
return extendStyle(style, extension, extend, renderer);
});

@@ -27,0 +24,0 @@ delete style[property];

@@ -9,22 +9,15 @@ 'use strict';

var _assignStyle = require('css-in-js-utils/lib/assignStyle');
var _assignStyle2 = _interopRequireDefault(_assignStyle);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function extendStyle(style, extension, extendPlugin, type, renderer) {
var merge = renderer._mergeStyle || _assignStyle2.default;
function extendStyle(style, extension, extendPlugin, renderer) {
// extend conditional style objects
if (extension.hasOwnProperty('condition')) {
if (extension.condition) {
merge(style, extendPlugin(extension.style, type, renderer));
renderer._mergeStyle(style, extendPlugin(extension.style));
}
} else {
// extend basic style objects
merge(style, extension);
renderer._mergeStyle(style, extension);
}
}
function extend(style, type, renderer) {

@@ -36,3 +29,3 @@ (0, _felaUtils.objectEach)(style, function (value, property) {

(0, _felaUtils.arrayEach)(extensions, function (extension) {
return extendStyle(style, extension, extend, type, renderer);
return extendStyle(style, extension, extend, renderer);
});

@@ -39,0 +32,0 @@ delete style[property];

{
"name": "fela-plugin-extend",
"version": "5.0.12",
"version": "6.0.0",
"description": "Fela plugin to extend style objects",

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

"license": "MIT",
"peerDependencies": {
"fela": "^6.0.0"
},
"dependencies": {

@@ -24,0 +27,0 @@ "css-in-js-utils": "2.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