-
Notifications
You must be signed in to change notification settings - Fork 0
/
globals.js
32 lines (26 loc) · 970 Bytes
/
globals.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const packageJson = require('./package.json');
const hgDependencies = (() => {
if (packageJson.hgDependencies) {
return packageJson.hgDependencies;
}
if (packageJson.devDependencies) {
return Object.keys(packageJson.devDependencies)
.filter(dependency => dependency.indexOf('higlass') === 0)
.reduce((dependencies, dependency) => {
dependencies[dependency] = packageJson.devDependencies[dependency];
return dependencies;
}, {});
}
if (packageJson.dependencies) {
return Object.keys(packageJson.dependencies)
.filter(dependency => dependency.indexOf('higlass') === 0)
.reduce((dependencies, dependency) => {
dependencies[dependency] = packageJson.dependencies[dependency];
return dependencies;
}, {});
}
return {};
})();
const VERSION = JSON.stringify(packageJson.version);
const DEPENDENCIES = JSON.stringify(hgDependencies);
module.exports = { VERSION, DEPENDENCIES };