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

postcss-sorting

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-sorting - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

3

CHANGELOG.md

@@ -5,2 +5,5 @@ # Change Log

## 1.3.1
* Fix adding additional empty line if both `empty-lines-between-children-rules` and `empty-lines-between-media-rules` are not 0. #19
## 1.3.0

@@ -7,0 +10,0 @@ * Added `empty-lines-between-media-rules` option which set a number of empty lines between nested media rules. #16

14

index.js

@@ -184,16 +184,12 @@ var postcss = require('postcss');

function getApplicableNode(node) {
function getApplicableNode(lookFor, node) {
// find if there any rules before, and skip the comments
var prevNode = node.prev();
if (prevNode.type === 'rule') {
if (prevNode.type === lookFor) {
return node;
}
if (prevNode.type === 'atrule') {
return node;
}
if (prevNode.type === 'comment') {
return getApplicableNode(prevNode);
return getApplicableNode(lookFor, prevNode);
}

@@ -290,3 +286,3 @@

// between rules can be comments, so empty lines should be added to first comment between rules, rather than to rule
applicableNode = getApplicableNode(node);
applicableNode = getApplicableNode('rule', node);

@@ -301,3 +297,3 @@ if (applicableNode) {

// between rules can be comments, so empty lines should be added to first comment between rules, rather than to rule
applicableNode = getApplicableNode(node);
applicableNode = getApplicableNode('atrule', node);

@@ -304,0 +300,0 @@ if (applicableNode) {

{
"name": "postcss-sorting",
"version": "1.3.0",
"version": "1.3.1",
"description": "PostCSS plugin to sort rules content with specified order.",

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

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