File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,21 @@ var loginClient = function(client, tries) {
69
69
} ) ;
70
70
} ;
71
71
72
+ var splitTitle = function ( title ) {
73
+ title = title || "" ;
74
+
75
+ if ( typeof title === "string" ) {
76
+ if ( title . indexOf ( '-' ) >= 0 )
77
+ title = title . split ( '-' ) . map ( function ( str ) { return str . trim ( ) ; } ) ;
78
+ else if ( title . indexOf ( ' ' ) >= 0 )
79
+ title = title . split ( ' ' ) . map ( function ( str ) { return str . trim ( ) ; } ) ;
80
+ else
81
+ title = [ title , title ] ;
82
+ }
83
+
84
+ return title ;
85
+ } ;
86
+
72
87
var decode = function ( str ) {
73
88
if ( typeof str !== "string" )
74
89
return str ;
@@ -84,5 +99,6 @@ var decode = function(str) {
84
99
exports . setErrorMessage = setErrorMessage ;
85
100
exports . createIterator = createIterator ;
86
101
exports . loginClient = loginClient ;
102
+ exports . splitTitle = splitTitle ;
87
103
exports . waterfall = waterfall ;
88
104
exports . decode = decode ;
You can’t perform that action at this time.
0 commit comments