How to use the ibm-cloud-sdk-core.toLowerKeys function in ibm-cloud-sdk-core

To help you get started, we’ve selected a few ibm-cloud-sdk-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github umple / umple / umpleonline / watson / node_modules / watson-developer-cloud / personality-insights / v3.js View on Github external
}
        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);
    };
    /**