+10
-0
@@ -381,2 +381,12 @@ 'use strict' | ||
| let rootSource = this.result.root.source | ||
| if (opts.map === undefined && !(rootSource && rootSource.input && rootSource.input.map)) { | ||
| let result = '' | ||
| str(this.result.root, i => { | ||
| result += i | ||
| }) | ||
| this.result.css = result | ||
| return this.result | ||
| } | ||
| let map = new MapGenerator(str, this.result.root, this.result.opts) | ||
@@ -383,0 +393,0 @@ let data = map.generate() |
+1
-1
@@ -10,3 +10,3 @@ 'use strict' | ||
| constructor(plugins = []) { | ||
| this.version = '8.5.10' | ||
| this.version = '8.5.11' | ||
| this.plugins = this.normalize(plugins) | ||
@@ -13,0 +13,0 @@ } |
+44
-20
@@ -40,7 +40,8 @@ 'use strict' | ||
| atrule(node, semicolon) { | ||
| let raws = node.raws | ||
| let name = '@' + node.name | ||
| let params = node.params ? this.rawValue(node, 'params') : '' | ||
| if (typeof node.raws.afterName !== 'undefined') { | ||
| name += node.raws.afterName | ||
| if (typeof raws.afterName !== 'undefined') { | ||
| name += raws.afterName | ||
| } else if (params) { | ||
@@ -53,3 +54,3 @@ name += ' ' | ||
| } else { | ||
| let end = (node.raws.between || '') + (semicolon ? ';' : '') | ||
| let end = (raws.between || '') + (semicolon ? ';' : '') | ||
| this.builder(escapeHTMLInCSS(name + params + end), node) | ||
@@ -89,3 +90,6 @@ } | ||
| block(node, start) { | ||
| let between = this.raw(node, 'between', 'beforeOpen') | ||
| let raws = node.raws | ||
| let between = typeof raws.between !== 'undefined' | ||
| ? raws.between | ||
| : this.raw(node, 'between', 'beforeOpen') | ||
| this.builder(escapeHTMLInCSS(start + between) + '{', node, 'start') | ||
@@ -96,5 +100,9 @@ | ||
| this.body(node) | ||
| after = this.raw(node, 'after') | ||
| after = typeof raws.after !== 'undefined' | ||
| ? raws.after | ||
| : this.raw(node, 'after') | ||
| } else { | ||
| after = this.raw(node, 'after', 'emptyBody') | ||
| after = typeof raws.after !== 'undefined' | ||
| ? raws.after | ||
| : this.raw(node, 'after', 'emptyBody') | ||
| } | ||
@@ -107,5 +115,6 @@ | ||
| body(node) { | ||
| let last = node.nodes.length - 1 | ||
| let nodes = node.nodes | ||
| let last = nodes.length - 1 | ||
| while (last > 0) { | ||
| if (node.nodes[last].type !== 'comment') break | ||
| if (nodes[last].type !== 'comment') break | ||
| last -= 1 | ||
@@ -116,5 +125,8 @@ } | ||
| let isDocument = node.type === 'document' | ||
| for (let i = 0; i < node.nodes.length; i++) { | ||
| let child = node.nodes[i] | ||
| let before = this.raw(child, 'before') | ||
| for (let i = 0; i < nodes.length; i++) { | ||
| let child = nodes[i] | ||
| let before = child.raws.before | ||
| if (typeof before === 'undefined') { | ||
| before = this.raw(child, 'before') | ||
| } | ||
| if (before) this.builder(isDocument ? before : escapeHTMLInCSS(before)) | ||
@@ -126,4 +138,9 @@ this.stringify(child, last !== i || semicolon) | ||
| comment(node) { | ||
| let left = this.raw(node, 'left', 'commentLeft') | ||
| let right = this.raw(node, 'right', 'commentRight') | ||
| let raws = node.raws | ||
| let left = typeof raws.left !== 'undefined' | ||
| ? raws.left | ||
| : this.raw(node, 'left', 'commentLeft') | ||
| let right = typeof raws.right !== 'undefined' | ||
| ? raws.right | ||
| : this.raw(node, 'right', 'commentRight') | ||
| this.builder(escapeHTMLInCSS('/*' + left + node.text + right + '*/'), node) | ||
@@ -133,7 +150,14 @@ } | ||
| decl(node, semicolon) { | ||
| let between = this.raw(node, 'between', 'colon') | ||
| let string = node.prop + between + this.rawValue(node, 'value') | ||
| let raws = node.raws | ||
| let between = typeof raws.between !== 'undefined' | ||
| ? raws.between | ||
| : this.raw(node, 'between', 'colon') | ||
| let rawVal = raws.value | ||
| let value = rawVal && rawVal.value === node.value ? rawVal.raw : node.value | ||
| let string = node.prop + between + value | ||
| if (node.important) { | ||
| string += node.raws.important || ' !important' | ||
| string += raws.important || ' !important' | ||
| } | ||
@@ -178,5 +202,5 @@ | ||
| let root = node.root() | ||
| if (!root.rawCache) root.rawCache = {} | ||
| if (typeof root.rawCache[detect] !== 'undefined') { | ||
| return root.rawCache[detect] | ||
| let cache = root.rawCache || (root.rawCache = {}) | ||
| if (typeof cache[detect] !== 'undefined') { | ||
| return cache[detect] | ||
| } | ||
@@ -200,3 +224,3 @@ | ||
| root.rawCache[detect] = value | ||
| cache[detect] = value | ||
| return value | ||
@@ -203,0 +227,0 @@ } |
+4
-0
@@ -39,2 +39,3 @@ 'use strict' | ||
| let returned = [] | ||
| let lastBadParen = -1 | ||
@@ -131,2 +132,4 @@ function position() { | ||
| pos = next | ||
| } else if (pos <= lastBadParen) { | ||
| currentToken = ['(', '(', pos] | ||
| } else { | ||
@@ -137,2 +140,3 @@ next = css.indexOf(')', pos + 1) | ||
| if (next === -1 || RE_BAD_BRACKET.test(content)) { | ||
| lastBadParen = next === -1 ? length : next | ||
| currentToken = ['(', '(', pos] | ||
@@ -139,0 +143,0 @@ } else { |
+1
-1
| { | ||
| "name": "postcss", | ||
| "version": "8.5.10", | ||
| "version": "8.5.11", | ||
| "description": "Tool for transforming styles with JS plugins", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
205322
0.53%7057
0.5%