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

@cssfn/cssfn

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cssfn/cssfn - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

39

dist/cssfn.js

@@ -135,3 +135,6 @@ // jss:

// nested rules:
nestedSelector.includes('&')
((nestedSelector !== '&') // ignore only_parentSelector
&&
nestedSelector.includes('&') // nested rule
)
||

@@ -165,13 +168,27 @@ // conditional rules & globals:

//#endregion merge duplicates (nested) Rule to unique ones
//#region merge only_parentSelector into current style
const parentSelector = groupByNested.get('&')?.pop(); // remove & get the last member in parentSelector group
if (parentSelector) {
const parentStyles = style[parentSelector];
const mergedParentStyles = mergeStyles(parentStyles);
if (mergedParentStyles) {
mergeLiteral(style, mergedParentStyles); // merge into current style
delete style[parentSelector]; // merged => delete source
//#region merge only_parentSelector to current style
let moveNestedRules = false;
for (const sym of Object.getOwnPropertySymbols(style)) {
if (sym.description === '&') {
/* move the CssProps and (nested)Rules from only_parentSelector to current style */
const parentStyles = style[sym];
const mergedParentStyles = mergeStyles(parentStyles);
if (mergedParentStyles) {
if (!moveNestedRules) {
const hasNestedRule = !!Object.getOwnPropertySymbols(mergedParentStyles).length;
if (hasNestedRule)
moveNestedRules = true;
} // if
mergeLiteral(style, mergedParentStyles); // merge into current style
delete style[sym]; // merged => delete source
} // if
}
else if (moveNestedRules) {
/* preserve the order of another (nested)Rules */
const nestedStyles = style[sym]; // backup
delete style[sym]; // delete
style[sym] = nestedStyles; // restore (re-insert at the last order)
} // if
} // if
//#endregion merge only_parentSelector into current style
} // for
//#endregion merge only_parentSelector to current style
return style;

@@ -178,0 +195,0 @@ };

{
"name": "@cssfn/cssfn",
"version": "1.0.9",
"version": "1.0.10",
"description": "Writes CSS in javascript function.",

@@ -5,0 +5,0 @@ "type": "module",

@@ -291,3 +291,7 @@ // jss:

// nested rules:
nestedSelector.includes('&')
(
(nestedSelector !== '&') // ignore only_parentSelector
&&
nestedSelector.includes('&') // nested rule
)
||

@@ -333,13 +337,35 @@ // conditional rules & globals:

//#region merge only_parentSelector into current style
const parentSelector = groupByNested.get('&')?.pop(); // remove & get the last member in parentSelector group
if (parentSelector) {
const parentStyles = style[parentSelector];
const mergedParentStyles = mergeStyles(parentStyles);
if (mergedParentStyles) {
mergeLiteral(style, mergedParentStyles); // merge into current style
delete style[parentSelector]; // merged => delete source
//#region merge only_parentSelector to current style
let moveNestedRules = false;
for (const sym of Object.getOwnPropertySymbols(style)) {
if (sym.description === '&') {
/* move the CssProps and (nested)Rules from only_parentSelector to current style */
const parentStyles = style[sym];
const mergedParentStyles = mergeStyles(parentStyles);
if (mergedParentStyles) {
if (!moveNestedRules) {
const hasNestedRule = !!Object.getOwnPropertySymbols(mergedParentStyles).length;
if (hasNestedRule) moveNestedRules = true;
} // if
mergeLiteral(style, mergedParentStyles); // merge into current style
delete style[sym]; // merged => delete source
} // if
}
else if (moveNestedRules) {
/* preserve the order of another (nested)Rules */
const nestedStyles = style[sym]; // backup
delete style[sym]; // delete
style[sym] = nestedStyles; // restore (re-insert at the last order)
} // if
} // if
//#endregion merge only_parentSelector into current style
} // for
//#endregion merge only_parentSelector to current style

@@ -346,0 +372,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