Socket
Socket
Sign inDemoInstall

directory-encoder

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

directory-encoder - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

30

lib/directory-encoder.js

@@ -53,3 +53,11 @@ /*global require:true*/

// append each selector
this.files.forEach(function( filepath ) {
this.files.filter(function( filepath ){
var file = path.basename( filepath ),
extension = path.extname( file );
return extension === ".svg" || extension === ".png";
})
.filter(function( filepath ){
return fs.lstatSync( filepath ).isFile();
})
.forEach(function( filepath ) {
var css, datauri, stats,

@@ -59,14 +67,10 @@ file = path.basename( filepath ),

if( extension === ".svg" || extension === ".png" ) {
if( fs.lstatSync( filepath ).isFile() ) {
self._checkName(seen, file.replace( extension, '' ));
self._checkName(seen, file.replace( extension, '' ));
stats = self._stats( filepath );
datauri = self._datauri( filepath );
stats = self._stats( filepath );
datauri = self._datauri( filepath );
css = self._css( file.replace( extension, '' ), datauri, stats );
css = self._css( file.replace( extension, '' ), datauri, stats );
fs.appendFileSync( self.output, css + "\n\n" );
}
}
fs.appendFileSync( self.output, css + "\n\n" );
});

@@ -157,7 +161,9 @@ };

if( templateFile && fs.existsSync( templateFile ) && fs.lstatSync( templateFile ).isFile() ){
if( !templateFile ) { return false; }
if( fs.existsSync( templateFile ) && fs.lstatSync( templateFile ).isFile() ){
var source = fs.readFileSync( templateFile ).toString( 'utf-8' );
tmpl = Handlebars.compile(source);
} else {
tmpl = false;
throw new Error( "Template file either doesn't exist or isn't a file" );
}

@@ -164,0 +170,0 @@

2

package.json
{
"name": "directory-encoder",
"description": "Encode a directory of images to CSS",
"version": "0.6.0",
"version": "0.6.1",
"homepage": "https://github.com/filamentgroup/directory-encoder",

@@ -6,0 +6,0 @@ "author": {

@@ -152,2 +152,10 @@ /*global require:true*/

withTemplateError: function( test ) {
test.expect(1);
test.throws(function(){
new Constructor( "test/directory-files", "test/output/encoded2.css",
{ template: path.resolve( "test/files/not-here.hbs" )} );
});
test.done();
},
withTemplate: function( test ) {

@@ -154,0 +162,0 @@ test.equal( this.encoder2._css("foo", "bar"),

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