Socket
Socket
Sign inDemoInstall

postcss-base64

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-base64 - npm Package Compare versions

Comparing version 0.5.1 to 0.6.0

test/fonts-expected.css

19

index.js

@@ -45,2 +45,6 @@ var fs = require('fs'),

if(opts.excludeAtFontFace === undefined) {
opts.excludeAtFontFace = true;
}
if(opts.extensions) {

@@ -50,4 +54,15 @@ exts = '\\' + opts.extensions.join('|\\');

css.replaceValues(search, function (string) {
return replaceFiles(string, opts);
css.each(function (node) {
if(
opts.excludeAtFontFace &&
node.type === 'atrule' &&
node.name === 'font-face'
) {
// Don't do @font-face rules
return;
};
node.replaceValues(search, function (string) {
return replaceFiles(string, opts);
});
});

@@ -54,0 +69,0 @@ }

4

package.json
{
"name": "postcss-base64",
"version": "0.5.1",
"version": "0.6.0",
"description": "Replace values in url() statements with base64 encoded strings.",

@@ -13,3 +13,3 @@ "author": "Jelmer de Maat",

"scripts": {
"test": "ava"
"test": "ava --verbose"
},

@@ -16,0 +16,0 @@ "dependencies": {

@@ -45,3 +45,8 @@ postcss-base64, a [PostCSS](https://github.com/postcss/postcss/) plugin, replaces urls or values inside `url()` functions with their base64 encoded strings.

#### excludeAtFontFace
Boolean, defines wether `@font-face` rules are ignored. Default: `true`.
`excludeAtFontFace: false`
### NodeJS

@@ -48,0 +53,0 @@ Using PostCSS in NodeJS, the approach would be as follows:

@@ -19,4 +19,4 @@ var fs = require('fs'),

test('Check output prepended', t => {
test('Output with `prepend` option is as expected', t => {
t.is(expectedFile, outputFileContents, 'Expected code and output code are not the same.');
});

@@ -19,4 +19,4 @@ var fs = require('fs'),

test('Check output', t => {
test('Output is as expected', t => {
t.is(expectedFile, outputFileContents, 'Expected code and output code are not the same.');
});

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