UNPKG

openapi3-generator

Version:

Use your API OpenAPI 3 definition to generate code, documentation, and literally anything you need.

15 lines (13 loc) 317 B
module.exports = (Handlebars, _) =>{ Handlebars.registerHelper('stringify', json => { if (!(json instanceof String) && typeof json !== 'string' ) { try { return JSON.stringify(json || '', null, 2); } catch (e) { return ''; } } else { return json; } }); }