Inital commit
This commit is contained in:
10
libs/jsonHand.lib.js
Normal file
10
libs/jsonHand.lib.js
Normal file
@ -0,0 +1,10 @@
|
||||
function IsJsonString(str) {
|
||||
try {
|
||||
JSON.parse(str);
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
module.exports = { IsJsonString }
|
26
libs/metaHandler.lib.js
Normal file
26
libs/metaHandler.lib.js
Normal file
@ -0,0 +1,26 @@
|
||||
function returnTags(module){
|
||||
const meta = module.getModuleMeta()
|
||||
if(meta.features != undefined){
|
||||
if(meta.features.includes("tags")){
|
||||
return(meta.tags)
|
||||
}
|
||||
}else if(meta.tags != undefined){
|
||||
return(meta.tags)
|
||||
}else{
|
||||
return([]) // Assume the module does not support tags
|
||||
}
|
||||
}
|
||||
|
||||
function returnCountries(module){
|
||||
const meta = module.getModuleMeta()
|
||||
if(meta.features != undefined){
|
||||
if(meta.features.includes("countries")){
|
||||
return(meta.country)
|
||||
}
|
||||
}if(meta.country != undefined){
|
||||
return(meta.country)
|
||||
}else{
|
||||
return(["*"]) // Assume the module does not support tags
|
||||
}
|
||||
}
|
||||
module.exports = { returnTags, returnCountries }
|
Reference in New Issue
Block a user