File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,20 +85,6 @@ module.exports = function (RED) {
8585 } ;
8686
8787
88- // function to parse through the options in preparation
89- // for the sevice call.
90- var parseOptions = function ( msg , config ) {
91- var options = {
92- 'text' : msg . payload ,
93- 'sentences' : msg . sentences || config . sentences ,
94- 'isHTML' : msg . contentType || config . contentType
95- } ;
96-
97- options . tones = toneutils . parseToneOption ( msg , config ) ;
98- return options ;
99- }
100-
101-
10288 // function when the node recieves input inside a flow.
10389 // Configuration is first checked before the service is invoked.
10490 var processOnInput = function ( msg , config , node ) {
@@ -115,7 +101,7 @@ module.exports = function (RED) {
115101 'version_date' : '2016-05-19'
116102 } ) ;
117103
118- var options = parseOptions ( msg , config ) ;
104+ var options = toneutils . parseOptions ( msg , config ) ;
119105
120106 node . status ( { fill :'blue' , shape :'dot' , text :'requesting' } ) ;
121107 tone_analyzer . tone ( options , function ( err , response ) {
Original file line number Diff line number Diff line change @@ -51,6 +51,19 @@ ToneUtils.prototype = {
5151 var tones = msg . tones || config . tones ;
5252
5353 return ( tones === 'all' ? '' : tones ) ;
54+ } ,
55+
56+ // function to parse through the options in preparation
57+ // for the sevice call.
58+ parseOptions : function ( msg , config ) {
59+ var options = {
60+ 'text' : msg . payload ,
61+ 'sentences' : msg . sentences || config . sentences ,
62+ 'isHTML' : msg . contentType || config . contentType
63+ } ;
64+
65+ options . tones = toneutils . parseToneOption ( msg , config ) ;
66+ return options ;
5467 }
5568
5669
You can’t perform that action at this time.
0 commit comments