MCPcopy
hub / github.com/MiniMax-AI/cli / validateSize

Function validateSize

src/commands/image/generate.ts:74–81  ·  view source on GitHub ↗
(name: string, val: number)

Source from the content-addressed store, hash-verified

72 }
73 if (width !== undefined && height !== undefined) {
74 const validateSize = (name: string, val: number) => {
75 if (val < 512 || val > 2048) {
76 throw new CLIError(`--${name} must be between 512 and 2048, got ${val}.`, ExitCode.USAGE);
77 }
78 if (val % 8 !== 0) {
79 throw new CLIError(`--${name} must be a multiple of 8, got ${val}.`, ExitCode.USAGE);
80 }
81 };
82 validateSize('width', width);
83 validateSize('height', height);
84 }

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected