interpolate-es
Advanced tools
Comparing version 1.0.10 to 1.1.0
@@ -1,1 +0,1 @@ | ||
export default function(e,t={}){const n=Object.keys(t),u=Object.values(t);return new Function(...n,`return \`${e}\`;`)(...u)} | ||
export default function(r,o={}){const e=Object.keys(o),n=Object.values(o);try{return new Function(...e,`return \`${r}\`;`)(...n)}catch(e){throw console.group("Template Error:"),console.error(o),console.error(r),console.groupEnd(),Error(e)}} |
{ | ||
"name": "interpolate-es", | ||
"version": "1.0.10", | ||
"version": "1.1.0", | ||
"description": "Dynamically build tagged templates", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -12,3 +12,11 @@ /* eslint-disable no-new-func */ | ||
const values = Object.values(tags); | ||
return new Function(...keys, `return \`${template}\`;`)(...values); | ||
try { | ||
return new Function(...keys, `return \`${template}\`;`)(...values); | ||
} catch (e) { | ||
console.group('Template Error:'); | ||
console.error(tags); | ||
console.error(template); | ||
console.groupEnd(); | ||
throw Error(e); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6058
55