Commit 2d71b6cc authored by analog-nico's avatar analog-nico
Browse files

Reverted native functions to lodash as discussed in PR #54

parent 225f0278
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -3,9 +3,12 @@
var Bluebird = require('./bluebird-fresh.js'),
var Bluebird = require('./bluebird-fresh.js'),
    CapturedTrace = require('./bluebird-captured-trace-fresh.js'),
    CapturedTrace = require('./bluebird-captured-trace-fresh.js'),
    assign = require('lodash/object/assign'),
    assign = require('lodash/object/assign'),
    forEach = require('lodash/collection/forEach'),
    isFunction = require('lodash/lang/isFunction'),
    isFunction = require('lodash/lang/isFunction'),
    isPlainObject = require('lodash/lang/isPlainObject'),
    isPlainObject = require('lodash/lang/isPlainObject'),
    isString = require('lodash/lang/isString'),
    isString = require('lodash/lang/isString'),
    isUndefined = require('lodash/lang/isUndefined'),
    keys = require('lodash/object/keys'),
    chalk = require('chalk'),
    chalk = require('chalk'),
    errors = require('./errors.js');
    errors = require('./errors.js');


@@ -14,7 +17,7 @@ var Bluebird = require('./bluebird-fresh.js'),
var request = (function () {
var request = (function () {


    function clearCache() {
    function clearCache() {
        Object.keys(require.cache).forEach(function (key) {
        forEach(keys(require.cache), function (key) {
            delete require.cache[key];
            delete require.cache[key];
        });
        });
    }
    }
@@ -131,7 +134,7 @@ function expose(methodToExpose, exposeAs) {
    exposeAs = exposeAs || methodToExpose;
    exposeAs = exposeAs || methodToExpose;


    /* istanbul ignore if */
    /* istanbul ignore if */
    if (request.Request.prototype[exposeAs] !== undefined) {
    if (!isUndefined(request.Request.prototype[exposeAs])) {
        console.error(chalk.bold.bgRed('[Request-Promise] Unable to expose method "' + exposeAs + '". It is already implemented by Request. Please visit https://github.com/request/request-promise/wiki/Troubleshooting'));
        console.error(chalk.bold.bgRed('[Request-Promise] Unable to expose method "' + exposeAs + '". It is already implemented by Request. Please visit https://github.com/request/request-promise/wiki/Troubleshooting'));
        return;
        return;
    }
    }