mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-27 10:42:45 +03:00
Replace underscore with lodash.
This commit is contained in:
parent
ca01b732b2
commit
6eab7b3f92
@ -6,7 +6,7 @@ var path = require('path'),
|
||||
when = require('when'),
|
||||
semver = require('semver'),
|
||||
fs = require('fs'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
spawn = require('child_process').spawn,
|
||||
buildDirectory = path.resolve(process.cwd(), '.build'),
|
||||
distDirectory = path.resolve(process.cwd(), '.dist'),
|
||||
@ -380,7 +380,7 @@ var path = require('path'),
|
||||
'core/shared/vendor/jquery/jquery-ui-1.10.3.custom.min.js',
|
||||
'core/client/assets/lib/jquery-utils.js',
|
||||
'core/client/assets/lib/uploader.js',
|
||||
'core/shared/vendor/underscore.js',
|
||||
'core/shared/vendor/lodash.underscore.js',
|
||||
'core/shared/vendor/backbone/backbone.js',
|
||||
'core/shared/vendor/handlebars/handlebars-runtime.js',
|
||||
'core/shared/vendor/moment.js',
|
||||
@ -435,7 +435,7 @@ var path = require('path'),
|
||||
'core/shared/vendor/jquery/jquery-ui-1.10.3.custom.min.js',
|
||||
'core/client/assets/lib/jquery-utils.js',
|
||||
'core/client/assets/lib/uploader.js',
|
||||
'core/shared/vendor/underscore.js',
|
||||
'core/shared/vendor/lodash.underscore.js',
|
||||
'core/shared/vendor/backbone/backbone.js',
|
||||
'core/shared/vendor/handlebars/handlebars-runtime.js',
|
||||
'core/shared/vendor/moment.js',
|
||||
|
@ -5,7 +5,7 @@ var dataExport = require('../data/export'),
|
||||
path = require('path'),
|
||||
when = require('when'),
|
||||
nodefn = require('when/node/function'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
schema = require('../data/schema').tables,
|
||||
configPaths = require('../config/paths'),
|
||||
api = {},
|
||||
|
@ -1,7 +1,7 @@
|
||||
// # Ghost Data API
|
||||
// Provides access to the data model
|
||||
|
||||
var _ = require('underscore'),
|
||||
var _ = require('lodash'),
|
||||
when = require('when'),
|
||||
config = require('../config'),
|
||||
errors = require('../errorHandling'),
|
||||
|
@ -1,5 +1,5 @@
|
||||
var when = require('when'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
// Holds the persistent notifications
|
||||
notificationsStore = [],
|
||||
notifications;
|
||||
|
@ -1,5 +1,5 @@
|
||||
var when = require('when'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
dataProvider = require('../models'),
|
||||
permissions = require('../permissions'),
|
||||
canThis = permissions.canThis,
|
||||
|
@ -1,4 +1,4 @@
|
||||
var _ = require('underscore'),
|
||||
var _ = require('lodash'),
|
||||
dataProvider = require('../models'),
|
||||
when = require('when'),
|
||||
errors = require('../errorHandling'),
|
||||
|
@ -1,5 +1,5 @@
|
||||
var when = require('when'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
dataProvider = require('../models'),
|
||||
settings = require('./settings'),
|
||||
ONE_DAY = 86400000,
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
var _ = require('underscore'),
|
||||
var _ = require('lodash'),
|
||||
when = require('when'),
|
||||
errors = require('../errorHandling'),
|
||||
api = require('../api'),
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
var path = require('path'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
when = require('when'),
|
||||
appProxy = require('./proxy'),
|
||||
config = require('../config'),
|
||||
|
@ -1,4 +1,4 @@
|
||||
var _ = require('underscore'),
|
||||
var _ = require('lodash'),
|
||||
api = require('../api'),
|
||||
helpers = require('../helpers'),
|
||||
filters = require('../filters');
|
||||
|
@ -2,7 +2,7 @@
|
||||
var fs = require('fs'),
|
||||
path = require('path'),
|
||||
Module = require('module'),
|
||||
_ = require('underscore');
|
||||
_ = require('lodash');
|
||||
|
||||
function AppSandbox(opts) {
|
||||
this.opts = _.defaults(opts || {}, AppSandbox.defaults);
|
||||
|
@ -5,7 +5,7 @@ var moment = require('moment'),
|
||||
path = require('path'),
|
||||
when = require('when'),
|
||||
url = require('url'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
requireTree = require('../require-tree'),
|
||||
appRoot = path.resolve(__dirname, '../../../'),
|
||||
corePath = path.resolve(appRoot, 'core/'),
|
||||
|
@ -1,5 +1,5 @@
|
||||
var config = require('../config'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
path = require('path'),
|
||||
when = require('when'),
|
||||
api = require('../api'),
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
var moment = require('moment'),
|
||||
RSS = require('rss'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
url = require('url'),
|
||||
when = require('when'),
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
var when = require('when'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
migration = require('../migration'),
|
||||
knex = require('../../models/base').knex,
|
||||
schema = require('../schema').tables,
|
||||
|
@ -1,5 +1,5 @@
|
||||
var sequence = require('when/sequence'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
Post = require('../../models/post').Post,
|
||||
Tag = require('../../models/tag').Tag,
|
||||
Role = require('../../models/role').Role,
|
||||
|
@ -1,5 +1,5 @@
|
||||
var when = require('when'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
models = require('../../models'),
|
||||
errors = require('../../errorHandling'),
|
||||
Importer000;
|
||||
|
@ -1,4 +1,4 @@
|
||||
var _ = require('underscore'),
|
||||
var _ = require('lodash'),
|
||||
when = require('when'),
|
||||
errors = require('../../errorHandling'),
|
||||
client = require('../../models/base').client,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*jslint regexp: true */
|
||||
var _ = require('underscore'),
|
||||
var _ = require('lodash'),
|
||||
colors = require('colors'),
|
||||
fs = require('fs'),
|
||||
configPaths = require('./config/paths'),
|
||||
@ -227,16 +227,16 @@ errors = {
|
||||
}
|
||||
};
|
||||
|
||||
// Ensure our 'this' context in the functions
|
||||
_.bindAll(
|
||||
errors,
|
||||
'throwError',
|
||||
'logError',
|
||||
// Ensure our 'this' context for methods and preserve method arity by
|
||||
// using Function#bind for expressjs
|
||||
_.each([
|
||||
'logAndThrowError',
|
||||
'logErrorWithRedirect',
|
||||
'renderErrorPage',
|
||||
'error404',
|
||||
'error500'
|
||||
);
|
||||
], function (funcName) {
|
||||
errors[funcName] = errors[funcName].bind(errors);
|
||||
});
|
||||
|
||||
module.exports = errors;
|
||||
|
@ -1,5 +1,5 @@
|
||||
var when = require('when'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
|
||||
defaults;
|
||||
|
||||
|
@ -3,7 +3,7 @@ var downsize = require('downsize'),
|
||||
moment = require('moment'),
|
||||
path = require('path'),
|
||||
polyglot = require('node-polyglot').instance,
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
when = require('when'),
|
||||
|
||||
api = require('../api'),
|
||||
|
@ -7,7 +7,7 @@ var crypto = require('crypto'),
|
||||
path = require('path'),
|
||||
Polyglot = require('node-polyglot'),
|
||||
semver = require('semver'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
when = require('when'),
|
||||
|
||||
api = require('./api'),
|
||||
|
@ -1,6 +1,6 @@
|
||||
var cp = require('child_process'),
|
||||
url = require('url'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
when = require('when'),
|
||||
nodefn = require('when/node/function'),
|
||||
nodemailer = require('nodemailer'),
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
var middleware = require('./middleware'),
|
||||
express = require('express'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
url = require('url'),
|
||||
when = require('when'),
|
||||
slashes = require('connect-slashes'),
|
||||
|
@ -2,7 +2,7 @@
|
||||
// The following custom middleware functions are all unit testable, and have accompanying unit tests in
|
||||
// middleware_spec.js
|
||||
|
||||
var _ = require('underscore'),
|
||||
var _ = require('lodash'),
|
||||
express = require('express'),
|
||||
busboy = require('./ghost-busboy'),
|
||||
config = require('../config'),
|
||||
|
@ -2,7 +2,7 @@ var ghostBookshelf,
|
||||
Bookshelf = require('bookshelf'),
|
||||
when = require('when'),
|
||||
moment = require('moment'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
uuid = require('node-uuid'),
|
||||
config = require('../config'),
|
||||
Validator = require('validator').Validator,
|
||||
|
@ -1,5 +1,5 @@
|
||||
var migrations = require('../data/migration'),
|
||||
_ = require('underscore');
|
||||
_ = require('lodash');
|
||||
|
||||
module.exports = {
|
||||
Post: require('./post').Post,
|
||||
|
@ -1,6 +1,6 @@
|
||||
var Post,
|
||||
Posts,
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
uuid = require('node-uuid'),
|
||||
when = require('when'),
|
||||
errors = require('../errorHandling'),
|
||||
|
@ -2,7 +2,7 @@ var Settings,
|
||||
ghostBookshelf = require('./base'),
|
||||
validator = ghostBookshelf.validator,
|
||||
uuid = require('node-uuid'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
errors = require('../errorHandling'),
|
||||
when = require('when'),
|
||||
defaultSettings;
|
||||
|
@ -1,6 +1,6 @@
|
||||
var User,
|
||||
Users,
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
uuid = require('node-uuid'),
|
||||
when = require('when'),
|
||||
errors = require('../errorHandling'),
|
||||
|
@ -1,7 +1,7 @@
|
||||
// canThis(someUser).edit.posts([id]|[[ids]])
|
||||
// canThis(someUser).edit.post(somePost|somePostId)
|
||||
|
||||
var _ = require('underscore'),
|
||||
var _ = require('lodash'),
|
||||
when = require('when'),
|
||||
Models = require('../models'),
|
||||
objectTypeModelMap = require('./objectTypeModelMap'),
|
||||
|
@ -1,4 +1,4 @@
|
||||
var _ = require('underscore'),
|
||||
var _ = require('lodash'),
|
||||
moment = require('moment'),
|
||||
path = require('path'),
|
||||
when = require('when'),
|
||||
|
@ -1,7 +1,7 @@
|
||||
// # Local File System Image Storage module
|
||||
// The (default) module for storing images, using the local file system
|
||||
|
||||
var _ = require('underscore'),
|
||||
var _ = require('lodash'),
|
||||
express = require('express'),
|
||||
fs = require('fs-extra'),
|
||||
nodefn = require('when/node/function'),
|
||||
|
@ -25,7 +25,7 @@ var crypto = require('crypto'),
|
||||
semver = require('semver'),
|
||||
when = require('when'),
|
||||
nodefn = require('when/node/function'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
url = require('url'),
|
||||
|
||||
api = require('./api'),
|
||||
|
4979
core/shared/vendor/lodash.underscore.js
vendored
Normal file
4979
core/shared/vendor/lodash.underscore.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1277
core/shared/vendor/underscore.js
vendored
1277
core/shared/vendor/underscore.js
vendored
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
/*globals describe, before, after, beforeEach, afterEach, it */
|
||||
var testUtils = require('../../utils'),
|
||||
should = require('should'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
request = require('request');
|
||||
|
||||
request = request.defaults({jar: true});
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*globals describe, before, beforeEach, afterEach, it */
|
||||
var testUtils = require('../../utils'),
|
||||
should = require('should'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
request = require('request');
|
||||
|
||||
request = request.defaults({jar:true})
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*globals describe, before, beforeEach, afterEach, it */
|
||||
var testUtils = require('../../utils'),
|
||||
should = require('should'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
request = require('request');
|
||||
|
||||
request = request.defaults({jar:true})
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*globals describe, before, beforeEach, afterEach, it */
|
||||
var testUtils = require('../../utils'),
|
||||
should = require('should'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
request = require('request');
|
||||
|
||||
request = request.defaults({jar:true})
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*globals describe, before, beforeEach, afterEach, it */
|
||||
var testUtils = require('../../utils'),
|
||||
should = require('should'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
when = require('when'),
|
||||
sequence = require('when/sequence'),
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*globals describe, before, beforeEach, afterEach, it*/
|
||||
var testUtils = require('../../utils'),
|
||||
should = require('should'),
|
||||
_ = require("underscore"),
|
||||
_ = require("lodash"),
|
||||
|
||||
// Stuff we are testing
|
||||
Models = require('../../../server/models'),
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*globals describe, before, beforeEach, afterEach, it */
|
||||
var testUtils = require('../../utils'),
|
||||
_ = require("underscore"),
|
||||
_ = require("lodash"),
|
||||
when = require('when'),
|
||||
sequence = require('when/sequence'),
|
||||
should = require('should'),
|
||||
|
@ -2,7 +2,7 @@
|
||||
var testUtils = require('../../utils'),
|
||||
should = require('should'),
|
||||
when = require('when'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
errors = require('../../../server/errorHandling'),
|
||||
sinon = require('sinon'),
|
||||
uuid = require('node-uuid'),
|
||||
|
@ -3,7 +3,7 @@ var fs = require('fs'),
|
||||
path = require('path'),
|
||||
should = require('should'),
|
||||
sinon = require('sinon'),
|
||||
_ = require("underscore"),
|
||||
_ = require('lodash'),
|
||||
helpers = require('../../server/helpers'),
|
||||
filters = require('../../server/filters'),
|
||||
|
||||
|
@ -5,7 +5,7 @@ var should = require('should'),
|
||||
when = require('when'),
|
||||
path = require('path'),
|
||||
fs = require('fs'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
rewire = require("rewire"),
|
||||
|
||||
testUtils = require('../utils'),
|
||||
|
@ -3,7 +3,7 @@ var testUtils = require('../utils'),
|
||||
should = require('should'),
|
||||
sinon = require('sinon'),
|
||||
when = require('when'),
|
||||
_ = require("underscore"),
|
||||
_ = require("lodash"),
|
||||
errors = require('../../server/errorHandling'),
|
||||
|
||||
// Stuff we are testing
|
||||
|
@ -4,7 +4,7 @@ var testUtils = require('../utils'),
|
||||
sinon = require('sinon'),
|
||||
when = require('when'),
|
||||
path = require('path'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
|
||||
// Stuff we are testing
|
||||
Filters = require('../../server/filters').Filters;
|
||||
|
@ -4,7 +4,7 @@ var testUtils = require('../utils'),
|
||||
sinon = require('sinon'),
|
||||
when = require('when'),
|
||||
assert = require('assert'),
|
||||
_ = require("underscore"),
|
||||
_ = require("lodash"),
|
||||
errors = require('../../server/errorHandling'),
|
||||
|
||||
// Stuff we are testing
|
||||
|
@ -4,7 +4,7 @@ var testUtils = require('../utils'),
|
||||
sinon = require('sinon'),
|
||||
when = require('when'),
|
||||
|
||||
_ = require("underscore"),
|
||||
_ = require("lodash"),
|
||||
cp = require('child_process'),
|
||||
|
||||
// Stuff we are testing
|
||||
|
@ -3,7 +3,7 @@ var assert = require('assert'),
|
||||
should = require('should'),
|
||||
sinon = require('sinon'),
|
||||
when = require('when'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
express = require('express'),
|
||||
api = require('../../server/api'),
|
||||
middleware = require('../../server/middleware').middleware;
|
||||
|
@ -3,7 +3,7 @@ var testUtils = require('../utils'),
|
||||
should = require('should'),
|
||||
sinon = require('sinon'),
|
||||
when = require('when'),
|
||||
_ = require("underscore"),
|
||||
_ = require("lodash"),
|
||||
errors = require('../../server/errorHandling'),
|
||||
|
||||
// Stuff we are testing
|
||||
|
@ -3,7 +3,7 @@ var testUtils = require('../utils'),
|
||||
should = require('should'),
|
||||
sinon = require('sinon'),
|
||||
when = require('when'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
path = require('path'),
|
||||
rewire = require('rewire'),
|
||||
api = require('../../server/api'),
|
||||
|
@ -3,7 +3,7 @@ var testUtils = require('../utils'),
|
||||
should = require('should'),
|
||||
sinon = require('sinon'),
|
||||
when = require('when'),
|
||||
_ = require('underscore'),
|
||||
_ = require('lodash'),
|
||||
path = require('path'),
|
||||
hbs = require('express-hbs'),
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
var _ = require('underscore'),
|
||||
var _ = require('lodash'),
|
||||
url = require('url'),
|
||||
ApiRouteBase = '/ghost/api/v0.1/',
|
||||
host = 'localhost',
|
||||
|
@ -1,4 +1,4 @@
|
||||
var _ = require('underscore'),
|
||||
var _ = require('lodash'),
|
||||
uuid = require('node-uuid'),
|
||||
DataGenerator = {};
|
||||
|
||||
|
@ -50,7 +50,7 @@
|
||||
"semver": "2.2.1",
|
||||
"showdown": "0.3.1",
|
||||
"sqlite3": "2.1.19",
|
||||
"underscore": "1.5.2",
|
||||
"lodash": "2.4.1",
|
||||
"unidecode": "0.1.3",
|
||||
"validator": "1.4.0",
|
||||
"when": "2.7.0"
|
||||
|
Loading…
Reference in New Issue
Block a user