feat: Add basic Datatable and Pagination components (#5652)

* feat: add Datatable component

* feat: migrate to n8n-pagination and add datatable tests

* chore: fix linting issue
This commit is contained in:
Alex Grozav
2023-03-15 18:52:02 +02:00
committed by GitHub
parent b4e60c3b47
commit 29f2629716
16 changed files with 523 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
/* 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);
}