🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

postcss-normalize-url

Package Overview
Dependencies
Maintainers
8
Versions
59
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

to
5.1.0

types/index.d.ts

6

package.json
{
"name": "postcss-normalize-url",
"version": "5.0.5",
"version": "5.1.0",
"description": "Normalize URLs with PostCSS",
"main": "src/index.js",
"types": "types/index.d.ts",
"files": [
"src",
"LICENSE-MIT"
"LICENSE-MIT",
"types"
],

@@ -10,0 +12,0 @@ "keywords": [

@@ -28,5 +28,10 @@ 'use strict';

/**
* @param {string} url
* @param {normalize.Options} options
* @return {string}
*/
function convert(url, options) {
if (isAbsolute(url) || url.startsWith('//')) {
let normalizedURL = null;
let normalizedURL;

@@ -46,2 +51,6 @@ try {

/**
* @param {import('postcss').AtRule} rule
* @return {void}
*/
function transformNamespace(rule) {

@@ -55,4 +64,5 @@ rule.params = valueParser(rule.params)

) {
node.type = 'string';
node.quote = node.nodes[0].quote || '"';
/** @type {valueParser.Node} */ (node).type = 'string';
/** @type {any} */ (node).quote =
node.nodes[0].type === 'string' ? node.nodes[0].quote : '"';
node.value = node.nodes[0].value;

@@ -68,2 +78,7 @@ }

/**
* @param {import('postcss').Declaration} decl
* @param {normalize.Options} opts
* @return {void}
*/
function transformDecl(decl, opts) {

@@ -89,3 +104,3 @@ decl.value = valueParser(decl.value)

if (url.value.length === 0) {
url.quote = '';
/** @type {any} */ (url).quote = '';

@@ -108,3 +123,3 @@ return false;

url.value = escaped;
url.type = 'word';
/** @type {valueParser.Node} */ (url).type = 'word';
}

@@ -120,2 +135,8 @@ } else {

/** @typedef {normalize.Options} Options */
/**
* @type {import('postcss').PluginCreator<Options>}
* @param {Options} opts
* @return {import('postcss').Plugin}
*/
function pluginCreator(opts) {

@@ -122,0 +143,0 @@ opts = Object.assign(