frontend initiatewith shadcn uis
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
export function getNestedValue(obj: unknown, path: string): unknown {
|
||||
return path.split('.').reduce(
|
||||
(acc, key) => (acc as Record<string, unknown>)?.[key], obj
|
||||
);
|
||||
}
|
||||
|
||||
export function resolveUrlTemplate(template: string, row: unknown): string {
|
||||
return template.replace(/\{(\w+(?:\.\w+)*)\}/g, (_, path) =>
|
||||
String(getNestedValue(row, path) ?? '')
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user