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

stylis-rule-sheet

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stylis-rule-sheet - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

36

index.js

@@ -11,2 +11,3 @@ (function (factory) {

var stack = []
var children = []

@@ -19,21 +20,26 @@ function toString (selectors, content) {

switch (context) {
// property context
case 1:
return
// selector context
case 2:
// @at-rule context
// @at-rule content?
if (at > 0)
return
// #a { #b {}} ?
if (depth > 1)
return stack.push(toString(selectors, content)), ''
switch (depth) {
// normal {}
case 1:
stack.push(toString(selectors, content))
callback(toString(selectors, content))
if (stack.length > 0) {
stack.forEach(callback)
stack = []
if (children.length > 0)
children = (stack.push.apply(stack, children), [])
break
// flat/nested
default:
children.push(toString(selectors, content))
}
return ''
// @at-rule context
case 3:

@@ -45,3 +51,3 @@ switch (at) {

case 112:
return callback(selectors[0]+content), ''
stack.push(selectors[0]+content)
// @viewport

@@ -53,7 +59,13 @@ // @counter-style

case 100:
return
break
default:
return callback(toString(selectors, content)), ''
stack.push(toString(selectors, content))
}
return ''
// post process context
case -2:
children.forEach(callback)
stack.forEach(callback)
children = []
stack = []

@@ -60,0 +72,0 @@ }

@@ -5,3 +5,3 @@ {

"description": "stylis plugin to extract individual rules to use with insertRule API",
"version": "0.0.1",
"version": "0.0.2",
"homepage": "https://github.com/thysultan/stylis.js",

@@ -8,0 +8,0 @@ "license": "MIT",

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