Skip to content

Commit

Permalink
fix tarsnode create ts use import from assert, no require
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanshudong committed Jun 20, 2024
1 parent 5deae59 commit 96b0552
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tools/tars2node/gen_proxy_ts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ bool CodeGenerator::generateTSProxy(const ContextPtr &cPtr)
sstr << "/// <reference types=\"node\" />" << endl;
if (bNeedAssert)
{
sstr << TAB << "import assert = require(\"assert\");" << endl;
sstr << TAB << "import assert from \"assert\";" << endl;
}
if (bNeedStream)
{
Expand Down
2 changes: 1 addition & 1 deletion tools/tars2node/gen_server_ts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ bool CodeGenerator::generateTSServer(const ContextPtr &pPtr)
str << "/// <reference types=\"node\" />" << endl;
if (bNeedAssert)
{
str << TAB << "import assert = require(\"assert\");" << endl;
str << TAB << "import assert from \"assert\";" << endl;
}
if (bNeedStream)
{
Expand Down
2 changes: 1 addition & 1 deletion tools/tars2node/gen_ts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ void CodeGenerator::generateTS(const ContextPtr &pPtr)
ostringstream ostr;
if (bNeedAssert)
{
ostr << "import assert = require(\"assert\");" << endl;
ostr << "import assert from \"assert\";" << endl;
}
if (bNeedStream)
{
Expand Down

0 comments on commit 96b0552

Please sign in to comment.