Inital commit

This commit is contained in:
2022-03-06 18:36:36 +01:00
commit bedd69436b
175 changed files with 9965 additions and 0 deletions

10
libs/jsonHand.lib.js Normal file
View 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
View 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 }