This extracts all core and editor changes from #7246 and #7137, so that we can get these changes merged first. ADO-1120 [DB Tests](https://github.com/n8n-io/n8n/actions/runs/6379749011) [E2E Tests](https://github.com/n8n-io/n8n/actions/runs/6379751480) [Workflow Tests](https://github.com/n8n-io/n8n/actions/runs/6379752828) --------- Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com> Co-authored-by: Oleg Ivaniv <me@olegivaniv.com> Co-authored-by: Alex Grozav <alex@grozav.com> Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
15 lines
331 B
TypeScript
15 lines
331 B
TypeScript
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
|
|
/**
|
|
* 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?.[part];
|
|
}, object);
|
|
}
|