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

postcss-normalize-url

Package Overview
Dependencies
Maintainers
7
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-normalize-url - npm Package Compare versions

Comparing version 4.0.0-nightly.2020.1.9 to 4.0.0-nightly.2020.1.11

40

dist/index.js

@@ -10,4 +10,2 @@ "use strict";

var _postcss = _interopRequireDefault(require("postcss"));
var _postcssValueParser = _interopRequireDefault(require("postcss-value-parser"));

@@ -60,9 +58,14 @@

decl.value = (0, _postcssValueParser.default)(decl.value).walk(node => {
if (node.type !== 'function' || node.value.toLowerCase() !== 'url' || !node.nodes.length) {
if (node.type !== 'function' || node.value.toLowerCase() !== 'url') {
return false;
}
node.before = node.after = '';
if (!node.nodes.length) {
return false;
}
let url = node.nodes[0];
let escaped;
node.before = node.after = '';
url.value = url.value.trim().replace(multiline, ''); // Skip empty URLs

@@ -99,20 +102,27 @@ // Empty URL function equals request to current stylesheet where it is declared

var _default = _postcss.default.plugin('postcss-normalize-url', opts => {
function pluginCreator(opts) {
opts = Object.assign({}, {
normalizeProtocol: false,
stripFragment: false,
stripHash: false,
stripWWW: false
}, opts);
return css => {
css.walk(node => {
if (node.type === 'decl') {
return transformDecl(node, opts);
} else if (node.type === 'atrule' && node.name.toLowerCase() === 'namespace') {
return transformNamespace(node);
}
});
return {
postcssPlugin: 'postcss-normalize-url',
OnceExit(css) {
css.walk(node => {
if (node.type === 'decl') {
return transformDecl(node, opts);
} else if (node.type === 'atrule' && node.name.toLowerCase() === 'namespace') {
return transformNamespace(node);
}
});
}
};
});
}
pluginCreator.postcss = true;
var _default = pluginCreator;
exports.default = _default;
module.exports = exports.default;
{
"name": "postcss-normalize-url",
"version": "4.0.0-nightly.2020.1.9",
"version": "4.0.0-nightly.2020.1.11",
"description": "Normalize URLs with PostCSS",

@@ -26,6 +26,5 @@ "main": "dist/index.js",

"dependencies": {
"is-absolute-url": "^2.1.0",
"normalize-url": "^3.3.0",
"postcss": "^7.0.16",
"postcss-value-parser": "^3.3.1"
"is-absolute-url": "^3.0.3",
"normalize-url": "^4.5.0",
"postcss-value-parser": "^4.1.0"
},

@@ -44,3 +43,9 @@ "homepage": "https://github.com/cssnano/cssnano",

"node": ">=10.13.0"
},
"devDependencies": {
"postcss": "^8.2.1"
},
"peerDependencies": {
"postcss": "^8.2.1"
}
}

@@ -44,3 +44,3 @@ # [postcss][postcss]-normalize-url

Please see the [normalize-url documentation][docs]. By default,
`normalizeProtocol`, `stripFragment` & `stripWWW` are set to `false`.
`normalizeProtocol`, `stripHash` & `stripWWW` are set to `false`.

@@ -47,0 +47,0 @@ ## Contributors

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