-
Notifications
You must be signed in to change notification settings - Fork 0
/
fxrc.symlink
51 lines (48 loc) · 1.35 KB
/
fxrc.symlink
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Object.assign(global, require('lodash/fp'));
global.strategyBuilders = function(json) {
if(! json instanceof Object) {
return [];
}
var knownBuilders = [
"TargetPositionBuilder",
"VendorsOnPosition",
"OwnPosition",
"CompetitorsOnPosition",
"AdjustToReferencePrice",
"PullUp",
"Serial",
"TagBasedTargetPosition",
"TagBasedPriceGap",
"TargetPosition",
"DeliveryCost",
"OwnOfferBasedTargetPosition",
"SoleVendor",
"TimeFrame",
"TagBasedAdjustToNextPricier",
"TagBasedFilter",
"TagBasedIncludeDeliveryCost",
"KeepPrice",
"DiscountBoundaryFilter",
"PriceFilter",
"ContextModifier",
"Formula",
"OwnOfferFilter",
"OfferFilter",
"ContextModifiers",
"FormulaComparison",
"PriceStep"
];
return uniq(flattenDeep(map(function(key) {
if(knownBuilders.includes(key)) {
var result = strategyBuilders(json[key]);
result.push(key);
return result;
} else if(key == "builder") {
return strategyBuilders(json[key]);
} else if(key == "builders") {
return map(strategyBuilders, json[key]);
} else {
return [];
}
}, Object.keys(json))));
};