File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,9 +58,6 @@ const addSubject = (subject?: string, colorize?: boolean) => {
5858 return subject . trim ( ) ;
5959} ;
6060
61- const addBreaklinesIfNeeded = ( value : string , breaklineChar = "|" ) =>
62- value . split ( breaklineChar ) . join ( "\n" ) . valueOf ( ) ;
63-
6461const addFooter = ( footer : string , footerPrefix = "" , colorize ?: boolean ) => {
6562 if ( footerPrefix === "" ) {
6663 return colorize ? `\n\n\u001B[32m${ footer } \u001B[0m` : `\n\n${ footer } ` ;
@@ -76,6 +73,7 @@ export const generateMessage = (
7673 colorize = false
7774) => {
7875 const wrapOptions = {
76+ breaklineChar : options . breaklineChar || "|" ,
7977 trim : true ,
8078 newLine : "\n" ,
8179 indent : "" ,
@@ -93,10 +91,10 @@ export const generateMessage = (
9391
9492 let result = head ;
9593 if ( body ) {
96- result += `\n\n${ addBreaklinesIfNeeded ( body , options . breaklineChar ) } ` ;
94+ result += `\n\n${ body } ` ;
9795 }
9896 if ( breaking ) {
99- result += `\n\nBREAKING CHANGE :\n${ addBreaklinesIfNeeded ( breaking , options . breaklineChar ) } ` ;
97+ result += `\n\nBREAKING CHANGE :\n${ breaking } ` ;
10098 }
10199 if ( footer ) {
102100 result += addFooter ( footer , answers . footerPrefix || singeIssuePrefix , colorize ) ;
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ function identity(str: string) {
77}
88
99interface Options {
10+ breaklineChar : string ;
1011 width ?: number ;
1112 indent ?: string ;
1213 newline ?: string ;
@@ -15,11 +16,12 @@ interface Options {
1516 cut ?: boolean ;
1617}
1718
18- export const wrap = ( str : string , options : Options ) => {
19- options = options || { } ;
19+ export const wrap = ( str : string , options ? : Options ) => {
20+ options = options || { breaklineChar : "|" } ;
2021 if ( str == null ) {
2122 return str ;
2223 }
24+ str = str . split ( options . breaklineChar ) . join ( "\n" ) . valueOf ( ) ;
2325
2426 const width = options . width || 100 ;
2527 const indent = typeof options . indent === "string" ? options . indent : "" ;
You can’t perform that action at this time.
0 commit comments