postcss-selector-parser
Advanced tools
+5
-1
@@ -1,3 +0,7 @@ | ||
| # 6.1.3 | ||
| # 6.1.4 - 2026-06-11 | ||
| - fix: tolerate non-node children when serializing selectors | ||
| # 6.1.3 - 2026-06-11 | ||
| - Fix [CVE-2026-9358](https://github.com/advisories/GHSA-w9m9-85wc-3x92) (NVD) / SNYK-JS-POSTCSSSELECTORPARSER-16873882 via backport of ([#316](https://github.com/postcss/postcss-selector-parser/pull/316) by [@MoOx](https://github.com/MoOx)) | ||
@@ -4,0 +8,0 @@ |
@@ -303,5 +303,16 @@ "use strict"; | ||
| _proto._stringify = function _stringify(options, depth, max) { | ||
| var _this10 = this; | ||
| return this.map(function (child) { | ||
| return child._stringify(options, depth, max); | ||
| return _this10._stringifyChild(child, options, depth, max); | ||
| }).join(''); | ||
| } | ||
| // Serialize a child node. Historically `toString` used `this.map(String)`, | ||
| // which leniently coerced anything — including raw arrays inserted via | ||
| // `replaceWith(array)` / `insertBefore` / `insertAfter` (e.g. Tailwind's | ||
| // `:merge()` expansion). Fall back to `String(child)` for values that are | ||
| // not parser nodes so that behaviour is preserved. | ||
| ; | ||
| _proto._stringifyChild = function _stringifyChild(child, options, depth, max) { | ||
| return typeof child._stringify === 'function' ? child._stringify(options, depth, max) : String(child); | ||
| }; | ||
@@ -308,0 +319,0 @@ _createClass(Container, [{ |
@@ -20,2 +20,3 @@ "use strict"; | ||
| _proto._stringify = function _stringify(options, depth, max) { | ||
| var _this2 = this; | ||
| if (depth >= max) { | ||
@@ -25,3 +26,3 @@ throw new Error("Cannot serialize selector: nesting depth exceeds the maximum of " + max + "."); | ||
| var params = this.length ? '(' + this.map(function (child) { | ||
| return child._stringify(options, depth + 1, max); | ||
| return _this2._stringifyChild(child, options, depth + 1, max); | ||
| }).join(',') + ')' : ''; | ||
@@ -28,0 +29,0 @@ return [this.rawSpaceBefore, this.stringifyProperty("value"), params, this.rawSpaceAfter].join(''); |
@@ -24,4 +24,5 @@ "use strict"; | ||
| _proto._stringify = function _stringify(options, depth, max) { | ||
| var _this2 = this; | ||
| var str = this.reduce(function (memo, selector) { | ||
| memo.push(selector._stringify(options, depth, max)); | ||
| memo.push(_this2._stringifyChild(selector, options, depth, max)); | ||
| return memo; | ||
@@ -28,0 +29,0 @@ }, []).join(','); |
+1
-1
| { | ||
| "version": "6.1.3", | ||
| "version": "6.1.4", | ||
| "name": "postcss-selector-parser", | ||
@@ -4,0 +4,0 @@ "description": "Selector parser with built in methods for working with selector strings.", |
192118
0.4%3655
0.33%