Socket
Socket
Sign inDemoInstall

fela-plugin-theme-value

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fela-plugin-theme-value - npm Package Compare versions

Comparing version 11.4.0 to 11.5.0-rc.0

11

es/index.js
import isPlainObject from 'isobject';
import arrayReduce from 'fast-loops/lib/arrayReduce';
function getValue(object, key) {
var value = key.split('.').reduce(function (value, key) {
if (isPlainObject(value) && value[key]) {
return value[key];
function getThemeValue(object, key) {
var value = arrayReduce(key.split('.'), function (value, index) {
if (isPlainObject(value) && value[index]) {
return value[index];
}

@@ -23,3 +24,3 @@

if (typeof value === 'string' && mapping[property]) {
style[property] = getValue(mapping[property](theme), value);
style[property] = getThemeValue(mapping[property](theme), value);
} else if (isPlainObject(value)) {

@@ -26,0 +27,0 @@ style[property] = resolveThemeValues(style[property], theme, mapping);

@@ -12,8 +12,12 @@ 'use strict';

var _arrayReduce = require('fast-loops/lib/arrayReduce');
var _arrayReduce2 = _interopRequireDefault(_arrayReduce);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function getValue(object, key) {
var value = key.split('.').reduce(function (value, key) {
if ((0, _isobject2.default)(value) && value[key]) {
return value[key];
function getThemeValue(object, key) {
var value = (0, _arrayReduce2.default)(key.split('.'), function (value, index) {
if ((0, _isobject2.default)(value) && value[index]) {
return value[index];
}

@@ -27,3 +31,2 @@

function resolveThemeValues(style) {

@@ -37,3 +40,3 @@ var theme = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

if (typeof value === 'string' && mapping[property]) {
style[property] = getValue(mapping[property](theme), value);
style[property] = getThemeValue(mapping[property](theme), value);
} else if ((0, _isobject2.default)(value)) {

@@ -40,0 +43,0 @@ style[property] = resolveThemeValues(style[property], theme, mapping);

{
"name": "fela-plugin-theme-value",
"version": "11.4.0",
"version": "11.5.0-rc.0",
"description": "Fela plugin to resolve values from a theme",

@@ -20,3 +20,3 @@ "main": "lib/index.js",

"theme",
"themed-ui",
"theme-ui",
"mixin",

@@ -28,3 +28,3 @@ "cssinjs"

"dependencies": {
"css-in-js-utils": "^3.0.0",
"fast-loops": "^1.1.3",
"isobject": "^3.0.1"

@@ -35,3 +35,3 @@ },

},
"gitHead": "94e23ad2fda221aea52ccb939d90f81eb400b5fb"
"gitHead": "6d457d39e69e1471bddaea8591c50745f95070d9"
}
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