Skip to content
This repository was archived by the owner on Jan 14, 2020. It is now read-only.

Commit 1bcaf99

Browse files
committed
chore: rebuild dist
Rebuilds dist. -- tlvince/publish-dist
1 parent 5efcf94 commit 1bcaf99

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

dist/bundle.js

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33

44
angular$1 = 'default' in angular$1 ? angular$1['default'] : angular$1;
55

6+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
7+
return typeof obj;
8+
} : function (obj) {
9+
return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj;
10+
};
11+
612
var classCallCheck = function (instance, Constructor) {
713
if (!(instance instanceof Constructor)) {
814
throw new TypeError("Cannot call a class as a function");
@@ -71,29 +77,47 @@
7177
key: 'calculateThresholds',
7278
value: function calculateThresholds(location, stockCount, products) {
7379
var requiredStateStoresAllocation = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];
80+
var options = arguments.length <= 4 || arguments[4] === undefined ? {} : arguments[4];
81+
82+
if (!location || !location.allocations || !location.allocations.length || !location.plans || !location.plans.length || !location.level) {
83+
return;
84+
}
7485

75-
if (!location || !location.allocations || !location.plans || !location.level) {
86+
if (!stockCount) {
7687
return;
7788
}
7889

79-
if (!stockCount || !stockCount.allocations || !stockCount.allocations.version || !stockCount.plans || !stockCount.plans.version) {
90+
if (options.version !== 'last' && !(stockCount.allocations && _typeof(stockCount.allocations.version) !== undefined && stockCount.plans && _typeof(stockCount.plans.version) !== undefined)) {
8091
return;
8192
}
8293

8394
if (!products || !products.length) {
8495
return;
8596
}
8697

87-
var allocation = find(location.allocations, isVersion.bind(null, stockCount.allocations.version));
98+
var allocation = void 0;
99+
if (options.version === 'last') {
100+
allocation = location.allocations[location.allocations.length - 1];
101+
} else {
102+
allocation = find(location.allocations, isVersion.bind(null, stockCount.allocations.version));
103+
}
104+
88105
if (!(allocation && allocation.weeklyLevels)) {
89106
return;
90107
}
91108

92109
var weeklyLevels = allocation.weeklyLevels;
110+
93111
var weeksOfStock = zonesPlan;
94112

95113
if (location.level !== 'zone') {
96-
var plan = find(location.plans, isVersion.bind(null, stockCount.plans.version));
114+
var plan = void 0;
115+
if (options.version === 'last') {
116+
plan = location.plans[location.plans.length - 1];
117+
} else {
118+
plan = find(location.plans, isVersion.bind(null, stockCount.plans.version));
119+
}
120+
97121
if (!(plan && plan.weeksOfStock)) {
98122
return;
99123
}

dist/bundle.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)