New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

purgecss-whitelister

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

purgecss-whitelister - npm Package Compare versions

Comparing version 2.3.1 to 2.4.0

17

index.js

@@ -1,7 +0,2 @@

/*
Forked from - https://github.com/salesforce-ux/scss-parser
Forked because there's no active maintenance and npm audit errors were killing me.
*/
const { parse } = require('scss-parser')
const parse2 = require('gonzales-pe').parse

@@ -38,3 +33,2 @@ const { readFileSync } = require('fs')

try {
// throw 'nope'
const parsedData = parse(fileContents).value

@@ -70,4 +64,3 @@ const selectors = parseStyleAST(parsedData)

function sanitizeArgs(arr) {
if (!Array.isArray(arr)) arr = [arr]
arr = arr.filter(Boolean)
arr = (Array.isArray(arr) ? arr : [arr]).filter(Boolean)

@@ -97,3 +90,2 @@ // Avoids errors if an empty array, no arguments, or falsey things are passed.

return arr.reduce((acc, { type, value }) => {
// Trigger recursion for types that need it.

@@ -105,6 +97,5 @@ if (shouldParse.includes(type)) {

} else if (shouldKeep.includes(type)) {
return value
.reduce((acc, { type, value }) => {
return (type === 'identifier' && !!value) ? acc.concat(value) : acc
}, acc)
return value.reduce((acc, { type, value }) => (
(type === 'identifier' && !!value) ? acc.concat(value) : acc
), acc)

@@ -111,0 +102,0 @@ // Concatenate a type's value if no iteration is needed.

{
"name": "purgecss-whitelister",
"version": "2.3.1",
"version": "2.4.0",
"description": "A utility for creating whitelists of CSS selectors for use with Purgecss.",

@@ -17,5 +17,5 @@ "main": "index.js",

"glob-all": "^3.1.0",
"gonzales-pe": "^4.2.3",
"scss-parser": "qodesmith/scss-parser"
"gonzales-pe": "^4.2.4",
"scss-parser": "1.0.3"
}
}
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