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

postcss-normalize-string

Package Overview
Dependencies
Maintainers
4
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-normalize-string - npm Package Compare versions

Comparing version

to
4.0.2

27

dist/index.js

@@ -72,2 +72,3 @@ 'use strict';

}
return str + value;

@@ -95,2 +96,3 @@ }, '');

code = str.charCodeAt(pos);
switch (code) {

@@ -102,2 +104,3 @@ case SPACE:

next = pos;
do {

@@ -126,2 +129,3 @@ next += 1;

next = pos + 1;
if (str.charCodeAt(next) === SINGLE_QUOTE) {

@@ -175,2 +179,3 @@ ast.nodes.push(T_ESCAPED_SINGLE_QUOTE);

const { types } = ast;
if (types[C_SINGLE_QUOTE] || types[C_DOUBLE_QUOTE]) {

@@ -192,5 +197,7 @@ return;

}
if (child.type === C_ESCAPED_SINGLE_QUOTE && node.quote === L_DOUBLE_QUOTE) {
return [...newAst, T_SINGLE_QUOTE];
}
return [...newAst, child];

@@ -204,2 +211,3 @@ }, []);

}
return (0, _postcssValueParser2.default)(value).walk(child => {

@@ -209,3 +217,5 @@ if (child.type !== C_STRING) {

}
const ast = parse(child.value);
if (ast.quotes) {

@@ -218,2 +228,3 @@ changeWrappingQuotes(child, ast);

}
child.value = stringify(ast);

@@ -235,7 +246,21 @@ }).toString();

return css => {
const cache = {};
css.walk(node => {
const { type } = node;
if ((0, _has2.default)(params, type)) {
const param = params[type];
node[param] = normalize(node[param], preferredQuote);
const key = node[param] + '|' + preferredQuote;
if (cache[key]) {
node[param] = cache[key];
return;
}
const result = normalize(node[param], preferredQuote);
node[param] = result;
cache[key] = result;
}

@@ -242,0 +267,0 @@ });

2

package.json
{
"name": "postcss-normalize-string",
"version": "4.0.1",
"version": "4.0.2",
"description": "Normalize wrapping quotes for CSS string literals.",

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