mirror of
https://github.com/n8n-io/n8n.git
synced 2026-06-04 18:49:20 +02:00
* feat: add Datatable component * feat: migrate to n8n-pagination and add datatable tests * chore: fix linting issue
15 lines
417 B
TypeScript
15 lines
417 B
TypeScript
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access */
|
|
|
|
/**
|
|
* Get a deeply nested value based on a given path string
|
|
*
|
|
* @param object
|
|
* @param path
|
|
* @returns {T}
|
|
*/
|
|
export function getValueByPath<T = any>(object: any, path: string): T {
|
|
return path.split('.').reduce((acc, part) => {
|
|
return acc && acc[part];
|
|
}, object);
|
|
}
|