upadate
This commit is contained in:
1 parent
6909a25e1b
commit
7e30f7f278
20 files changed
+1250
-228
No files matched your search
@@ -1,41 +1,9 @@
|
||||
const config = require("../config")
|
||||
const DOCUMENTS = config.data.documents;
|
||||
|
||||
function getMenu(){
|
||||
return clone(config.data.menu);
|
||||
}
|
||||
|
||||
function getDoc(name, capitalFirstLetter){
|
||||
if(name && typeof name == "string"){
|
||||
for(var i=0; i<DOCUMENTS.length; i++){
|
||||
var doc = DOCUMENTS[i];
|
||||
if(doc.name == name){
|
||||
if(capitalFirstLetter) return makeCap(clone(doc));
|
||||
else return clone(doc);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}else if(name && name instanceof Array){
|
||||
var docs = [];
|
||||
name.forEach(function(i){
|
||||
var d = getDoc(i, capitalFirstLetter);
|
||||
if(d){
|
||||
docs.push(d);
|
||||
}
|
||||
});
|
||||
return docs;
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function makeCap(doc){
|
||||
var n = doc.name;
|
||||
// doc.name = n.substr(0, 1).toUpperCase() + n.substr(1);
|
||||
doc.name = n.charAt(0).toUpperCase() + n.substring(1);
|
||||
return doc;
|
||||
}
|
||||
|
||||
function clone(obj){
|
||||
if(obj == null || typeof(obj) != 'object')
|
||||
return obj;
|
||||
@@ -55,7 +23,6 @@ exports.menu = function(url){
|
||||
return m;
|
||||
}
|
||||
|
||||
exports.doc = getDoc;
|
||||
exports.team = function(processor) {
|
||||
var list = [];
|
||||
config.data.team.forEach(function(m){
|
||||
|
||||
Reference in new issue
Block a user