openapi-typescript-codegen/src/utils/registerHandlebarHelpers.ts
2019-11-21 23:19:22 +01:00

9 lines
305 B
TypeScript

import * as Handlebars from 'handlebars';
export function registerHandlebarHelpers(): void {
Handlebars.registerHelper('eq', function(a: string, b: string, options: Handlebars.HelperOptions): string {
// @ts-ignore
return a === b ? options.fn(this) : options.inverse(this);
});
}