Fix template function (#105)

This commit is contained in:
John Wu
2021-11-09 16:08:04 -08:00
committed by GitHub
parent 6a20f8f003
commit a81d4960c1
6 changed files with 39 additions and 30 deletions

View File

@@ -4,7 +4,7 @@ const template = (props, value) => {
const keys = Object.keys(props);
return keys.reduce(
(current, key) => current.replace(`\${${key}}`, props[key]),
(current, key) => current.replace(`{${key}}`, props[key]),
value
);
};