Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

styled-components

Package Overview
Dependencies
Maintainers
2
Versions
358
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

styled-components - npm Package Compare versions

Comparing version 0.1.6 to 0.1.7

lib/utils/test/validAttr.test.js

14

lib/models/StyledComponent.js

@@ -11,4 +11,2 @@ 'use strict';

var _HTMLDOMPropertyConfig = require('react/lib/HTMLDOMPropertyConfig');
var _ComponentStyle = require('../models/ComponentStyle');

@@ -18,2 +16,6 @@

var _validAttr = require('../utils/validAttr');
var _validAttr2 = _interopRequireDefault(_validAttr);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -64,2 +66,3 @@

}
/* eslint-disable react/prop-types */

@@ -76,10 +79,7 @@

// const contextForStyles
var propsForElement = {};
/* Don't pass through non HTML tags through to HTML elements */
Object.keys(this.props).filter(function (propName) {
return (
/* Don't pass through non HTML tags through to HTML elements */
!isTag || _HTMLDOMPropertyConfig.Properties[propName] !== undefined
);
return !isTag || (0, _validAttr2.default)(propName);
}).forEach(function (propName) {

@@ -86,0 +86,0 @@ propsForElement[propName] = _this3.props[propName];

{
"name": "styled-components",
"version": "0.1.6",
"version": "0.1.7",
"description": "",

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

// @flow
import { Component, createElement, PropTypes } from 'react'
import { Properties as ValidAttrs } from 'react/lib/HTMLDOMPropertyConfig'
import type RuleSet from '../utils/flatten'
import ComponentStyle from '../models/ComponentStyle'
import validAttr from '../utils/validAttr'
import type RuleSet from '../utils/flatten'
export default (tagName: any, rules: RuleSet) => {

@@ -19,5 +20,7 @@ const isTag = typeof tagName === 'string'

}
componentWillMount() {
this.componentWillReceiveProps(this.props, this.context)
}
componentWillReceiveProps(newProps: Object, newContext: ?any) {

@@ -33,2 +36,3 @@ this.theme = newContext ? newContext.theme : {} // pass through theme

}
/* eslint-disable react/prop-types */

@@ -38,10 +42,9 @@ render() {

// const contextForStyles
const propsForElement = {}
Object.keys(this.props).filter(propName => (
/* Don't pass through non HTML tags through to HTML elements */
!isTag || ValidAttrs[propName] !== undefined
)).forEach(propName => {
propsForElement[propName] = this.props[propName]
})
/* Don't pass through non HTML tags through to HTML elements */
Object.keys(this.props)
.filter(propName => !isTag || validAttr(propName))
.forEach(propName => {
propsForElement[propName] = this.props[propName]
})
propsForElement.className = [className, this.generatedClassName].filter(x => x).join(' ')

@@ -48,0 +51,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