mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 19:21:04 +01:00
Switch from underscore to lodash
This commit is contained in:
@@ -6,12 +6,10 @@ var winston = require('winston');
|
||||
var async = require('async');
|
||||
var nconf = require('nconf');
|
||||
var session = require('express-session');
|
||||
var _ = require('underscore');
|
||||
var _ = require('lodash');
|
||||
var semver = require('semver');
|
||||
var db;
|
||||
|
||||
_.mixin(require('underscore.deep'));
|
||||
|
||||
var mongoModule = module.exports;
|
||||
|
||||
mongoModule.questions = [
|
||||
@@ -87,7 +85,7 @@ mongoModule.init = function (callback) {
|
||||
autoReconnect: true,
|
||||
};
|
||||
|
||||
connOptions = _.deepExtend(connOptions, nconf.get('mongo:options') || {});
|
||||
connOptions = _.merge(connOptions, nconf.get('mongo:options') || {});
|
||||
|
||||
mongoClient.connect(connString, connOptions, function (err, _db) {
|
||||
if (err) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('underscore');
|
||||
var _ = require('lodash');
|
||||
var async = require('async');
|
||||
var winston = require('winston');
|
||||
var nconf = require('nconf');
|
||||
@@ -9,8 +9,6 @@ var session = require('express-session');
|
||||
var redis = require('redis');
|
||||
var redisClient;
|
||||
|
||||
_.mixin(require('underscore.deep'));
|
||||
|
||||
var redisModule = module.exports;
|
||||
|
||||
redisModule.questions = [
|
||||
@@ -78,7 +76,7 @@ redisModule.connect = function (options) {
|
||||
options.auth_pass = nconf.get('redis:password');
|
||||
}
|
||||
|
||||
options = _.deepExtend(options, nconf.get('redis:options') || {});
|
||||
options = _.merge(options, nconf.get('redis:options') || {});
|
||||
|
||||
if (redis_socket_or_host && redis_socket_or_host.indexOf('/') >= 0) {
|
||||
/* If redis.host contains a path name character, use the unix dom sock connection. ie, /tmp/redis.sock */
|
||||
|
||||
Reference in New Issue
Block a user