fix: type cast
This commit is contained in:
parent
3d5cdf50e6
commit
0d36f5f091
1 changed files with 3 additions and 1 deletions
|
@ -56,7 +56,9 @@ async function handler(req: NextApiReq, res: NextApiRes) {
|
|||
}
|
||||
|
||||
const rawFormat = ((req.headers['format'] as string) || zconfig.uploader.default_format).toLowerCase();
|
||||
const format = NameFormats.includes(rawFormat as NameFormat) ? rawFormat : 'random';
|
||||
const format = NameFormats.includes(rawFormat as NameFormat)
|
||||
? (rawFormat as NameFormat)
|
||||
: ('random' as NameFormat);
|
||||
|
||||
const imageCompressionPercent = req.headers['image-compression-percent']
|
||||
? Number(req.headers['image-compression-percent'])
|
||||
|
|
Loading…
Reference in a new issue