File tree 1 file changed +9
-9
lines changed
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,14 @@ Table.createSchemaFromString_ = function(str) {
188
188
* @return {* } The converted value.
189
189
*/
190
190
Table . 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
+
191
199
if ( is . array ( value ) ) {
192
200
return value . map ( Table . encodeValue_ ) ;
193
201
}
@@ -199,14 +207,6 @@ Table.encodeValue_ = function(value) {
199
207
} , { } ) ;
200
208
}
201
209
202
- if ( Buffer . isBuffer ( value ) ) {
203
- return value . toString ( 'base64' ) ;
204
- }
205
-
206
- if ( is . date ( value ) ) {
207
- return value . toJSON ( ) ;
208
- }
209
-
210
210
return value ;
211
211
} ;
212
212
@@ -253,7 +253,7 @@ Table.mergeSchemaWithRows_ = function(schema, rows) {
253
253
break ;
254
254
}
255
255
case 'BYTES' : {
256
- value = Buffer . from ( value , 'base64' ) ;
256
+ value = new Buffer ( value , 'base64' ) ;
257
257
break ;
258
258
}
259
259
case 'FLOAT' : {
You can’t perform that action at this time.
0 commit comments