Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function setValues({waysTo, values, path}) {
for (const [name, ways] of entries(waysTo)) {
if (!ways) {
replaceWith(path, values[name]);
continue;
}
for (const way of ways) {
nessy(way, values[name], path.node);
}
}
}
return;
if (!to)
return path.remove();
const nodeTo = template.ast.fresh(to);
const {node} = path;
const waysFrom = findVarsWays(nodeFrom);
const waysTo = findVarsWays(nodeTo);
const values = getValues({
waysFrom,
node,
});
replaceWith(path, nodeTo);
setValues({
waysTo,
values,
path,
});
path._putout.push(watermark);
};