Reimplement 'babel-template' with better caching and tagged literal utilities.

This commit is contained in:
Logan Smyth
2017-10-15 15:50:14 -04:00
parent 191624d800
commit cc802c1e00
15 changed files with 1050 additions and 422 deletions

View File

@@ -5,9 +5,9 @@ import template from "@babel/template";
const helpers = {};
export default helpers;
function defineHelper(str) {
return template(str);
}
// Helpers never include placeholders, so we disable placeholder pattern
// matching to allow us to use pattern-like variable names.
const defineHelper = template({ placeholderPattern: false });
helpers.typeof = defineHelper(`
export default function _typeof(obj) {