File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -8,15 +8,13 @@ const imageminSvgo = options => async buffer => {
88 ...options ,
99 } ;
1010
11- if ( ! isSvg ( buffer ) ) {
12- return buffer ;
13- }
11+ const normalizedInput = Buffer . isBuffer ( buffer ) ? buffer . toString ( ) : buffer ;
1412
15- if ( Buffer . isBuffer ( buffer ) ) {
16- buffer = buffer . toString ( ) ;
13+ if ( ! isSvg ( normalizedInput ) ) {
14+ return buffer ;
1715 }
1816
19- const { data} = optimize ( buffer , options ) ;
17+ const { data} = optimize ( normalizedInput , options ) ;
2018 return Buffer . from ( data ) ;
2119} ;
2220
Original file line number Diff line number Diff line change 2828 " svgo"
2929 ],
3030 "dependencies" : {
31- "is-svg" : " ^5.0.0 " ,
32- "svgo" : " ^3.2.0 "
31+ "is-svg" : " ^5.0.1 " ,
32+ "svgo" : " ^3.3.2 "
3333 },
3434 "devDependencies" : {
35- "ava" : " ^6.1.2 " ,
35+ "ava" : " ^6.1.3 " ,
3636 "xo" : " ^0.58.0"
3737 }
3838}
You can’t perform that action at this time.
0 commit comments