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

class-styles

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

class-styles - npm Package Compare versions

Comparing version 1.0.0-rc.2 to 1.0.0-rc.3

4

HISTORY.md
# Changelog
## v1.0.0-rc.3
Now can be bound to an object or an array of objects (but not window or global)
## v1.0.0-rc.2

@@ -4,0 +8,0 @@

14

index.js

@@ -15,6 +15,9 @@ /*!

function classStyles () {
var styles = [];
var styles = [],
stylesArray = Array.isArray(this) ? this : [this]
if (!Array.isArray(this))
throw new Error('classStyles must be bound to an array of style objects')
if ((typeof window !== 'undefined' && this === window)
|| (typeof global !== 'undefined' && this === global)) {
throw new Error('classStyles must be bound to an object, or an array of objects')
}

@@ -37,3 +40,4 @@ for (var i = 0; i < arguments.length; i++) {

// styles is now an array of strings (for lookups) and objects (for folding)
// styles is now an array of strings (for lookups then folding) and objects
// (for folding)

@@ -44,3 +48,3 @@ return styles.reduce(

: objectAssign(result,
this.reduce((keyResult, boundStyle) => objectAssign(keyResult, boundStyle[style]), {})
stylesArray.reduce((keyResult, boundStyle) => objectAssign(keyResult, boundStyle[style]), {})
)

@@ -47,0 +51,0 @@ ), {})

{
"name": "class-styles",
"version": "1.0.0-rc.2",
"version": "1.0.0-rc.3",
"description": "A simple utility for folding style objects like css classes",

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

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