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

style-deps

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

style-deps - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

19

lib/inline-imports.js

@@ -23,3 +23,3 @@ //

function inlineImports(filename, opts, rules, done) {
function inlineImports(filename, opts, ast, done) {
filename = path.resolve(filename)

@@ -40,3 +40,3 @@

// for import statements
transform(rules, transforms, function(err, rules) {
transform(ast, transforms, function(err, rules) {
if (err) return done(err)

@@ -53,3 +53,6 @@

// and @document statements etc.
inlineImports(filename, opts, rule.rules, function(err, updated) {
inlineImports(filename, opts, {
stylesheet: { rules: rule.rules }
, type: 'stylesheet'
}, function(err, updated) {
if (err) return next(err)

@@ -67,3 +70,7 @@ rule.rules = updated || rule.rules

function transform(rules, transforms, done) {
function transform(ast, transforms, done) {
if (!transforms.length) {
return done(null, ast.stylesheet.rules)
}
var transform = styleTransform(

@@ -74,3 +81,3 @@ filename

from([rules], {
from([ast], {
objectMode: true

@@ -80,3 +87,3 @@ }).pipe(transform)

.once('data', function(ast) {
return done(null, ast)
return done(null, ast.stylesheet.rules)
})

@@ -83,0 +90,0 @@ }

@@ -37,4 +37,4 @@ //

done(null, ast.stylesheet.rules)
done(null, ast)
}
}

@@ -23,2 +23,17 @@ var pipeline = require('ast-pipeline')

if (Array.isArray(ast)) {
throw new Error(
'Looks as if you\'ve passed an array on from ' +
'your transform. You should wrap it up in a ' +
'stylesheet object, e.g. { stylesheet: { rules: [rules] } }'
)
}
if (!ast.stylesheet) {
throw new Error(
'CSS AST of "' + filename +
'" appears to be missing a `stylesheet` property'
)
}
tr(ast.stylesheet, function(err, stylesheet) {

@@ -25,0 +40,0 @@ if (err) return done(err)

{
"name": "style-deps",
"version": "1.0.0",
"version": "1.0.1",
"description": "Traverse the dependency graph of a CSS project using npm-style import statements",

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

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