fela-plugin-named-keys
Advanced tools
Comparing version 11.7.0 to 12.0.0-rc.0
import isPlainObject from 'isobject'; | ||
import assignStyle from 'css-in-js-utils/lib/assignStyle'; | ||
import { assignStyle } from 'css-in-js-utils'; | ||
@@ -13,2 +13,3 @@ function resolveNamedKeys(style, keys) { | ||
var resolvedKey = keys[property]; | ||
if (style.hasOwnProperty(resolvedKey)) { | ||
@@ -18,5 +19,5 @@ style[resolvedKey] = assignStyle(style[resolvedKey], resolvedValue); | ||
style[resolvedKey] = resolvedValue; | ||
} | ||
} // We clean the old keys as they're not used anymore | ||
// We clean the old keys as they're not used anymore | ||
delete style[property]; | ||
@@ -31,5 +32,6 @@ } | ||
export default function namedKeys(keys) { | ||
return function (style, type, renderer, props) { | ||
return function (style, type, renderer) { | ||
var props = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; | ||
return resolveNamedKeys(style, keys instanceof Function ? keys(props) : keys); | ||
}; | ||
} |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,14 +6,10 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = namedKeys; | ||
exports["default"] = namedKeys; | ||
var _isobject = require('isobject'); | ||
var _isobject = _interopRequireDefault(require("isobject")); | ||
var _isobject2 = _interopRequireDefault(_isobject); | ||
var _cssInJsUtils = require("css-in-js-utils"); | ||
var _assignStyle = require('css-in-js-utils/lib/assignStyle'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var _assignStyle2 = _interopRequireDefault(_assignStyle); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function resolveNamedKeys(style, keys) { | ||
@@ -23,3 +19,3 @@ for (var property in style) { | ||
if ((0, _isobject2.default)(value)) { | ||
if ((0, _isobject["default"])(value)) { | ||
var resolvedValue = resolveNamedKeys(value, keys); | ||
@@ -29,9 +25,10 @@ | ||
var resolvedKey = keys[property]; | ||
if (style.hasOwnProperty(resolvedKey)) { | ||
style[resolvedKey] = (0, _assignStyle2.default)(style[resolvedKey], resolvedValue); | ||
style[resolvedKey] = (0, _cssInJsUtils.assignStyle)(style[resolvedKey], resolvedValue); | ||
} else { | ||
style[resolvedKey] = resolvedValue; | ||
} | ||
} // We clean the old keys as they're not used anymore | ||
// We clean the old keys as they're not used anymore | ||
delete style[property]; | ||
@@ -46,5 +43,6 @@ } | ||
function namedKeys(keys) { | ||
return function (style, type, renderer, props) { | ||
return function (style, type, renderer) { | ||
var props = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; | ||
return resolveNamedKeys(style, keys instanceof Function ? keys(props) : keys); | ||
}; | ||
} |
{ | ||
"name": "fela-plugin-named-keys", | ||
"version": "11.7.0", | ||
"version": "12.0.0-rc.0", | ||
"description": "Fela plugin to replace named keys", | ||
@@ -13,4 +13,18 @@ "main": "lib/index.js", | ||
"lib/**", | ||
"es/**" | ||
"es/**", | ||
"umd/**" | ||
], | ||
"scripts": { | ||
"setup": "yarn build", | ||
"clean": "rimraf lib es coverage", | ||
"build": "yarn clean && yarn build:es && yarn build:lib", | ||
"build:es": "babel src --out-dir es --ignore **/__tests__", | ||
"build:lib": "cross-env BABEL_ENV=commonjs babel src --out-dir lib --ignore **/__tests__", | ||
"build:umd": "webpack --config webpack.config.js", | ||
"watch": "npm run watch:lib & npm run watch:es", | ||
"watch:lib": "BABEL_ENV=commonjs babel src -d lib -w", | ||
"watch:es": "babel src -d es -w", | ||
"test": "jest --config=jest.config.js", | ||
"coverage": "yarn test --coverage" | ||
}, | ||
"repository": "https://github.com/robinweser/fela/", | ||
@@ -30,3 +44,20 @@ "keywords": [ | ||
}, | ||
"gitHead": "e067b284984d3dbfc259fcbffde9bb50679fda9b" | ||
"devDependencies": { | ||
"@babel/cli": "^7.2.0", | ||
"@babel/core": "^7.2.2", | ||
"@babel/node": "^7.13.0", | ||
"@babel/plugin-transform-modules-commonjs": "^7.5.0", | ||
"@babel/polyfill": "^7.7.0", | ||
"@babel/preset-env": "^7.5.5", | ||
"babel-core": "7.0.0-bridge.0", | ||
"babel-jest": "^26.6.0", | ||
"babel-loader": "^8.2.3", | ||
"clean-webpack-plugin": "^3.0.0", | ||
"cross-env": "^6.0.3", | ||
"jest": "^26.6.0", | ||
"rimraf": "^3.0.0", | ||
"webpack": "^4.41.6", | ||
"webpack-cli": "^3.3.10" | ||
}, | ||
"gitHead": "00f02f410f17a7693479ea3349bb3a9f223359af" | ||
} |
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 v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
10672
23344
6
66
15
2