File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 8
8
"license" : " MIT" ,
9
9
"dependencies" : {
10
10
"eslint-config-cheminfo" : " ^8.0.2" ,
11
- "iobuffer" : " ^3 .1.0"
11
+ "iobuffer" : " ^5 .1.0"
12
12
},
13
13
"devDependencies" : {
14
14
"@jest/globals" : " ^28.1.3" ,
20
20
"scripts" : {
21
21
"eslint" : " eslint src" ,
22
22
"eslint-fix" : " eslint --fix src" ,
23
- "test" : " npm run test-coverage && npm run eslint" ,
24
- "test-only" : " jest" ,
23
+ "test" : " npm run test-only && npm run eslint && npm run prettier" ,
25
24
"prettier" : " prettier --check src" ,
26
25
"prettier-write" : " prettier --write src" ,
27
- "test-coverage " : " jest --coverage" ,
26
+ "test-only " : " jest --coverage" ,
28
27
"test-watch" : " jest --watch" ,
29
28
"test-write" : " FAST_BMP_WRITE_DATA_FILES=1 npm run test-jest"
30
29
},
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
- const IOBuffer = require ( 'iobuffer' ) ;
3
+ const { IOBuffer } = require ( 'iobuffer' ) ;
4
4
5
5
const constants = require ( './constants' ) ;
6
6
@@ -36,7 +36,8 @@ class BMPEncoder extends IOBuffer {
36
36
this . writePixelArray ( ) ;
37
37
this . encoded . rewind ( ) ;
38
38
this . writeBitmapFileHeader ( offset ) ;
39
- return this . encoded . getBuffer ( ) ;
39
+ const array = this . encoded . toArray ( ) ;
40
+ return Buffer . from ( array . buffer , array . byteOffset , array . byteLength ) ;
40
41
}
41
42
42
43
writePixelArray ( ) {
@@ -104,7 +105,7 @@ class BMPEncoder extends IOBuffer {
104
105
writeBitmapFileHeader ( imageOffset ) {
105
106
this . encoded
106
107
. writeChars ( 'BM' ) // 14 bytes bitmap file header
107
- . writeInt32 ( this . encoded . _lastWrittenByte ) // Size of BMP file in bytes
108
+ . writeInt32 ( this . encoded . lastWrittenByte ) // Size of BMP file in bytes
108
109
. writeUint16 ( 0 )
109
110
. writeUint16 ( 0 )
110
111
. writeUint32 ( imageOffset ) ;
You can’t perform that action at this time.
0 commit comments