Skip to content

Commit 5211814

Browse files
authored
Merge pull request #38 from gentoo90/fixes
merge(loader): default suffix and types
2 parents 1120e5d + 993cb6d commit 5211814

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

projects/multi-http-loader/src/lib/multi-http-loader.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ export interface TranslationResource {
1212
export class MultiTranslateHttpLoader implements TranslateLoader {
1313
constructor(
1414
private _handler: HttpBackend,
15-
private _resourcesPrefix: string[] | TranslationResource[],
15+
private _resourcesPrefix: (string | TranslationResource)[],
1616
) {}
1717

1818
public getTranslation(lang: string): Observable<any> {
1919
const requests: Observable<Object | {}>[] = this._resourcesPrefix.map((resource) => {
2020
let path: string
2121

2222
if (typeof resource === 'string') path = `${resource}${lang}.json`
23-
else path = `${resource.prefix}${lang}${resource.suffix || '.json'}`
23+
else path = `${resource.prefix}${lang}${resource.suffix ?? '.json'}`
2424

2525
return new HttpClient(this._handler).get(path).pipe(
2626
catchError((res) => {

0 commit comments

Comments
 (0)