File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ class PDFImage {
1515 } else if ( src instanceof ArrayBuffer ) {
1616 data = Buffer . from ( new Uint8Array ( src ) ) ;
1717 } else {
18- let match ;
19- if ( ( match = / ^ d a t a : . + ? ; b a s e 6 4 , ( . * ) $ / . exec ( src ) ) ) {
18+ const match = / ^ d a t a : . + ? ; b a s e 6 4 , ( . * ) $ / . exec ( src ) ;
19+ if ( match ) {
2020 data = Buffer . from ( match [ 1 ] , 'base64' ) ;
2121 } else {
2222 data = fs . readFileSync ( src ) ;
Original file line number Diff line number Diff line change @@ -33,8 +33,8 @@ export default {
3333 } else if ( src instanceof ArrayBuffer ) {
3434 data = Buffer . from ( new Uint8Array ( src ) ) ;
3535 } else {
36- let match ;
37- if ( ( match = / ^ d a t a : ( . * ? ) ; b a s e 6 4 , ( . * ) $ / . exec ( src ) ) ) {
36+ const match = / ^ d a t a : ( . * ? ) ; b a s e 6 4 , ( . * ) $ / . exec ( src ) ;
37+ if ( match ) {
3838 if ( match [ 1 ] ) {
3939 refBody . Subtype = match [ 1 ] . replace ( '/' , '#2F' ) ;
4040 }
You can’t perform that action at this time.
0 commit comments