Closed shuhrat closed 10 years ago
I have an bemjson object, it contains an array which first element is false or undefined
false
undefined
{ block: 'button', content: [ false, // can olso be undefined { elem: 'inner' }, { elem: 'inner' }, { elem: 'inner' } ] }
and matcher
bh.match('button__inner', function(ctx) { if (ctx.isFirst()) { ctx.mod('first', 'yes'); } if (ctx.isLast()) { ctx.mod('last', 'yes'); } });
when I apply matcher to the bemjson getting
<div class="button"> <div class="button__inner"></div> <div class="button__inner"></div> <div class="button__inner button__inner_last_yes"></div> </div>
instead of expected
<div class="button"> <div class="button__inner button__inner_first_yes"></div> <div class="button__inner"></div> <div class="button__inner button__inner_last_yes"></div> </div>
Duplicate of #46
I have an bemjson object, it contains an array which first element is
false
orundefined
and matcher
when I apply matcher to the bemjson getting
instead of expected