@@ -31,13 +31,16 @@ export const locales: [{ label: string; lang: string }, ...{ label: string; lang
3131 } ) ) ,
3232]
3333
34- export async function prepareJsonFiles ( ) {
34+ export async function prepareJsonFiles ( ) : Promise < void > {
3535 await fs . rm ( destFolder , { recursive : true , force : true } )
3636 await fs . mkdir ( destFolder )
3737 await Promise . all ( currentLocales . map ( l => mergeLocale ( l ) ) )
3838}
3939
40- export async function mergeLocaleObject ( locale : LocaleObject , copy = false ) {
40+ export async function mergeLocaleObject (
41+ locale : LocaleObject ,
42+ copy = false ,
43+ ) : Promise < void | unknown > {
4144 const files = locale . files ?? [ ]
4245 if ( locale . file || files . length === 1 ) {
4346 const json =
@@ -66,15 +69,15 @@ export async function mergeLocaleObject(locale: LocaleObject, copy = false) {
6669 return source
6770}
6871
69- async function loadJsonFile ( name : string ) {
72+ async function loadJsonFile ( name : string ) : Promise < unknown > {
7073 return JSON . parse ( await fs . readFile ( path . resolve ( `${ localesFolder } /${ name } ` ) , 'utf8' ) )
7174}
7275
7376function getFileName ( file : string | { path : string } ) : string {
7477 return typeof file === 'string' ? file : file . path
7578}
7679
77- async function mergeLocale ( locale : LocaleObject ) {
80+ async function mergeLocale ( locale : LocaleObject ) : Promise < void > {
7881 const source = await mergeLocaleObject ( locale , true )
7982 if ( ! source ) {
8083 return
0 commit comments