@@ -3,7 +3,7 @@ import { error, messages, success } from '../utils/console';
33import { getLanguageFromCode } from '../utils/micro' ;
44import { getFile , getRootFolder , saveFilePublic } from './core' ;
55import { objectTranslator } from './json_object' ;
6- import { matchYamlExt } from " ../utils/yaml" ;
6+ import { matchYamlExt } from ' ../utils/yaml' ;
77
88export async function fileTranslator (
99 objectPath : string ,
@@ -34,10 +34,10 @@ export async function fileTranslator(
3434 let root_folder = getRootFolder ( latest_path ) ;
3535
3636 // Check if source file has YAML extension and return the extension ("yml" or "yaml").
37- const source_file_match_yaml_ext = matchYamlExt ( latest_path )
38- // When source file has "yml" or "yaml" extension, use the same in output file path.
37+ const source_file_match_yaml_ext = matchYamlExt ( latest_path ) ;
38+ // When source file has "yml" or "yaml" extension, use the same in output file path.
3939 // Otherwise, default "json" extension used.
40- const file_ext = source_file_match_yaml_ext || " json" ;
40+ const file_ext = source_file_match_yaml_ext || ' json' ;
4141
4242 if ( Array . isArray ( new_json_obj ) === true && Array . isArray ( to ) === true ) {
4343 // multiple file saving
@@ -59,7 +59,9 @@ export async function fileTranslator(
5959 } else {
6060 new_json_obj = ( new_json_obj as translatedObject ) . data ;
6161
62- let file_name = newFileName ? `/${ newFileName } .${ to } .${ file_ext } ` : `/${ to } .${ file_ext } ` ;
62+ let file_name = newFileName
63+ ? `/${ newFileName } .${ to } .${ file_ext } `
64+ : `/${ to } .${ file_ext } ` ;
6365
6466 await saveFilePublic ( root_folder + file_name , new_json_obj ) ;
6567
0 commit comments