Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
var contentType = null;
if (params.text) {
contentType = ibm_cloud_sdk_core_1.isHTML(params.text) ? 'text/html' : 'text/plain';
}
else {
contentType = 'application/json';
}
var newParams = {
content: params.text || pick(params, ['contentItems']),
content_type: contentType,
raw_scores: params.raw_scores,
csv_headers: params.csv_headers,
consumption_preferences: params.consumption_preferences
};
var headers = ibm_cloud_sdk_core_1.toLowerKeys(params.headers);
if (headers['accept-language']) {
newParams.accept_language = headers['accept-language'];
}
if (headers['content-type']) {
newParams.content_type = headers['content-type'];
}
if (headers['content-language']) {
newParams.content_language = headers['content-language'];
}
if (headers['accept'] === 'text/csv') {
return this.profile_csv(newParams, callback);
}
return _super.prototype.profile.call(this, newParams, callback);
};
/**