Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-styl

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-styl - npm Package Compare versions

Comparing version 0.5.6 to 0.5.7

35

lib/parser/index.js

@@ -1542,2 +1542,3 @@ "use strict"

let bodyStartIndex = null
let openBraceIndex = null
if (!hasBrace) {

@@ -1566,8 +1567,12 @@ // stylus style selector

// ^
const braceIndex = beforeBlockNodeEndIndex + checkBrase[0].length
bodyStartIndex = braceIndex + 1
startIndex = braceIndex
openBraceIndex = beforeBlockNodeEndIndex + checkBrase[0].length
bodyStartIndex = openBraceIndex + 1
startIndex = openBraceIndex
}
const endIndex = this.getBlockEndIndex(bodyStartIndex, parent, info)
const endIndex = this.getBlockEndIndex(bodyStartIndex, parent, {
hasBrace,
info,
openBraceIndex,
})
const bodyText = this.sourceCode.text.slice(

@@ -1606,3 +1611,7 @@ bodyStartIndex,

getBlockEndIndex(_bodyStartIndex, parent, info) {
getBlockEndIndex(
_bodyStartIndex,
parent,
{ hasBrace, openBraceIndex, info }
) {
const parentEndIndex = this.sourceCode.getIndex(

@@ -1624,2 +1633,18 @@ parent.source.endChildren || parent.source.end || this.sourceEnd

}
if (hasBrace) {
const cursor = this.sourceCode.createScopeTokenCursor(
openBraceIndex,
{
endLocationIndex: parentEndIndex,
}
)
let token = cursor.next()
while (token) {
if (cursor.scopeLevel === 1 && token.value === "}") {
return token.range[0]
}
token = cursor.next()
}
}
const { startIndex } = parseRawAfter(this.sourceCode, parentEndIndex, {

@@ -1626,0 +1651,0 @@ blockCommentIsRaw: false,

14

lib/parser/locations.js

@@ -72,5 +72,13 @@ "use strict"

if (sourceCode.text[index] === "}") {
if (node.nodes[0]) {
return this.getStartIndex(sourceCode, node.nodes[0])
const c = sourceCode.text[index]
if (c === "}" || c === "{") {
// The index may shift if the selector is next to the brace.
const firstChild = node.nodes[0]
if (
firstChild &&
getName(firstChild) === "selector" &&
firstChild.column === node.column + 1 &&
firstChild.line === node.line
) {
return this.getStartIndex(sourceCode, firstChild)
}

@@ -77,0 +85,0 @@ }

{
"name": "postcss-styl",
"version": "0.5.6",
"version": "0.5.7",
"description": "PostCSS parser plugin for converting Stylus syntax to PostCSS AST.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc