1 | import { IHtmlEngineHelper, IHandlebarsOptions } from './html-engine-helper.interface';
|
2 | import * as _ from 'lodash';
|
3 |
|
4 | export 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 | }
|