frontend initiatewith shadcn uis

This commit is contained in:
Kalana B. Thilakarathna
2026-08-25 16:20:50 +05:30
parent 92fef1dfa8
commit f1c036d1d8
136 changed files with 20257 additions and 0 deletions
@@ -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) ?? '')
);
}