How to use the Visitor function from handlebars

Find comprehensive JavaScript handlebars.Visitor code examples handpicked from public code repositorys.

58
59
60
61
62
63
64
65
66
67
68
}


function buildThemeRawHbsTemplateManipulatorPlugin(themeId) {
  return function (ast) {
    ["SubExpression", "MustacheStatement"].forEach((pass) => {
      let visitor = new Handlebars.Visitor();
      visitor.mutating = true;
      visitor[pass] = (node) => manipulateAstNodeForTheme(node, themeId);
      visitor.accept(ast);
    });
fork icon0
star icon0
watch icon0

48
49
50
51
52
53
54
55
56
57
58
59
        block.params[0],
      ];
      delete block.program.blockParams;
    }


    return Handlebars.Visitor.prototype.BlockStatement.call(this, block);
  };


  visitor.accept(ast);
}
fork icon0
star icon0
watch icon0

+ 2 other calls in file