UNPKG

318 BJavaScriptView Raw
1const TWO = 2;
2
3export default function trivialTemplateTag(f) {
4 return (strings, ...interpolations) => {
5 const chunks = [...strings];
6 // insert the interpolations where they belong to
7 interpolations.forEach((value, i) =>
8 chunks.splice(TWO * i + 1, 0, value));
9 return f(chunks.join(''));
10 };
11}