This is an automated email from the ASF dual-hosted git repository.

jensg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git


The following commit(s) were added to refs/heads/master by this push:
     new e5c636d  THRIFT-5448: map binary to typescript Buffer Client: js 
Author: OpportunityLiu
e5c636d is described below

commit e5c636defe2fdf0a59824542ca1cc1e5f7fe1f81
Author: Opportunity <[email protected]>
AuthorDate: Tue Aug 3 19:45:08 2021 +0800

    THRIFT-5448: map binary to typescript Buffer
    Client: js
    Author: OpportunityLiu
---
 compiler/cpp/src/thrift/generate/t_js_generator.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler/cpp/src/thrift/generate/t_js_generator.cc 
b/compiler/cpp/src/thrift/generate/t_js_generator.cc
index 48d7250..426b0e2 100644
--- a/compiler/cpp/src/thrift/generate/t_js_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_js_generator.cc
@@ -2720,7 +2720,7 @@ string t_js_generator::ts_get_type(t_type* type) {
     t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
     switch (tbase) {
     case t_base_type::TYPE_STRING:
-      ts_type = "string";
+      ts_type = type->is_binary() ? "Buffer" : "string";
       break;
     case t_base_type::TYPE_BOOL:
       ts_type = "boolean";

Reply via email to