Chore: move fromNamespace call to configManager
This commit is contained in:
parent
61fec80899
commit
4ce1b949d0
3 changed files with 4 additions and 11 deletions
|
|
@ -180,12 +180,6 @@ function getAlertTypes (alertRec, config) {
|
|||
return alerts
|
||||
}
|
||||
|
||||
const stripl = _.curry((q, str) => _.startsWith(q, str) ? str.slice(q.length) : str)
|
||||
const filter = namespace => _.pickBy((value, key) => _.startsWith(`${namespace}_`)(key))
|
||||
const strip = key => _.mapKeys(stripl(`${key}_`))
|
||||
|
||||
const fromNamespace = _.curry((key, config) => _.compose(strip(key), filter(key))(config))
|
||||
|
||||
module.exports = {
|
||||
codeDisplay,
|
||||
parseEventNote,
|
||||
|
|
@ -202,6 +196,5 @@ module.exports = {
|
|||
formatCurrency,
|
||||
formatAge,
|
||||
buildDetail,
|
||||
deviceAlerts,
|
||||
fromNamespace
|
||||
deviceAlerts
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue