How to use the @glimmer/syntax.builders.path function in @glimmer/syntax

To help you get started, we’ve selected a few @glimmer/syntax examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github linkedin / css-blocks / packages / @css-blocks / glimmer / src / ClassnamesHelperGenerator.ts View on Github external
export function classnamesSubexpr(rewrite: IndexedClassRewrite<style>, element: TemplateElement): AST.SubExpression {
  return builders.sexpr(
    builders.path(CLASSNAMES_HELPER_NAME),
    constructArgs(rewrite, element),
  );
}
</style>
github linkedin / css-blocks / packages / @css-blocks / glimmer / src / ClassnamesHelperGenerator.ts View on Github external
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) =&gt; {
          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);
  }
}
github linkedin / css-blocks / packages / @css-blocks / glimmer / src / ClassnamesHelperGenerator.ts View on Github external
export function classnamesHelper(rewrite: IndexedClassRewrite<style>, element: TemplateElement): AST.MustacheStatement {
  return builders.mustache(
    builders.path(CLASSNAMES_HELPER_NAME),
    constructArgs(rewrite, element),
  );
}
</style>