mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +00:00
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:
14
packages/design-system/src/utils/valueByPath.ts
Normal file
14
packages/design-system/src/utils/valueByPath.ts
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user