Comparing version 1.0.1 to 1.0.2
@@ -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 @@ }) |
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
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
3233
47