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

postcss-url

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-url - npm Package Compare versions

Comparing version 3.1.0 to 3.2.0

8

CHANGELOG.md

@@ -0,4 +1,8 @@

# 3.2.0 - 2015-05-01
- Added: New `fallback` option to use if max size is exceeded or url contains a hash ([#30](https://github.com/postcss/postcss-url/pull/30))
# 3.1.0 - 2015-05-01
- Added: New copy value for `url` option
- Added: New copy value for `url` option ([#29](https://github.com/postcss/postcss-url/pull/29))

@@ -11,3 +15,3 @@ # 3.0.0 - 2015-03-02

- Fixed: whitespace before and after url() value are now supported and preserved
- Fixed: whitespace before and after url() value are now supported and preserved ([#27](https://github.com/postcss/postcss-url/pull/27))

@@ -14,0 +18,0 @@ # 2.1.0 - 2015-03-12

@@ -110,3 +110,3 @@ /**

case "inline":
return processInline(from, dirname, urlMeta, options)
return processInline(from, dirname, urlMeta, to, options, decl)
case "copy":

@@ -162,7 +162,10 @@ return processCopy(from, dirname, urlMeta, to, options)

* @param {String} urlMeta url meta data
* @param {String} to destination
* @param {Object} options plugin options
* @param {Object} decl postcss declaration
* @return {String} new url
*/
function processInline(from, dirname, urlMeta, options) {
function processInline(from, dirname, urlMeta, to, options, decl) {
var maxSize = options.maxSize === undefined ? 14 : options.maxSize
var fallback = options.fallback
var basePath = options.basePath

@@ -172,6 +175,18 @@ var fullFilePath

function processFallback() {
if (typeof fallback === "function") {
return processCustom(urlMeta, fallback, decl)
}
switch (fallback) {
case "copy":
return processCopy(from, dirname, urlMeta, to, options)
default:
return createUrl(urlMeta)
}
}
// ignore URLs with hashes/fragments, they can't be inlined
var link = url.parse(urlMeta.value)
if (link.hash) {
return createUrl(urlMeta, urlMeta.value)
return processFallback()
}

@@ -196,3 +211,3 @@

if (stats.size >= maxSize) {
return createUrl(urlMeta)
return processFallback()
}

@@ -199,0 +214,0 @@

{
"name": "postcss-url",
"version": "3.1.0",
"version": "3.2.0",
"description": "PostCSS plugin to rebase or inline on url().",

@@ -5,0 +5,0 @@ "keywords": [

@@ -64,2 +64,6 @@ # postcss-url [![Build Status](https://travis-ci.org/postcss/postcss-url.png)](https://travis-ci.org/postcss/postcss-url)

#### `fallback: "copy or custom {Function}"`
The url fallback method to use if max size is exceeded or url contains a hash. Custom transform functions are supported.
#### `basePath: "basePath for images to inline"`

@@ -66,0 +70,0 @@

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