From 6c079e24d8689538560dfa95b421c8fef24d9cf9 Mon Sep 17 00:00:00 2001 From: Jan Date: Wed, 5 Feb 2020 17:06:59 +0100 Subject: [PATCH] fix(service) handle non-string keys without throwing (#1021) --- projects/ngx-translate/core/src/lib/translate.parser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/ngx-translate/core/src/lib/translate.parser.ts b/projects/ngx-translate/core/src/lib/translate.parser.ts index d10e4ccd..a6077c95 100644 --- a/projects/ngx-translate/core/src/lib/translate.parser.ts +++ b/projects/ngx-translate/core/src/lib/translate.parser.ts @@ -39,7 +39,7 @@ export class TranslateDefaultParser extends TranslateParser { } getValue(target: any, key: string): any { - let keys = key.split('.'); + let keys = typeof key === 'string' ? key.split('.') : [key]; key = ''; do { key += keys.shift();