Skip to content

Commit 0d381f8

Browse files
committed
style: fixes
1 parent b00236f commit 0d381f8

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/index.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@ export class I18n {
129129
private activeMessages: object = reactive({})
130130

131131
// Stores the abort controller for the load promises.
132-
private abortController: AbortController;
132+
private abortController: AbortController
133133

134134
/**
135135
* Creates a new instance of the I18n class, applying default options
136136
*/
137137
constructor(options: OptionsInterface = {}) {
138138
this.options = { ...DEFAULT_OPTIONS, ...options }
139139

140-
this.load();
140+
this.load()
141141
}
142142

143143
/**
@@ -147,7 +147,7 @@ export class I18n {
147147
this.options = { ...this.options, ...options }
148148

149149
if (forceLoad) {
150-
this.load();
150+
this.load()
151151
}
152152

153153
return this
@@ -181,9 +181,9 @@ export class I18n {
181181
* Loads the language file.
182182
*/
183183
loadLanguageAsync(lang: string, dashLangTry = false, ignoreAbort = false): Promise<string | void> {
184-
if (! ignoreAbort) {
185-
this.abortController?.abort();
186-
this.abortController = new AbortController();
184+
if (!ignoreAbort) {
185+
this.abortController?.abort()
186+
this.abortController = new AbortController()
187187
}
188188

189189
const loadedLang: LanguageInterface = I18n.loaded.find((row) => row.lang === lang)
@@ -194,14 +194,13 @@ export class I18n {
194194

195195
return new Promise((resolve, reject) => {
196196
this.abortController.signal.addEventListener('abort', () => {
197-
resolve();
198-
});
197+
resolve()
198+
})
199199

200200
this.resolveLangAsync(this.options.resolve, lang).then(({ default: messages }) => {
201-
resolve(this.applyLanguage(lang, messages, dashLangTry, this.loadLanguageAsync));
202-
});
203-
});
204-
201+
resolve(this.applyLanguage(lang, messages, dashLangTry, this.loadLanguageAsync))
202+
})
203+
})
205204
}
206205

207206
/**

0 commit comments

Comments
 (0)