forked from skygragon/leetcode-cli
-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathconfig.js
33 lines (26 loc) · 1.12 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var _ = require('underscore');
var h = require('./helper');
var DEFAULT_CONFIG = {
// usually you don't wanna change those
URL_BASE: 'https://leetcode.com',
URL_LOGIN: 'https://leetcode.com/accounts/login/',
URL_PROBLEMS: 'https://leetcode.com/api/problems/algorithms/',
URL_PROBLEM: 'https://leetcode.com/problems/$id',
URL_TEST: 'https://leetcode.com/problems/$key/interpret_solution/',
URL_SUBMIT: 'https://leetcode.com/problems/$key/submit/',
URL_SUBMISSIONS: 'https://leetcode.com/problems/$key/submissions/',
URL_SUBMISSION: 'https://leetcode.com/submissions/detail/$id/',
URL_VERIFY: 'https://leetcode.com/submissions/detail/$id/check/',
// but you will want change these
LANG: 'cpp', // avail: [c,cpp,csharp,golang,java,javascript,python,ruby,swift]
USE_COLOR: true,
AUTO_LOGIN: false
};
function Config() {}
Config.prototype.init = function() {
_.extendOwn(this, DEFAULT_CONFIG);
// check local config: ~/.lcconfig
var localConfig = JSON.parse(h.getFileData(h.getConfigFile())) || {};
_.extendOwn(this, localConfig);
};
module.exports = new Config();