Commit 477ee90e50bce2d5412d3664942bd6913ddb2028
1 parent
72374979
UI: Added the ability to get the value of a key that contains dots in the name to a table widgets
Showing
1 changed file
with
3 additions
and
0 deletions
@@ -324,6 +324,9 @@ export function snakeCase(name: string, separator: string): string { | @@ -324,6 +324,9 @@ export function snakeCase(name: string, separator: string): string { | ||
324 | } | 324 | } |
325 | 325 | ||
326 | export function getDescendantProp(obj: any, path: string): any { | 326 | export function getDescendantProp(obj: any, path: string): any { |
327 | + if (obj.hasOwnProperty(path)) { | ||
328 | + return obj[path]; | ||
329 | + } | ||
327 | return path.split('.').reduce((acc, part) => acc && acc[part], obj); | 330 | return path.split('.').reduce((acc, part) => acc && acc[part], obj); |
328 | } | 331 | } |
329 | 332 |