Skip to content

Commit 06735e9

Browse files
authored
Merge pull request #54 from openimis/ensure-array-contributinos
Contributions: use ensureArray to build contributions
2 parents 81bbd9d + 054c0ca commit 06735e9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ModulesManager.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { loadModules, packages } from "./modules";
22
import { memoize } from "lodash";
33
import pkg from "../package.json";
4+
import { ensureArray } from "@openimis/fe-core";
45

56
class ModulesManager {
67
constructor(cfg) {
@@ -71,7 +72,7 @@ class ModulesManager {
7172
}
7273

7374
getContribs = memoize((key) => {
74-
return this.modules.reduce((contributions, module) => [...contributions, ...(module[key] ?? [])], []);
75+
return this.modules.reduce((contributions, module) => [...contributions, ...ensureArray(module[key])], []);
7576
});
7677

7778
getConf(module, key, defaultValue = null) {

0 commit comments

Comments
 (0)