Socket
Socket
Sign inDemoInstall

babel-plugin-styled-components

Package Overview
Dependencies
77
Maintainers
3
Versions
95
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.8.0 to 1.9.0-0

lib/visitors/transpileCssProp.js

32

lib/index.js

@@ -8,2 +8,4 @@ "use strict";

var _pluginSyntaxJsx = _interopRequireDefault(require("@babel/plugin-syntax-jsx"));
var _pure = _interopRequireDefault(require("./visitors/pure"));

@@ -19,8 +21,38 @@

var _transpileCssProp = _interopRequireDefault(require("./visitors/transpileCssProp"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
function _default(_ref) {
var t = _ref.types;
return {
inherits: _pluginSyntaxJsx.default,
visitor: {
// These visitors insert newly generated code and missing import/require statements
Program: {
enter(path, state) {
state.required = false;
state.items = [];
},
exit(path, state) {
var _path$node$body;
(_path$node$body = path.node.body).push.apply(_path$node$body, _toConsumableArray(state.items));
}
},
JSXAttribute(path, state) {
(0, _transpileCssProp.default)(t)(path, state);
},
CallExpression(path, state) {

@@ -27,0 +59,0 @@ (0, _displayNameAndId.default)(t)(path, state);

10

lib/utils/options.js

@@ -6,3 +6,3 @@ "use strict";

});
exports.usePureAnnotation = exports.useTranspileTemplateLiterals = exports.useMinify = exports.useFileName = exports.useSSR = exports.useDisplayName = void 0;
exports.useCssProp = exports.usePureAnnotation = exports.useTranspileTemplateLiterals = exports.useMinify = exports.useFileName = exports.useSSR = exports.useDisplayName = void 0;

@@ -49,2 +49,8 @@ function getOption(_ref, name) {

exports.usePureAnnotation = usePureAnnotation;
exports.usePureAnnotation = usePureAnnotation;
var useCssProp = function useCssProp(state) {
return getOption(state, 'cssProp', true);
};
exports.useCssProp = useCssProp;

3

package.json
{
"version": "1.8.0",
"version": "1.9.0-0",
"name": "babel-plugin-styled-components",

@@ -30,2 +30,3 @@ "description": "Improve the debugging experience and add server-side rendering support to styled-components",

"@babel/helper-annotate-as-pure": "^7.0.0",
"@babel/plugin-syntax-jsx": "^7.0.0",
"lodash": "^4.17.10"

@@ -32,0 +33,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc