Socket
Socket
Sign inDemoInstall

css-tree

Package Overview
Dependencies
1
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0-alpha12 to 1.0.0-alpha13

7

HISTORY.md

@@ -0,1 +1,8 @@

## 1.0.0-alpha13 (January 19, 2017)
- Changed location storing in `SyntaxMatchError`
- Changed property to store mismatch offset to `mismatchOffset`
- Changed `offset` property to store bad node offset in source CSS if any
- Added `loc` property that stores bad node `loc` if any
## 1.0.0-alpha12 (January 19, 2017)

@@ -2,0 +9,0 @@

28

lib/syntax/error.js

@@ -19,2 +19,12 @@ 'use strict';

function getLocation(node, point) {
var loc = node && node.loc && node.loc[point];
return loc
? { offset: loc.offset,
line: loc.line,
column: loc.column }
: null;
}
var SyntaxParseError = function(message, syntaxStr, offset) {

@@ -36,2 +46,5 @@ var error = new SyntaxError();

var css = '';
var error = new SyntaxError(message);
var start = getLocation(badNode, 'start');
var end = getLocation(badNode, 'end');

@@ -50,3 +63,2 @@ value.children.each(function(node) {

var error = new SyntaxError(message);
error.name = 'SyntaxMatchError';

@@ -56,9 +68,15 @@ error.rawMessage = message;

error.css = css;
error.line = badNode && badNode.loc && badNode.loc.start ? badNode.loc.start.line : undefined;
error.column = badNode && badNode.loc && badNode.loc.start ? badNode.loc.start.column : undefined;
error.offset = errorOffset;
error.mismatchOffset = errorOffset;
error.loc = {
source: badNode && badNode.loc && badNode.loc.source || '<unknown>',
start: start,
end: end
};
error.line = start ? start.line : undefined;
error.column = start ? start.column : undefined;
error.offset = start ? start.offset : undefined;
error.message = message + '\n' +
' syntax: ' + error.syntax + '\n' +
' value: ' + (error.css || '<empty string>') + '\n' +
' --------' + new Array(error.offset + 1).join('-') + '^';
' --------' + new Array(error.mismatchOffset + 1).join('-') + '^';

@@ -65,0 +83,0 @@ return error;

2

package.json
{
"name": "css-tree",
"version": "1.0.0-alpha12",
"version": "1.0.0-alpha13",
"description": "Fast detailed CSS parser",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc