Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const template = require("@babel/template").default;
const parseAndBuildMetadata = require("@babel/template/lib/parse").default;
const smartFormater = require("@babel/template/lib/formatters").smart;
function macro({types: t}) {
const macroMap = {};
function defineMacro(ident, body) {
let content = '';
if (t.isStringLiteral(body)) {
content = body.value;
}
// Just merge elements
if (t.isTemplateLiteral(body)) {
content = body.quasis.reduce((acc, e) => {
acc += e.value.raw;
return acc;