@@ -11,6 +11,8 @@ import Uint32Codec from './uint32.js';
1111import Float32Codec from './float32.js' ;
1212import Float64Codec from './float64.js' ;
1313import StringCodec from './string.js' ;
14+ import Int64Codec from './int64.js' ;
15+ import Uint64Codec from './uint64.js' ;
1416
1517Codecs . uint8 = Uint8Codec ;
1618Codecs . int8 = Int8Codec ;
@@ -22,6 +24,8 @@ Codecs.uint32 = Uint32Codec;
2224Codecs . float32 = Float32Codec ;
2325Codecs . float64 = Float64Codec ;
2426Codecs . string = StringCodec ;
27+ Codecs . int64 = Int64Codec ;
28+ Codecs . uint64 = Uint64Codec ;
2529
2630for ( const numberType of [
2731 'int8' ,
@@ -47,6 +51,26 @@ for (const numberType of [
4751 } ) ;
4852}
4953
54+ test ( 'int64 array' , async ( ) => {
55+ const codec = new Codec ( {
56+ element : { type : 'int64' } ,
57+ } ) ;
58+ const value = [ 1n , - 2n , 3n , - 4n ] ;
59+ const view = new DataView ( new ArrayBuffer ( codec . size ( value ) ) ) ;
60+ expect ( codec . encode ( value , view , 0 ) ) . to . equal ( 36 ) ;
61+ expect ( codec . decode ( view , { byteOffset : 0 } ) ) . to . deep . equal ( value ) ;
62+ } ) ;
63+
64+ test ( 'uint64 array' , async ( ) => {
65+ const codec = new Codec ( {
66+ element : { type : 'uint64' } ,
67+ } ) ;
68+ const value = [ 1n , 2n , 3n , 4n ] ;
69+ const view = new DataView ( new ArrayBuffer ( codec . size ( value ) ) ) ;
70+ expect ( codec . encode ( value , view , 0 ) ) . to . equal ( 36 ) ;
71+ expect ( codec . decode ( view , { byteOffset : 0 } ) ) . to . deep . equal ( value ) ;
72+ } ) ;
73+
5074test ( 'string array' , async ( ) => {
5175 const codec = new Codec ( {
5276 element : { type : 'string' } ,
0 commit comments