File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -152,13 +152,12 @@ describe('conversion', () => {
152152 } )
153153
154154 test ( 'supports arrays of bytea' , ( ) => {
155- const result = getParser ( ArrayColumnType . BYTEA_ARRAY ) ( '{aGVsbG8=,d29ybGQ= }' )
155+ const result = getParser ( ArrayColumnType . BYTEA_ARRAY ) ( '{aGVsbG8=,NULL }' )
156156 expect ( Array . isArray ( result ) ) . toBe ( true )
157157 expect ( result ! . length ) . toBe ( 2 )
158158 expect ( Buffer . isBuffer ( result ! [ 0 ] ) ) . toBe ( true )
159- expect ( Buffer . isBuffer ( result ! [ 1 ] ) ) . toBe ( true )
160159 expect ( result ! [ 0 ] ! . toString ( ) ) . toBe ( 'aGVsbG8=' )
161- expect ( result ! [ 1 ] ! . toString ( ) ) . toBe ( 'd29ybGQ=' )
160+ expect ( result ! [ 1 ] ) . toBeNull ( )
162161 } )
163162 } )
164163} )
Original file line number Diff line number Diff line change @@ -414,9 +414,9 @@ const builtInByteParser = getTypeParser(ScalarColumnType.BYTEA) as (_: string) =
414414/*
415415 * BYTEA_ARRAY - arrays of arbitrary raw binary strings
416416 */
417- function normalizeByteaArray ( x : string | null ) : Buffer [ ] | null {
417+ function normalizeByteaArray ( x : string | null ) : ( Buffer | null ) [ ] | null {
418418 if ( x === null ) return null
419- return parseArray ( x ) . map ( builtInByteParser )
419+ return parseArray ( x ) . map ( ( elem ) => ( elem === null ? null : builtInByteParser ( elem ) ) )
420420}
421421
422422function convertBytes ( serializedBytes : string | null ) : Buffer | null {
You can’t perform that action at this time.
0 commit comments