@@ -712,14 +712,17 @@ int AddModule(const std::string& filename,
712712 // Transpile TypeScript sources to JavaScript using SWC type stripping.
713713 if (filename.ends_with (kTsSuffix )) {
714714 Debug (" Transpiling TypeScript: %s\n " , filename.c_str ());
715- SwcTransformResult result = swc_transform (
716- code.data (), code.size (),
717- filename.c_str (), filename.size (),
718- SWC_MODE_STRIP_ONLY);
715+ SwcTransformResult result = swc_transform (code.data (),
716+ code.size (),
717+ filename.c_str (),
718+ filename.size (),
719+ SWC_MODE_STRIP_ONLY);
719720 if (result.error != nullptr ) {
720- fprintf (stderr, " SWC error transpiling %s: %.*s\n " ,
721+ fprintf (stderr,
722+ " SWC error transpiling %s: %.*s\n " ,
721723 filename.c_str (),
722- static_cast <int >(result.error_len ), result.error );
724+ static_cast <int >(result.error_len ),
725+ result.error );
723726 swc_transform_free_result (&result);
724727 return 1 ;
725728 }
@@ -728,7 +731,8 @@ int AddModule(const std::string& filename,
728731
729732 if (!output_transpiled_dir.empty ()) {
730733 // Write transpiled output as .js for debuggability.
731- std::string out_path = output_transpiled_dir + " /" +
734+ std::string out_path =
735+ output_transpiled_dir + " /" +
732736 filename.substr (0 , filename.size () - kTsSuffix .size ()) + " .js" ;
733737 size_t last_slash = out_path.find_last_of (' /' );
734738 if (last_slash != std::string::npos) {
@@ -897,7 +901,8 @@ int JS2C(const FileList& js_files,
897901 Fragments initializers;
898902 initializers.reserve (js_files.size () + mjs_files.size () + ts_files.size ());
899903 Fragments registrations;
900- registrations.reserve (js_files.size () + mjs_files.size () + ts_files.size () + 1 );
904+ registrations.reserve (js_files.size () + mjs_files.size () + ts_files.size () +
905+ 1 );
901906
902907 for (const auto & filename : js_files) {
903908 int r = AddModule (filename, &definitions, &initializers, ®istrations);
@@ -1043,7 +1048,8 @@ int Main(int argc, char* argv[]) {
10431048 std::sort (mjs_it->second .begin (), mjs_it->second .end ());
10441049 std::sort (ts_it->second .begin (), ts_it->second .end ());
10451050
1046- return JS2C (js_it->second , mjs_it->second , ts_it->second , gypi_it->second [0 ], output);
1051+ return JS2C (
1052+ js_it->second , mjs_it->second , ts_it->second , gypi_it->second [0 ], output);
10471053}
10481054} // namespace js2c
10491055} // namespace node
0 commit comments