File tree Expand file tree Collapse file tree 1 file changed +26
-31
lines changed Expand file tree Collapse file tree 1 file changed +26
-31
lines changed Original file line number Diff line number Diff line change 16
16
* See the License for the specific language governing permissions and
17
17
* limitations under the License.
18
18
*/
19
-
20
- import debug from "./log" ;
21
- import { alloc } from "./buf" ;
22
19
import utf8 from "./utf8" ;
23
- import Integer from "../integer" ;
24
- import { int } from "../integer" ;
25
- import { newError } from './../error' ;
20
+ import Integer , { int , isInt } from "../integer" ;
21
+ import { newError } from "./../error" ;
26
22
27
- let MAX_CHUNK_SIZE = 16383 ,
28
- TINY_STRING = 0x80 ,
29
- TINY_LIST = 0x90 ,
30
- TINY_MAP = 0xA0 ,
31
- TINY_STRUCT = 0xB0 ,
32
- NULL = 0xC0 ,
33
- FLOAT_64 = 0xC1 ,
34
- FALSE = 0xC2 ,
35
- TRUE = 0xC3 ,
36
- INT_8 = 0xC8 ,
37
- INT_16 = 0xC9 ,
38
- INT_32 = 0xCA ,
39
- INT_64 = 0xCB ,
40
- STRING_8 = 0xD0 ,
41
- STRING_16 = 0xD1 ,
42
- STRING_32 = 0xD2 ,
43
- LIST_8 = 0xD4 ,
44
- LIST_16 = 0xD5 ,
45
- LIST_32 = 0xD6 ,
46
- MAP_8 = 0xD8 ,
47
- MAP_16 = 0xD9 ,
48
- MAP_32 = 0xDA ,
49
- STRUCT_8 = 0xDC ,
50
- STRUCT_16 = 0xDD ;
23
+ const TINY_STRING = 0x80 ;
24
+ const TINY_LIST = 0x90 ;
25
+ const TINY_MAP = 0xA0 ;
26
+ const TINY_STRUCT = 0xB0 ;
27
+ const NULL = 0xC0 ;
28
+ const FLOAT_64 = 0xC1 ;
29
+ const FALSE = 0xC2 ;
30
+ const TRUE = 0xC3 ;
31
+ const INT_8 = 0xC8 ;
32
+ const INT_16 = 0xC9 ;
33
+ const INT_32 = 0xCA ;
34
+ const INT_64 = 0xCB ;
35
+ const STRING_8 = 0xD0 ;
36
+ const STRING_16 = 0xD1 ;
37
+ const STRING_32 = 0xD2 ;
38
+ const LIST_8 = 0xD4 ;
39
+ const LIST_16 = 0xD5 ;
40
+ const LIST_32 = 0xD6 ;
41
+ const MAP_8 = 0xD8 ;
42
+ const MAP_16 = 0xD9 ;
43
+ const MAP_32 = 0xDA ;
44
+ const STRUCT_8 = 0xDC ;
45
+ const STRUCT_16 = 0xDD ;
51
46
52
47
/**
53
48
* A Structure have a signature and fields.
@@ -98,7 +93,7 @@ class Packer {
98
93
return ( ) => this . packFloat ( x ) ;
99
94
} else if ( typeof ( x ) == "string" ) {
100
95
return ( ) => this . packString ( x , onError ) ;
101
- } else if ( Integer . isInteger ( x ) ) {
96
+ } else if ( isInt ( x ) ) {
102
97
return ( ) => this . packInteger ( x ) ;
103
98
} else if ( x instanceof Array ) {
104
99
return ( ) => {
You can’t perform that action at this time.
0 commit comments