a number representing the quality of an image (between 0 and 100)
The format parameter is a string that represents the file format of an image. It is used to determine to apply a quality setting to the image. If the format is '.svg', then no quality setting is applied and the function returns undefined. Otherwise, if the format is any other image
The function getQuality
returns either the value of quality
if format
is not .svg
,
or undefined
if format
is .svg
. If quality
is not provided or is falsy, the default value of
80 is returned. The return type is number | undefined
.
The function returns a default quality value of 80 or undefined if the format is .svg.