fela-plugin-named-keys
Advanced tools
Comparing version 10.8.2 to 11.0.0
import isPlainObject from 'isobject'; | ||
import assignStyle from 'css-in-js-utils/lib/assignStyle'; | ||
@@ -11,3 +12,10 @@ function resolveNamedKeys(style, keys) { | ||
if (keys.hasOwnProperty(property)) { | ||
style[keys[property]] = resolvedValue; | ||
var resolvedKey = keys[property]; | ||
if (style.hasOwnProperty(resolvedKey)) { | ||
style[resolvedKey] = assignStyle(style[resolvedKey], resolvedValue); | ||
} else { | ||
style[resolvedKey] = resolvedValue; | ||
} | ||
// We clean the old keys as they're not used anymore | ||
delete style[property]; | ||
@@ -14,0 +22,0 @@ } |
@@ -12,2 +12,6 @@ '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 }; } | ||
@@ -23,3 +27,10 @@ | ||
if (keys.hasOwnProperty(property)) { | ||
style[keys[property]] = resolvedValue; | ||
var resolvedKey = keys[property]; | ||
if (style.hasOwnProperty(resolvedKey)) { | ||
style[resolvedKey] = (0, _assignStyle2.default)(style[resolvedKey], resolvedValue); | ||
} else { | ||
style[resolvedKey] = resolvedValue; | ||
} | ||
// We clean the old keys as they're not used anymore | ||
delete style[property]; | ||
@@ -32,2 +43,3 @@ } | ||
} | ||
function namedKeys(keys) { | ||
@@ -34,0 +46,0 @@ return function (style, type, renderer, props) { |
{ | ||
"name": "fela-plugin-named-keys", | ||
"version": "10.8.2", | ||
"version": "11.0.0", | ||
"description": "Fela plugin to replace named keys", | ||
@@ -15,3 +15,3 @@ "main": "lib/index.js", | ||
], | ||
"repository": "https://github.com/rofrischmann/fela/", | ||
"repository": "https://github.com/robinweser/fela/", | ||
"keywords": [ | ||
@@ -27,5 +27,6 @@ "fela", | ||
"dependencies": { | ||
"css-in-js-utils": "^3.0.0", | ||
"isobject": "^3.0.1" | ||
}, | ||
"gitHead": "9e672da639a79155774bab89060d47bd8d461d57" | ||
"gitHead": "ff394c7a5d741ddd039145fd6d5944bf3e918f58" | ||
} |
@@ -89,2 +89,2 @@ # fela-plugin-named-keys | ||
Documentation is licensed under [Creative Common License](http://creativecommons.org/licenses/by/4.0/).<br> | ||
Created with ♥ by [@rofrischmann](http://rofrischmann.de) and all the great contributors. | ||
Created with ♥ by [@robinweser](http://weser.io) and all the great contributors. |
Sorry, the diff of this file is not supported yet
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
6262
58
2
+ Addedcss-in-js-utils@^3.0.0
+ Addedcss-in-js-utils@3.1.0(transitive)
+ Addedhyphenate-style-name@1.1.0(transitive)