Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function parseNode(a) {
if (isStr(a))
return template.ast(a);
if (!a.node)
return a;
return a.node;
}
function parseTemplate(tmpl) {
const node = template.ast(tmpl);
if (tmpl === '__object')
return [node, __OBJECT_TYPE];
if (tmpl === '__array')
return [node, __ARRAY_TYPE];
const {type} = node;
return [node, type];
}
const fix = (from, to, path) => {
const nodeFrom = template.ast(from);
const watermark = `${from} -> ${to}`;
path._putout = path._putout || [];
if (path._putout.includes(watermark))
return;
if (!compare(path, nodeFrom))
return;
if (!to)
return path.remove();
const nodeTo = template.ast.fresh(to);
const {node} = path;