File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
services/personality_insights Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -20,17 +20,9 @@ var extend = require('extend');
2020var requestFactory = require ( '../../lib/requestwrapper' ) ;
2121var pick = require ( 'object.pick' ) ;
2222var omit = require ( 'object.omit' ) ;
23+ var herper = require ( '../../lib/helper' ) ;
2324
2425
25- /**
26- * Return true if 'text' is html
27- * @param {String } text The 'text' to analyze
28- * @return {Boolean } true if 'text' has html tags
29- */
30- function isHTML ( text ) {
31- return / < [ a - z ] [ \s \S ] * > / i. test ( text ) ;
32- }
33-
3426function PersonalityInsights ( options ) {
3527 // Default URL
3628 var serviceDefaults = {
@@ -62,7 +54,7 @@ PersonalityInsights.prototype.profile = function(params, callback) {
6254 // Content-Type
6355 var content_type = null ;
6456 if ( params . text )
65- content_type = isHTML ( params . text ) ? 'text/html' : 'text/plain' ;
57+ content_type = herper . isHTML ( params . text ) ? 'text/html' : 'text/plain' ;
6658 else
6759 content_type = 'application/json' ;
6860
You can’t perform that action at this time.
0 commit comments