Created
September 2, 2019 07:04
-
-
Save zzzgit/2bb2ffe778a982051415c81b3c443015 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const tmpl = require('lodash.template') | |
const tmplOption = { | |
evaluate: /{{([\s\S]+?)}}/g, | |
escape: /{{-([\s\S]+?)}}/g, | |
interpolate: /{{=([\s\S]+?)}}/g, | |
} | |
template(str) { | |
return tmpl(str, tmplOption) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment