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

@cssfn/css-selectors

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

@cssfn/css-selectors - npm Package Compare versions

Comparing version 2.0.4 to 2.0.5

22

dist/css-selectors.js

@@ -9,10 +9,22 @@ const whitespaceList = [' ', '\n', '\r', '\t', '\f', '\v'];

);
function* unwrapExpressions(expressions) {
for (const expression of expressions) {
if (!Array.isArray(expression)) {
if (!isNotEmptyExpression(expression))
continue; // falsy or empty string => ignore
yield expression;
continue;
} // if
for (const subExpression of unwrapExpressions(expression)) {
yield subExpression;
} // for
} // for
}
const joinExpressions = (expressions) => {
if (!Array.isArray(expressions)) {
if (isNotEmptyExpression(expressions))
return expressions;
return '';
if (!isNotEmptyExpression(expressions))
return ''; // falsy or empty string => empty result
return expressions;
} // if
return (expressions.flat(Infinity)
.filter(isNotEmptyExpression)
return (Array.from(unwrapExpressions(expressions))
.join(','));

@@ -19,0 +31,0 @@ };

{
"name": "@cssfn/css-selectors",
"version": "2.0.4",
"version": "2.0.5",
"description": "Manipulates css selector - parse, transform, calculate specificity, and more.",

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

@@ -5,2 +5,3 @@ // cssfn:

SingleOrArray,
DeepArray,
SingleOrDeepArray,

@@ -88,6 +89,21 @@ } from '@cssfn/types'

);
function* unwrapExpressions(expressions: DeepArray<OptionalOrBoolean<string>>): Generator<string> {
for (const expression of expressions) {
if (!Array.isArray(expression)) {
if (!isNotEmptyExpression(expression)) continue; // falsy or empty string => ignore
yield expression;
continue;
} // if
for (const subExpression of unwrapExpressions(expression)) {
yield subExpression;
} // for
} // for
}
const joinExpressions = (expressions: SingleOrDeepArray<OptionalOrBoolean<string>>): string => {
if (!Array.isArray(expressions)) {
if (isNotEmptyExpression(expressions)) return expressions;
return '';
if (!isNotEmptyExpression(expressions)) return ''; // falsy or empty string => empty result
return expressions;
} // if

@@ -98,4 +114,3 @@

return (
((expressions as any).flat(Infinity) as OptionalOrBoolean<string>[])
.filter(isNotEmptyExpression)
Array.from(unwrapExpressions(expressions))
.join(',')

@@ -102,0 +117,0 @@ );

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