File tree Expand file tree Collapse file tree
openapi-python/src/generate Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,9 +5,10 @@ import path from 'node:path';
55 */
66function outputHeaderToPrefix ( header : unknown ) : string {
77 if ( header == null || typeof header === 'function' ) return '' ;
8- const lines = Array . isArray ( header )
9- ? ( header as string [ ] ) . flatMap ( ( line ) => line . split ( / \r ? \n / ) )
10- : ( header as string ) . split ( / \r ? \n / ) ;
8+ const lines =
9+ typeof header === 'string'
10+ ? header . split ( / \r ? \n / )
11+ : ( header as string [ ] ) . flatMap ( ( line ) => line . split ( / \r ? \n / ) ) ;
1112 const content = lines . join ( '\n' ) ;
1213 return content ? `${ content } \n\n` : '' ;
1314}
Original file line number Diff line number Diff line change @@ -60,9 +60,10 @@ function getClientBundlePaths(pluginName: string): {
6060 */
6161function outputHeaderToPrefix ( header : OutputHeader ) : string {
6262 if ( header == null || typeof header === 'function' ) return '' ;
63- const lines = Array . isArray ( header )
64- ? header . flatMap ( ( line ) => line . split ( / \r ? \n / ) )
65- : header . split ( / \r ? \n / ) ;
63+ const lines =
64+ typeof header === 'string'
65+ ? header . split ( / \r ? \n / )
66+ : header . flatMap ( ( line ) => line . split ( / \r ? \n / ) ) ;
6667 const content = lines . join ( '\n' ) ;
6768 return content ? `${ content } \n\n` : '' ;
6869}
Original file line number Diff line number Diff line change @@ -5,9 +5,10 @@ import path from 'node:path';
55 */
66function outputHeaderToPrefix ( header : unknown ) : string {
77 if ( header == null || typeof header === 'function' ) return '' ;
8- const lines = Array . isArray ( header )
9- ? ( header as string [ ] ) . flatMap ( ( line ) => line . split ( / \r ? \n / ) )
10- : ( header as string ) . split ( / \r ? \n / ) ;
8+ const lines =
9+ typeof header === 'string'
10+ ? header . split ( / \r ? \n / )
11+ : ( header as string [ ] ) . flatMap ( ( line ) => line . split ( / \r ? \n / ) ) ;
1112 const content = lines . join ( '\n' ) ;
1213 return content ? `${ content } \n\n` : '' ;
1314}
Original file line number Diff line number Diff line change @@ -60,9 +60,10 @@ function getClientBundlePaths(pluginName: string): {
6060 */
6161function outputHeaderToPrefix ( header : OutputHeader ) : string {
6262 if ( header == null || typeof header === 'function' ) return '' ;
63- const lines = Array . isArray ( header )
64- ? header . flatMap ( ( line ) => line . split ( / \r ? \n / ) )
65- : header . split ( / \r ? \n / ) ;
63+ const lines =
64+ typeof header === 'string'
65+ ? header . split ( / \r ? \n / )
66+ : header . flatMap ( ( line ) => line . split ( / \r ? \n / ) ) ;
6667 const content = lines . join ( '\n' ) ;
6768 return content ? `${ content } \n\n` : '' ;
6869}
You can’t perform that action at this time.
0 commit comments