File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -68,14 +68,15 @@ export const getImgToBase64 = (
6868 url : string ,
6969 options ?: ImgOptions ,
7070) : Promise < string > => {
71- const { type } = options ?? { } ;
72-
73- if ( ! options || type === ImgType . APNG ) return getImgBase64ByFetch ( url ) ;
71+ if ( options && options ?. type === ImgType . APNG ) return getImgBase64ByFetch ( url ) ;
7472
7573 return getImgBase64ByCanvas ( url , options ) ;
7674} ;
7775
78- async function getImgBase64ByCanvas ( url : string , options : ImgOptions ) : Promise < string > {
76+ async function getImgBase64ByCanvas (
77+ url : string ,
78+ options : ImgOptions ,
79+ ) : Promise < string > {
7980 const { type = ImgType . PNG , quality = 1 } = options ;
8081 let canvas = document . createElement ( 'canvas' ) ;
8182 const ctx = canvas . getContext ( '2d' ) ;
You can’t perform that action at this time.
0 commit comments