Skip to content

Commit

Permalink
feat: use fileInstance instead
Browse files Browse the repository at this point in the history
  • Loading branch information
MARCROCK22 committed Feb 8, 2025
1 parent 0c7a5b3 commit 0d266b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/langs/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class LangsHandler extends BaseHandler {

parse(file: LangInstance) {
const oldLocale = file.name.split('.').slice(0, -1).join('.') || file.name;
const result = this.onFile(oldLocale, file.file);
const result = this.onFile(oldLocale, file);
if (!result) return;
if ('path' in file) this.__paths[result.locale] = file.path as string;
this.values[result.locale] = result.file;
Expand Down Expand Up @@ -80,7 +80,7 @@ export class LangsHandler extends BaseHandler {
}
}

onFile(locale: string, file: FileLoaded<Record<string, any>>): { file: Record<string, any>; locale: string } | false {
onFile(locale: string, { file }: LangInstance): { file: Record<string, any>; locale: string } | false {
return file.default
? {
file: file.default,
Expand All @@ -90,4 +90,4 @@ export class LangsHandler extends BaseHandler {
}
}

export type LangInstance = { name: string; file: Record<string, any>; path: string };
export type LangInstance = { name: string; file: FileLoaded<Record<string, any>>; path: string };

0 comments on commit 0d266b4

Please sign in to comment.