Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

postcss

Package Overview
Dependencies
Maintainers
1
Versions
279
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss - npm Package Compare versions

Comparing version
8.5.10
to
8.5.11
+10
-0
lib/lazy-result.js

@@ -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 @@ }

@@ -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 @@ }

@@ -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 {

{
"name": "postcss",
"version": "8.5.10",
"version": "8.5.11",
"description": "Tool for transforming styles with JS plugins",

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