imgconvert-cli
Advanced tools
+1
-1
| { | ||
| "name": "imgconvert-cli", | ||
| "version": "1.7.2", | ||
| "version": "1.7.3", | ||
| "description": "A CLI tool for compressing and converting images", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
+19
-3
@@ -30,3 +30,11 @@ /** | ||
| }, | ||
| boolean: ['replace-originals', 'debug', 'help', 'version', 'canvas'] | ||
| boolean: ['replace-originals', 'debug', 'help', 'version', 'canvas'], | ||
| unknown: (arg) => { | ||
| if (arg.startsWith('-')) { | ||
| logger.error(`Error: Unknown option '${arg}'`); | ||
| logger.error(`Run 'imgconvert --help' to see available options.`); | ||
| process.exit(1); | ||
| } | ||
| return true; | ||
| } | ||
| }); | ||
@@ -110,9 +118,17 @@ | ||
| // Parse preset and subpreset | ||
| if (args.preset && args.preset.includes(':')) { | ||
| if (args.preset && typeof args.preset === 'string' && args.preset.includes(':')) { | ||
| const parts = args.preset.split(':'); | ||
| args.presetName = parts[0]; | ||
| args.subPreset = parts[1]; | ||
| } else { | ||
| } else if (args.preset && typeof args.preset === 'string') { | ||
| args.presetName = args.preset; | ||
| args.subPreset = null; | ||
| } else if (args.preset && typeof args.preset !== 'string') { | ||
| // If preset is not a string (e.g., boolean, array), it's invalid | ||
| logger.error(`Error: Invalid preset value. Expected a string but got: ${typeof args.preset}`); | ||
| logger.error(`Tip: Use '-p <preset>' or '--preset <preset>' to specify a preset.`); | ||
| process.exit(1); | ||
| } else { | ||
| args.presetName = null; | ||
| args.subPreset = null; | ||
| } | ||
@@ -119,0 +135,0 @@ |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
112481
0.66%1480
1.09%10
11.11%