mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-12 00:37:19 +00:00
Add support for no-value encoder flags
This commit is contained in:
@@ -121,13 +121,15 @@ async function processFiles(files) {
|
|||||||
if (!program[encName]) {
|
if (!program[encName]) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
const encParam =
|
||||||
|
typeof program[encName] === "string" ? program[encName] : "{}";
|
||||||
const encConfig =
|
const encConfig =
|
||||||
program[encName].toLowerCase() === "auto"
|
encParam.toLowerCase() === "auto"
|
||||||
? "auto"
|
? "auto"
|
||||||
: Object.assign(
|
: Object.assign(
|
||||||
{},
|
{},
|
||||||
value.defaultEncoderOptions,
|
value.defaultEncoderOptions,
|
||||||
JSON5.parse(program[encName])
|
JSON5.parse(encParam)
|
||||||
);
|
);
|
||||||
const outputFile = join(program.outputDir, `${base}.${value.extension}`);
|
const outputFile = join(program.outputDir, `${base}.${value.extension}`);
|
||||||
jobsStarted++;
|
jobsStarted++;
|
||||||
|
|||||||
Reference in New Issue
Block a user