import { EOL } from "os" ; import type { OpenApi } from "../../types" ; const pkg = require ( "../../../package.json" ) ; export const generateLeading = ( schema ) : string => { const messages = [ ] ; messages . push ( "" ) ; messages . push ( `Generated by ${ pkg . name } v${ pkg . version }` ) ; messages . push ( "" ) ; messages . push ( `OpenApi : ${ schema . openapi }` ) ; messages . push ( "" ) ; if ( schema . info . license ) { if ( schema . info . license . name ) { messages . push ( `License  : ${ schema . info . license . name }` ) ; } if ( schema . info . license . url ) { messages . push ( `Url      : ${ schema . info . license . url }` ) ; } } messages . push ( "" ) ; return messages . map ( message => { return `// ${ message }` ; } ) . join ( EOL ) ; } ;