mirror of
https://github.com/johndoe6345789/low-code-react-app-b.git
synced 2026-04-26 14:44:55 +00:00
6 lines
243 B
TypeScript
6 lines
243 B
TypeScript
export const formatCopy = (template: string, values: Record<string, string | number> = {}) =>
|
|
template.replace(/\{(\w+)\}/g, (match, key: string) => {
|
|
const value = values[key]
|
|
return value === undefined ? match : String(value)
|
|
})
|