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

grunt-img2sassb64

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-img2sassb64 - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

test/expected/multi_file_atsign_scss

8

Gruntfile.js

@@ -61,2 +61,10 @@ /*

}
},
multi_file_atsign_test: {
options: {
replaceAtSign: "AT"
},
files: {
'tmp/multi_file_atsign_scss': ['test/fixtures/*.png', 'test/fixtures/*.jpg', 'test/fixtures/*.gif', 'test/fixtures_2/*.jpg']
}
}

@@ -63,0 +71,0 @@ },

2

package.json
{
"name": "grunt-img2sassb64",
"version": "0.1.2",
"version": "0.1.3",
"description": "Converts image files to Base64 and saves them as SCSS or SASS variables in a single file",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/sarweiler/img2sassb64",

@@ -53,3 +53,9 @@ # img2sassb64

#### options.replaceAtSign
Type: `String`
Default value: `_`
Set a string to replace `@` in file names with. For example `img@2x.jpg` will be stored in a variable named `$img_2x_jpg` when using the default.
### Usage Examples

@@ -79,8 +85,9 @@

options: {
sassSyntax: true
sassSyntax: true,
replaceAtSign: 'AT'
},
files: {
'dest/_icons.scss': ['images/icons/*.png', 'images/more_icons/*.gif', 'images/more_icons/*.jpg'],
},
},
}
}
})

@@ -91,2 +98,3 @@ ```

* 0.1.3 Added option to replace @ with string in file name (default: "_")
* 0.1.2 Fixed missing quotes in generated output

@@ -93,0 +101,0 @@ * 0.1.1 Updated documentation

@@ -20,3 +20,4 @@ /*

var options = this.options({
sassSyntax: false
sassSyntax: false,
replaceAtSign: "_"
});

@@ -54,3 +55,3 @@

var varName = '$' + fileName.replace(/\./, '_');
var varName = '$' + fileName.replace(/\./, '_').replace(/@/, options.replaceAtSign);
var matchFileExtension = fileName.match(/.*\.(.+)$/);

@@ -57,0 +58,0 @@

@@ -65,3 +65,12 @@ 'use strict';

test.done();
},
multi_file_atsign_test: function (test) {
test.expect(1);
var actual = grunt.file.read('tmp/multi_file_atsign_scss');
var expected = grunt.file.read('test/expected/multi_file_atsign_scss');
test.equal(actual, expected, 'should generate a SCSS file with multiple files and file formats and replace the "@" in the file name with "AT".');
test.done();
}
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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