智能照明系统APP-本地串口
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
LightingSystemApp-serial/.svn/pristine/c8/c81ae2f3434a7357a98f992a441...

23 lines
645 B

function parseApis (modules, test) {
return modules.reduce(function (apis, module) {
const apiList = module.apiList
apiList && Object.keys(apiList).forEach(name => {
if (test(name, apiList[name])) {
apis.add(name.replace('uni.', ''))
}
})
return apis
}, new Set())
}
module.exports = {
parseUserApis (configModules = [], allModules = []) {
const blackboxApis = parseApis(configModules, function (name, value) {
return value === false
})
const allApis = parseApis(allModules, function () {
return true
})
return [...allApis].filter(name => !blackboxApis.has(name))
}
}