New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

svglint

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svglint - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

14

bin/cli.js

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

const chalk = require("chalk");
const glob = require("glob");

@@ -24,5 +25,2 @@ const logger = Logger("");

});
process.on("exit", () => {
GUI.finish();
});

@@ -36,3 +34,3 @@ // Generates the CLI binding using meow

${chalk.bold("svglint")} [--config config.js] [--ci] [--debug] ${chalk.bold("file1.svg file2.svg")}
${chalk.yellow("Options:")}

@@ -51,2 +49,6 @@ ${chalk.bold("--help")} Display this help text

process.on("exit", () => {
GUI.finish();
});
/** CLI main function */

@@ -58,3 +60,5 @@ (async function(){

GUI.setCI(cli.flags.ci);
const files = cli.input.map(v => path.resolve(process.cwd(), v));
const files = cli.input.map(v => glob.sync(v))
.reduce((a, v) => a.concat(v), [])
.map(v => path.resolve(process.cwd(), v));

@@ -61,0 +65,0 @@ // load the config

{
"name": "svglint",
"version": "1.0.1",
"version": "1.0.2",
"description": "Linter for SVGs",

@@ -26,2 +26,3 @@ "main": "src/svglint.js",

"cheerio": "^1.0.0-rc.2",
"glob": "^7.1.2",
"htmlparser2": "^3.9.1",

@@ -28,0 +29,0 @@ "log-update": "^2.3.0",

@@ -99,8 +99,10 @@ /**

);
outp.push(
"",
this.$titles.lints,
$lintings
.join("\n"),
);
if ($lintings.length) {
outp.push(
"",
this.$titles.lints,
$lintings
.join("\n"),
);
}
}

@@ -107,0 +109,0 @@ outp.push(

@@ -144,2 +144,21 @@ const chalk = require("chalk");

it("should succeed with a valid value when given regex", function(){
return testSucceeds({
"role": /^im.$/,
"rule::selector": "svg",
});
});
it("should fail with an invalid value when given regex", function(){
return testFails({
"role": /^.im$/,
"rule::selector": "svg",
});
});
it("should fail with a non-existant attribute when given regex", function(){
return testFails({
"foo": /^img$/,
"rule::selector": "svg",
});
});
it("should default to wildcard selector", function(){

@@ -146,0 +165,0 @@ return testFails({

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