utiller 1.0.301 → 1.0.303
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/utiller/index.js
CHANGED
|
@@ -159,11 +159,7 @@ var Utiller = /*#__PURE__*/function () {
|
|
|
159
159
|
(0, _defineProperty2["default"])(this, "findLowestValue", function (items) {
|
|
160
160
|
var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "price";
|
|
161
161
|
// 提取價格並找出最小值
|
|
162
|
-
items = _lodash["default"].filter(function (each) {
|
|
163
|
-
return each && each.price > 0;
|
|
164
|
-
});
|
|
165
162
|
var minPrice = _lodash["default"].minBy(items, key)[key];
|
|
166
|
-
|
|
167
163
|
// 確保回傳的最低價為 integer 型態
|
|
168
164
|
return Math.floor(minPrice);
|
|
169
165
|
});
|
|
@@ -189,7 +185,6 @@ var Utiller = /*#__PURE__*/function () {
|
|
|
189
185
|
// 找出最小值和最大值
|
|
190
186
|
var minV = _lodash["default"].minBy(items, key)[key];
|
|
191
187
|
var maxV = _lodash["default"].maxBy(items, key)[key];
|
|
192
|
-
|
|
193
188
|
// 判斷並返回字串
|
|
194
189
|
return maxV === minV ? "$".concat(minV) : "".concat(sign).concat(minV, " - ").concat(sign).concat(maxV);
|
|
195
190
|
});
|
package/package.json
CHANGED