@compodoc/compodoc
Version:
The missing documentation tool for your Angular application
12 lines (10 loc) • 414 B
text/typescript
import { IHtmlEngineHelper, IHandlebarsOptions } from './html-engine-helper.interface';
export class HasOwnHelper implements IHtmlEngineHelper {
public helperFunc(context: any, entity, key: any, options: IHandlebarsOptions): string {
if (Object.hasOwnProperty.call(entity, key)) {
return options.fn(context);
} else {
return options.inverse(context);
}
}
}