+70
| 2.2.0 / 2014-02-18 | ||
| ==== | ||
| * add `parsingErrors` to list errors when parsing with `silent: true` | ||
| * accept EOL characters and all other whitespace characters in `@` rules such | ||
| as `@media` | ||
| 2.1.0 / 2014-08-05 | ||
| ================== | ||
| * change error message format and add `.reason` property to errors | ||
| * add `inputSourcemaps` option to disable input source map processing | ||
| * use `inherits` for inheritance (fixes some browsers) | ||
| * add `sourcemap: 'generator'` option to return the `SourceMapGenerator` | ||
| object | ||
| 2.0.0 / 2014-06-18 | ||
| ================== | ||
| * add non-enumerable parent reference to each node | ||
| * drop Component(1) support | ||
| * add support for @custom-media, @host, and @font-face | ||
| * allow commas inside selector functions | ||
| * allow empty property values | ||
| * changed default options.position value to true | ||
| * remove comments from properties and values | ||
| * asserts when selectors are missing | ||
| * added node.position.content property | ||
| * absorb css-parse and css-stringify libraries | ||
| * apply original source maps from source files | ||
| 1.6.1 / 2014-01-02 | ||
| ================== | ||
| * fix component.json | ||
| 1.6.0 / 2013-12-21 | ||
| ================== | ||
| * update deps | ||
| 1.5.0 / 2013-12-03 | ||
| ================== | ||
| * update deps | ||
| 1.1.0 / 2013-04-04 | ||
| ================== | ||
| * update deps | ||
| 1.0.7 / 2012-11-21 | ||
| ================== | ||
| * fix component.json | ||
| 1.0.4 / 2012-11-15 | ||
| ================== | ||
| * update css-stringify | ||
| 1.0.3 / 2012-09-01 | ||
| ================== | ||
| * add component support | ||
| 0.0.1 / 2010-01-03 | ||
| ================== | ||
| * Initial release |
+9
| (The MIT License) | ||
| Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca> | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
| The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
+17
-11
@@ -59,7 +59,5 @@ // http://www.w3.org/TR/CSS21/grammar.html | ||
| var errorsList = []; | ||
| function error(msg) { | ||
| if (options.silent === true) { | ||
| return false; | ||
| } | ||
| var err = new Error(options.source + ':' + lineno + ':' + column + ': ' + msg); | ||
@@ -71,3 +69,8 @@ err.reason = msg; | ||
| err.source = css; | ||
| throw err; | ||
| if (options.silent) { | ||
| errorsList.push(err); | ||
| } else { | ||
| throw err; | ||
| } | ||
| } | ||
@@ -80,6 +83,9 @@ | ||
| function stylesheet() { | ||
| var rulesList = rules(); | ||
| return { | ||
| type: 'stylesheet', | ||
| stylesheet: { | ||
| rules: rules() | ||
| rules: rulesList, | ||
| parsingErrors: errorsList | ||
| } | ||
@@ -289,3 +295,3 @@ }; | ||
| var pos = position(); | ||
| var m = match(/^@([-\w]+)?keyframes */); | ||
| var m = match(/^@([-\w]+)?keyframes\s*/); | ||
@@ -349,3 +355,3 @@ if (!m) return; | ||
| var pos = position(); | ||
| var m = match(/^@host */); | ||
| var m = match(/^@host\s*/); | ||
@@ -397,3 +403,3 @@ if (!m) return; | ||
| var pos = position(); | ||
| var m = match(/^@custom-media (--[^\s]+) *([^{;]+);/); | ||
| var m = match(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/); | ||
| if (!m) return; | ||
@@ -470,3 +476,3 @@ | ||
| var pos = position(); | ||
| var m = match(/^@font-face */); | ||
| var m = match(/^@font-face\s*/); | ||
| if (!m) return; | ||
@@ -516,3 +522,3 @@ | ||
| function _compileAtrule(name) { | ||
| var re = new RegExp('^@' + name + ' *([^;\\n]+);'); | ||
| var re = new RegExp('^@' + name + '\\s*([^;]+);'); | ||
| return function() { | ||
@@ -519,0 +525,0 @@ var pos = position(); |
+1
-1
| { | ||
| "name": "css", | ||
| "version": "2.1.0", | ||
| "version": "2.2.0", | ||
| "description": "CSS parser / stringifier", | ||
@@ -5,0 +5,0 @@ "main": "index", |
+18
-5
@@ -35,2 +35,3 @@ # css [](https://travis-ci.org/reworkcss/css) | ||
| - indent: the string used to indent the output. Defaults to two spaces. | ||
| - compress: omit comments and extraneous whitespace. | ||
@@ -60,9 +61,19 @@ - sourcemap: return a sourcemap along with the CSS output. Using the `source` | ||
| Errors will have `error.position`, just like [`node.position`](#position). The | ||
| error contains the source position in the message. To get the error message | ||
| without the position use `error.reason`. | ||
| Errors thrown during parsing have the following properties: | ||
| - message: `String`. The full error message with the source position. | ||
| - reason: `String`. The error message without position. | ||
| - filename: `String` or `undefined`. The value of `options.source` if | ||
| passed to `css.parse`. Otherwise `undefined`. | ||
| - line: `Integer`. | ||
| - column: `Integer`. | ||
| - source: `String`. The portion of code that couldn't be parsed. | ||
| When parsing with the `silent` option, errors are listed in the | ||
| `parsingErrors` property of the [`stylesheet`](#stylesheet) node instead | ||
| of being thrown. | ||
| If you create any errors in plugins such as in | ||
| [rework](https://github.com/reworkcss/rework), you __must__ set the `position` | ||
| as well for consistency. | ||
| [rework](https://github.com/reworkcss/rework), you __must__ set the same | ||
| properties for consistency. | ||
@@ -119,2 +130,4 @@ ## AST | ||
| at-rule types. | ||
| - parsingErrors: `Array` of `Error`s. Errors collected during parsing when | ||
| option `silent` is true. | ||
@@ -121,0 +134,0 @@ #### rule |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
35058
10.33%11
22.22%1008
0.4%313
4.33%0
-100%