UNPKG

435 BPlain TextView Raw
1import { IHtmlEngineHelper, IHandlebarsOptions } from './html-engine-helper.interface';
2import * as _ from 'lodash';
3
4export class IsTabEnabledHelper implements IHtmlEngineHelper {
5 public helperFunc(context: any, tabs: Array<any>, tabId: String, options: IHandlebarsOptions) {
6 let isTabEnabled = -1 !== _.findIndex(tabs, { id: tabId });
7 return isTabEnabled ? options.fn(context) : options.inverse(context);
8 }
9}