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.2 to 2.0.3

16

dist/css-selectors.js

@@ -5,2 +5,16 @@ const whitespaceList = [' ', '\n', '\r', '\t', '\f', '\v'];

// parses:
const isNotEmptyExpression = (expression) => (!!expression // not `undefined`|`null`|`false`|emptyString
&&
(expression !== true) // not `true`
);
const joinExpressions = (expressions) => {
if (!Array.isArray(expressions)) {
if (isNotEmptyExpression(expressions))
return expressions;
return '';
} // if
return (expressions.flat(Infinity)
.filter(isNotEmptyExpression)
.join(','));
};
class ParseSelectors {

@@ -445,3 +459,3 @@ //#region private fields

constructor(expressions) {
this.#expression = [expressions].flat(Infinity).filter((exp) => (typeof (exp) === 'string') && (exp !== '')).join(',');
this.#expression = joinExpressions(expressions);
this.#expressionLength = this.#expression.length;

@@ -448,0 +462,0 @@ this.#pos = 0;

5

package.json
{
"name": "@cssfn/css-selectors",
"version": "2.0.2",
"version": "2.0.3",
"description": "Manipulates css selector - parse, transform, calculate specificity, and more.",

@@ -33,4 +33,3 @@ "keywords": [

"@cssfn/types": "^2.0.1"
},
"gitHead": "34d5af25d0ea66caecd79d9b575e7baf8a3a4116"
}
}

@@ -82,2 +82,22 @@ // cssfn:

// parses:
const isNotEmptyExpression = (expression: OptionalOrBoolean<string>): expression is string => (
!!expression // not `undefined`|`null`|`false`|emptyString
&&
(expression !== true) // not `true`
);
const joinExpressions = (expressions: SingleOrDeepArray<OptionalOrBoolean<string>>): string => {
if (!Array.isArray(expressions)) {
if (isNotEmptyExpression(expressions)) return expressions;
return '';
} // if
return (
((expressions as any).flat(Infinity) as OptionalOrBoolean<string>[])
.filter(isNotEmptyExpression)
.join(',')
);
};
class ParseSelectors {

@@ -516,3 +536,3 @@ //#region private fields

constructor(expressions: SingleOrDeepArray<OptionalOrBoolean<string>>) {
this.#expression = (([expressions] as any).flat(Infinity) as OptionalOrBoolean<string>[]).filter((exp) => (typeof(exp) === 'string') && (exp !== '')).join(',');
this.#expression = joinExpressions(expressions);
this.#expressionLength = this.#expression.length;

@@ -519,0 +539,0 @@ this.#pos = 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