UNPKG

jsot-bh

Version:

BH wrapper for JSOT template engine

20 lines (16 loc) 441 B
var BH = require('bh').BH; var bh = new BH(); function construct(obj, depth) { if (depth < 2) { obj.content = [ construct({ block: 'block' }, depth + 1), construct({ block: 'block' }, depth + 1), construct({ block: 'block' }, depth + 1) ]; } return obj; } bh.match('block', function (ctx) { ctx.tag('deep'); }); console.log(bh.apply(construct({block: 'block'}, 0)));