1 | import { IHtmlEngineHelper, IHandlebarsOptions } from './html-engine-helper.interface';
|
2 |
|
3 | export class HasOwnHelper implements IHtmlEngineHelper {
|
4 | public helperFunc(context: any, entity, key: any, options: IHandlebarsOptions): string {
|
5 | if (Object.hasOwnProperty.call(entity, key)) {
|
6 | return options.fn(context);
|
7 | } else {
|
8 | return options.inverse(context);
|
9 | }
|
10 | }
|
11 | }
|