Permalink
Browse files

Changes `getObject` return value

  • Loading branch information...
baflo committed Jan 31, 2019
1 parent 33e53da commit ec580270d818f63c9cae38def9881b4546634b20
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/components/i18n/public-interfaces.ts
  2. +1 −1 src/components/i18n/translate-helper.ts
@@ -50,7 +50,7 @@ export interface TranslateHelper extends ShortT {
* @param locals Variables to use in reponse
* @return nested structure with translations
*/
getObject(key?: string, locals?: { [name: string]: string | number | object }): Promise<string | string[] | object>;
getObject<T = any>(key?: string, locals?: { [name: string]: string | number | object }): Promise<T>;
}

export interface InterpolationResolver {
@@ -108,7 +108,7 @@ export class TranslateHelper implements TranslateHelperInterface {
return translation.split(arraySplitter);
}

public async getObject(key?: string, locals: { [name: string]: string | number | object } = {}): Promise<string | string[] | object> {
public async getObject(key?: string, locals: { [name: string]: string | number | object } = {}) {
// Set internal assistantjs option for array-returns-sample.plugin
locals[optionsObjectName] = { [optionEnablingArrayReturn]: true };

0 comments on commit ec58027

Please sign in to comment.