Comparing version 1.6.0 to 1.7.0
@@ -58,2 +58,3 @@ | ||
var err = new Error(msg + ' near line ' + lineno + ':' + column); | ||
err.filename = options.source; | ||
err.line = lineno; | ||
@@ -184,3 +185,3 @@ err.column = column; | ||
// prop | ||
var prop = match(/^(\*?[-\/\*\w]+(\[[0-9a-z_-]+\])?)\s*/); | ||
var prop = match(/^(\*?[-#\/\*\w]+(\[[0-9a-z_-]+\])?)\s*/); | ||
if (!prop) return; | ||
@@ -455,2 +456,4 @@ prop = trim(prop[0]); | ||
function atrule() { | ||
if (css[0] != '@') return; | ||
return atkeyframes() | ||
@@ -493,3 +496,3 @@ || atmedia() | ||
function trim(str) { | ||
return (str || '').replace(/^\s+|\s+$/g, ''); | ||
return str ? str.replace(/^\s+|\s+$/g, '') : ''; | ||
} |
{ | ||
"name": "css-parse", | ||
"version": "1.6.0", | ||
"version": "1.7.0", | ||
"description": "CSS parser", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -0,6 +1,27 @@ | ||
# css-parse [![Build Status](https://travis-ci.org/visionmedia/css-parse.png)](https://travis-ci.org/visionmedia/css-parse) | ||
# css-parse | ||
JavaScript CSS parser for nodejs and the browser. | ||
## Installation | ||
$ npm install css-parse | ||
## Usage | ||
````javascript | ||
var parse = require('css-parse'); | ||
// CSS input string | ||
var css = "body { \n background-color: #fff;\n }"; | ||
var output_obj = parse(css); | ||
// Position and Source parameters | ||
var output_obj_pos = parse(css, { position: true, source: 'file.css' }); | ||
// Print parsed object as CSS string | ||
console.log(JSON.stringify(output_obj, null, 2)); | ||
```` | ||
## Example | ||
@@ -114,4 +135,9 @@ | ||
## Related | ||
[css-stringify](https://github.com/visionmedia/css-stringify "CSS-Stringify") | ||
[css-value](https://github.com/visionmedia/css-value "CSS-Value") | ||
## License | ||
MIT |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
11427
381
143
1