Upgrades people!
This commit is contained in:
parent
f84234150f
commit
8ad56e8d38
40 changed files with 483 additions and 379 deletions
|
@ -7,25 +7,25 @@ const nest = (arr) => {
|
|||
};
|
||||
|
||||
export const asTree = (branches) => {
|
||||
const nests = branches.map((b)=>nest(b));
|
||||
return _.merge(...nests);
|
||||
};
|
||||
const nests = branches.map((b) => nest(b));
|
||||
return _.merge(...nests);
|
||||
};
|
||||
|
||||
export const asBranches = (array) => {
|
||||
const merged = [];
|
||||
array.forEach((p, i) => {
|
||||
p.forEach((v, i) => {
|
||||
if (!merged[i]) merged[i] = [];
|
||||
if (!merged[i].includes(v)) merged[i].push(v);
|
||||
});
|
||||
const merged = [];
|
||||
array.forEach((p, i) => {
|
||||
p.forEach((v, i) => {
|
||||
if (!merged[i]) merged[i] = [];
|
||||
if (!merged[i].includes(v)) merged[i].push(v);
|
||||
});
|
||||
return merged;
|
||||
}
|
||||
});
|
||||
return merged;
|
||||
};
|
||||
|
||||
export const as1d = (a) => [].concat.apply([], a);
|
||||
|
||||
export const selectBranch = (map,test) => {
|
||||
const pipeline = map.find((pm)=>pm.includes(test));
|
||||
const testIndex = pipeline.findIndex((t) => t === test);
|
||||
return pipeline.slice(0, testIndex + 1);
|
||||
}
|
||||
export const selectBranch = (map, test) => {
|
||||
const pipeline = map.find((pm) => pm.includes(test));
|
||||
const testIndex = pipeline.findIndex((t) => t === test);
|
||||
return pipeline.slice(0, testIndex + 1);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue