File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -188,6 +188,14 @@ Table.createSchemaFromString_ = function(str) {
188188 * @return {* } The converted value.
189189 */
190190Table . encodeValue_ = function ( value ) {
191+ if ( value instanceof Buffer ) {
192+ return value . toString ( 'base64' ) ;
193+ }
194+
195+ if ( is . date ( value ) ) {
196+ return value . toJSON ( ) ;
197+ }
198+
191199 if ( is . array ( value ) ) {
192200 return value . map ( Table . encodeValue_ ) ;
193201 }
@@ -199,14 +207,6 @@ Table.encodeValue_ = function(value) {
199207 } , { } ) ;
200208 }
201209
202- if ( Buffer . isBuffer ( value ) ) {
203- return value . toString ( 'base64' ) ;
204- }
205-
206- if ( is . date ( value ) ) {
207- return value . toJSON ( ) ;
208- }
209-
210210 return value ;
211211} ;
212212
@@ -253,7 +253,7 @@ Table.mergeSchemaWithRows_ = function(schema, rows) {
253253 break ;
254254 }
255255 case 'BYTES' : {
256- value = Buffer . from ( value , 'base64' ) ;
256+ value = new Buffer ( value , 'base64' ) ;
257257 break ;
258258 }
259259 case 'FLOAT' : {
You can’t perform that action at this time.
0 commit comments