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

css-styles

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-styles - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

8

index.js

@@ -9,4 +9,8 @@ const camelcase = require('camelcase')

if (!declaration) return memo
const parts = declaration.split(':')
memo[camelcase(parts[0])] = parts[1].trim()
var keyEndIndex = declaration.indexOf(':')
const key = declaration.substring(0, keyEndIndex)
const prop = declaration.substring(keyEndIndex + 1).trim()
memo[camelcase(key)] = prop
return memo

@@ -13,0 +17,0 @@ }, {})

{
"name": "css-styles",
"description": "Parse and stringify inlined CSS declarations",
"version": "1.0.1",
"version": "1.0.2",
"main": "index.js",

@@ -6,0 +6,0 @@ "scripts": {

@@ -7,6 +7,9 @@ const test = require('tape')

var styles = cssStyles.parse('background: #bada55; font-size: 12px')
var styles = cssStyles.parse(
'color: #bada55; background: url(https://test.com/example.jpg); font-size: 12px'
)
t.deepEqual(styles, {
background: '#bada55',
background: 'url(https://test.com/example.jpg)',
color: '#bada55',
fontSize: '12px'

@@ -13,0 +16,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