UNPKG

sweetpea

Version:

Signal and Web Component Enhanced Web Apps

2 lines (1 loc) 135 B
export default function interpolate(t, c){return t.replace(/\${([^}]+)}/g,(m,p)=>p.split('.').reduce((a,f)=>a?a[f]:undefined,c)??'');}