Socket
Socket
Sign inDemoInstall

analyze-css

Package Overview
Dependencies
Maintainers
1
Versions
195
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

analyze-css - npm Package Compare versions

Comparing version 2.1.105 to 2.1.106

26

bin/analyze-css.js

@@ -26,3 +26,3 @@ #!/usr/bin/env node

"--ignore-ssl-errors",
"Ignores SSL errors, such as expired or self-signed certificate errors"
"Ignores SSL errors, such as expired or self-signed certificate errors",
)

@@ -32,11 +32,11 @@ .option("-p, --pretty", "Causes JSON with the results to be pretty-printed")

"-N, --no-offenders",
"Show only the metrics without the offenders part"
"Show only the metrics without the offenders part",
)
.option(
"--auth-user <user>",
"Sets the user name used for HTTP authentication"
"Sets the user name used for HTTP authentication",
)
.option(
"--auth-pass <pass>",
"Sets the password used for HTTP authentication"
"Sets the password used for HTTP authentication",
)

@@ -97,11 +97,11 @@ .option("-x, --proxy <proxy>", "Sets the HTTP proxy");

Object.keys(res.offenders).forEach(function (metricName) {
res.offenders[metricName] = res.offenders[metricName].map(function (
offender
) {
var position = offender.position && offender.position.start;
return (
offender.message +
(position ? " @ " + position.line + ":" + position.column : "")
);
});
res.offenders[metricName] = res.offenders[metricName].map(
function (offender) {
var position = offender.position && offender.position.start;
return (
offender.message +
(position ? " @ " + position.line + ":" + position.column : "")
);
},
);
});

@@ -108,0 +108,0 @@ }

@@ -43,3 +43,3 @@ /**

return this.items[b].cnt - this.items[a].cnt;
}.bind(this)
}.bind(this),
);

@@ -46,0 +46,0 @@

@@ -20,7 +20,7 @@ /**

name: MetricsNames,
value: number | undefined /** = 0 */
value: number | undefined /** = 0 */,
): void;
public incrMetric(
name: MetricsNames,
incr: number | undefined /** = 1 */
incr: number | undefined /** = 1 */,
): void;

@@ -30,3 +30,3 @@ public addOffender(

msg: string,
position: Position | undefined
position: Position | undefined,
): void;

@@ -42,3 +42,3 @@ public setCurrentPosition(position: Position): void;

ev: "declaration",
fn: (rule: CSSRule, property: string, value: string) => void
fn: (rule: CSSRule, property: string, value: string) => void,
): void;

@@ -48,3 +48,3 @@ public on(ev: "error", fn: (err: Error) => void): void;

ev: "expression",
fn: (selector: string, expression: Selector) => void
fn: (selector: string, expression: Selector) => void,
): void;

@@ -55,7 +55,7 @@ public on(ev: "font-face", fn: (rule: CSSRule) => void): void;

ev: "media",
fn: (query: string, rules: Array<CSSRule>) => void
fn: (query: string, rules: Array<CSSRule>) => void,
): void;
public on(
ev: "mediaEnd",
fn: (query: string, rules: Array<CSSRule>) => void
fn: (query: string, rules: Array<CSSRule>) => void,
): void;

@@ -66,3 +66,3 @@ public on(ev: "report", fn: () => void): void;

ev: "selector",
fn: (rule: CSSRule, selector: string, expressions: Selector[]) => void
fn: (rule: CSSRule, selector: string, expressions: Selector[]) => void,
): void;

@@ -69,0 +69,0 @@ public on(ev: "stylesheet", fn: (stylesheet: StyleRules) => void): void;

@@ -219,3 +219,3 @@ const analyze = require("."),

declaration.property,
declaration.value
declaration.value,
);

@@ -222,0 +222,0 @@ break;

@@ -30,4 +30,4 @@ /**

"css parameter passed is not a string!",
analyze.EXIT_CSS_PASSED_IS_NOT_STRING
)
analyze.EXIT_CSS_PASSED_IS_NOT_STRING,
),
);

@@ -34,0 +34,0 @@ return;

@@ -28,3 +28,3 @@ /**

process.platform,
process.arch
process.arch,
);

@@ -57,3 +57,3 @@ }

? err.toString()
: "received HTTP " + resp.status + " " + resp.statusText)
: "received HTTP " + resp.status + " " + resp.statusText),
);

@@ -116,3 +116,3 @@ callback(err);

Buffer.from(options.authUser + ":" + options.authPass, "utf8").toString(
"base64"
"base64",
);

@@ -165,3 +165,3 @@ }

analyzerOpts.preprocessor = preprocessors.findMatchingByFileName(
options.file
options.file,
);

@@ -175,3 +175,3 @@ }

}
}
},
);

@@ -178,0 +178,0 @@ } else if (options.stdin) {

{
"name": "analyze-css",
"version": "2.1.105",
"version": "2.1.106",
"author": "Maciej Brencz <maciej.brencz@gmail.com> (https://github.com/macbre)",

@@ -43,7 +43,7 @@ "description": "CSS selectors complexity and performance analyzer",

"eslint": "^8.0.0",
"eslint-config-prettier": "8.8.0",
"eslint-config-prettier": "8.9.0",
"eslint-plugin-node": "^11.1.0",
"jest": "^29.0.0",
"postcss": "^8.3.6",
"prettier": "2.8.8"
"prettier": "3.0.0"
},

@@ -50,0 +50,0 @@ "optionalDependencies": {

@@ -32,4 +32,4 @@ "use strict";

(base64.length / 1024).toFixed(2),
(buf.length / 1024).toFixed(2)
)
(buf.length / 1024).toFixed(2),
),
);

@@ -36,0 +36,0 @@ }

@@ -73,6 +73,6 @@ "use strict";

"adjacent" /* + */,
].includes(expr.type)
].includes(expr.type),
)
.map((expr) =>
expr.name ? { tag: expr.name } : { combinator: expr.type }
expr.name ? { tag: expr.name } : { combinator: expr.type },
);

@@ -79,0 +79,0 @@

@@ -24,4 +24,4 @@ "use strict";

comment.substr(0, 100),
comment.length
)
comment.length,
),
);

@@ -28,0 +28,0 @@ }

@@ -37,3 +37,3 @@ "use strict";

// #foo
rule.selectors.join(", ")
rule.selectors.join(", "),
);

@@ -73,4 +73,4 @@ });

declaration.property,
declaration.value
)
declaration.value,
),
);

@@ -95,3 +95,3 @@ } else {

"special handling for @font-face, provided src: %s",
declaration.value
declaration.value,
);

@@ -111,3 +111,3 @@ return false;

"duplicatedSelectors",
format("%s (%d times)", selector, cnt)
format("%s (%d times)", selector, cnt),
);

@@ -114,0 +114,0 @@ }

@@ -18,3 +18,3 @@ "use strict";

"expressions",
format("%s {%s: %s}", rule.selectors.join(", "), property, value)
format("%s {%s: %s}", rule.selectors.join(", "), property, value),
);

@@ -21,0 +21,0 @@ }

@@ -39,3 +39,3 @@ "use strict";

"oldIEFixes",
format("%s {%s: %s}", rule.selectors.join(", "), property, value)
format("%s {%s: %s}", rule.selectors.join(", "), property, value),
);

@@ -42,0 +42,0 @@ }

@@ -16,3 +16,3 @@ "use strict";

"importants",
format("%s {%s: %s}", rule.selectors.join(", "), property, value)
format("%s {%s: %s}", rule.selectors.join(", "), property, value),
);

@@ -19,0 +19,0 @@ }

@@ -15,3 +15,3 @@ "use strict";

"mediaQueries",
format("@media %s (%d rules)", query, rules.length)
format("@media %s (%d rules)", query, rules.length),
);

@@ -18,0 +18,0 @@ });

@@ -11,3 +11,3 @@ "use strict";

const expressionsWithClass = expressions.filter(
(expr) => expr.name === "class"
(expr) => expr.name === "class",
);

@@ -21,3 +21,3 @@

"multiClassesSelectors",
"." + expressionsWithClass.map((expr) => expr.value).join(".")
"." + expressionsWithClass.map((expr) => expr.value).join("."),
);

@@ -24,0 +24,0 @@ }

@@ -29,4 +29,4 @@ "use strict";

value,
prefixData.msg
)
prefixData.msg,
),
);

@@ -33,0 +33,0 @@ }

@@ -62,4 +62,4 @@ "use strict";

property,
expandedProperty
)
expandedProperty,
),
);

@@ -66,0 +66,0 @@ }

@@ -54,3 +54,3 @@ "use strict";

"specificity" + type + "Avg",
parseFloat(values[idx].amean().toFixed(2))
parseFloat(values[idx].amean().toFixed(2)),
);

@@ -57,0 +57,0 @@ analyzer.setMetric("specificity" + type + "Total", values[idx].Σ());

Sorry, the diff of this file is too big to display

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