Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function classnamesSubexpr(rewrite: IndexedClassRewrite<style>, element: TemplateElement): AST.SubExpression {
return builders.sexpr(
builders.path(CLASSNAMES_HELPER_NAME),
constructArgs(rewrite, element),
);
}
</style>
function moustacheToStringExpression(stringExpression: StringAST): AST.Expression {
if (stringExpression!.type === "ConcatStatement") {
return builders.sexpr(
builders.path(CONCAT_HELPER_NAME),
(stringExpression as AST.ConcatStatement).parts.reduce(
(arr, val) => {
if (val.type === "TextNode") {
arr.push(builders.string(val.chars));
} else {
arr.push(val.path);
}
return arr;
},
new Array()));
} else {
return moustacheToExpression(stringExpression as AST.MustacheStatement);
}
}
export function classnamesHelper(rewrite: IndexedClassRewrite<style>, element: TemplateElement): AST.MustacheStatement {
return builders.mustache(
builders.path(CLASSNAMES_HELPER_NAME),
constructArgs(rewrite, element),
);
}
</style>