postcss-selector-parser
Advanced tools
Comparing version 2.2.2 to 2.2.3
@@ -624,2 +624,2 @@ # API Documentation | ||
* `loseless (boolean)`: false to normalize the selector whitespace, defaults to true | ||
* `lossless (boolean)`: false to normalize the selector whitespace, defaults to true |
@@ -0,1 +1,6 @@ | ||
# 2.2.3 | ||
* Resolves an issue where the parser would not reduce multiple spaces between an | ||
ampersand and another simple selector in lossy mode (thanks to @adam-26). | ||
# 2.2.2 | ||
@@ -2,0 +7,0 @@ |
@@ -194,3 +194,3 @@ 'use strict'; | ||
node.value = this.currToken[1]; | ||
} else if (this.currToken[0] === 'space' && !(this.lossy && this.prevToken[0] === '&')) { | ||
} else if (this.currToken[0] === 'space') { | ||
node.value = this.parseSpace(this.currToken[1], ' '); | ||
@@ -340,26 +340,24 @@ } | ||
if (this.currToken[0] === 'word') { | ||
(function () { | ||
var pseudo = void 0; | ||
_this.splitWord(false, function (first, length) { | ||
pseudoStr += first; | ||
pseudo = new _pseudo2.default({ | ||
value: pseudoStr, | ||
source: { | ||
start: { | ||
line: startingToken[2], | ||
column: startingToken[3] | ||
}, | ||
end: { | ||
line: _this.currToken[4], | ||
column: _this.currToken[5] | ||
} | ||
var pseudo = void 0; | ||
this.splitWord(false, function (first, length) { | ||
pseudoStr += first; | ||
pseudo = new _pseudo2.default({ | ||
value: pseudoStr, | ||
source: { | ||
start: { | ||
line: startingToken[2], | ||
column: startingToken[3] | ||
}, | ||
sourceIndex: startingToken[4] | ||
}); | ||
_this.newNode(pseudo); | ||
if (length > 1 && _this.nextToken && _this.nextToken[0] === '(') { | ||
_this.error('Misplaced parenthesis.'); | ||
} | ||
end: { | ||
line: _this.currToken[4], | ||
column: _this.currToken[5] | ||
} | ||
}, | ||
sourceIndex: startingToken[4] | ||
}); | ||
})(); | ||
_this.newNode(pseudo); | ||
if (length > 1 && _this.nextToken && _this.nextToken[0] === '(') { | ||
_this.error('Misplaced parenthesis.'); | ||
} | ||
}); | ||
} else { | ||
@@ -366,0 +364,0 @@ this.error('Unexpected "' + this.currToken[0] + '" found.'); |
@@ -24,3 +24,3 @@ 'use strict'; | ||
Processor.prototype.process = function process(selectors) { | ||
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
@@ -27,0 +27,0 @@ var input = new _parser2.default({ |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
@@ -42,3 +42,3 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _class() { | ||
var opts = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; | ||
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
@@ -52,6 +52,6 @@ _classCallCheck(this, _class); | ||
_opts$spaces = _opts$spaces === undefined ? {} : _opts$spaces; | ||
var _opts$spaces$before = _opts$spaces.before; | ||
var before = _opts$spaces$before === undefined ? '' : _opts$spaces$before; | ||
var _opts$spaces$after = _opts$spaces.after; | ||
var after = _opts$spaces$after === undefined ? '' : _opts$spaces$after; | ||
var _opts$spaces$before = _opts$spaces.before, | ||
before = _opts$spaces$before === undefined ? '' : _opts$spaces$before, | ||
_opts$spaces$after = _opts$spaces.after, | ||
after = _opts$spaces$after === undefined ? '' : _opts$spaces$after; | ||
@@ -88,3 +88,3 @@ this.spaces = { before: before, after: after }; | ||
_class.prototype.clone = function clone() { | ||
var overrides = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; | ||
var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
@@ -91,0 +91,0 @@ var cloned = cloneNode(this); |
{ | ||
"name": "postcss-selector-parser", | ||
"version": "2.2.2", | ||
"version": "2.2.3", | ||
"devDependencies": { | ||
"ava": "^0.16.0", | ||
"ava": "^0.17.0", | ||
"babel-cli": "^6.4.0", | ||
@@ -22,3 +22,3 @@ "babel-core": "^6.4.0", | ||
"minimist": "^1.2.0", | ||
"nyc": "^8.0.0" | ||
"nyc": "^10.0.0" | ||
}, | ||
@@ -25,0 +25,0 @@ "main": "dist/index.js", |
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
91278
1560