Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (numericResult) {
return t.forNumericStatement(
this.transform(numericResult.variable),
this.transform(numericResult.start),
this.transform(numericResult.end),
this.transform(numericResult.step),
this.transformBlock(node.body),
);
}
// Use `while` for more complicated cases
const body = this.transformBlock(node.body);
if (node.update) body.push(this.transform(bt.expressionStatement(node.update)));
return [
...(node.init ? this.transform(node.init) : []),
t.whileStatement(node.test ? this.transform(node.test) : t.booleanLiteral(true), body),
];
}
export function BooleanLiteral(node) {
return t.booleanLiteral(node.value);
}