Skip to content

Commit

Permalink
Sync dependency viewer with restricted flavor (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBuchholz committed Apr 23, 2018
1 parent 779d6ea commit edd8479
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions res/sources/dependencyWheel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
gpf.require.define({
dom: "../dom.js",
sources: "../../src/sources.json",
flavor: "flavor.js",
dependencies: "../../build/dependencies.json"

Expand All @@ -10,13 +11,14 @@ gpf.require.define({

var dom = require.dom,
flavor = require.flavor,
sourceIsAllowed = require.sources.reduce(function (map, source, index) {
map[source.name] = !flavor || flavor[index];
return map;
}, {}),
dependencies = require.dependencies,
dependencyNames = Object.keys(dependencies)
.filter(function (dependency, index) {
if (flavor && !flavor[index]) {
return false;
}
return true;
.filter(function (dependency) {
return sourceIsAllowed[dependency];
})
.sort(),
placeholder = dom.div({
Expand Down

0 comments on commit edd8479

Please sign in to comment.