@freedom_sky/feige-lib 4.51.5 → 4.51.6

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.
@@ -25,7 +25,7 @@ function dishShowPriceWithBuffet(_a) {
25
25
  exports.dishShowPriceWithBuffet = dishShowPriceWithBuffet;
26
26
  function getDishItemInBuffet(_a) {
27
27
  var dishId = _a.dishId, buffet = _a.buffet;
28
- return buffet === null || buffet === void 0 ? void 0 : buffet.dishes.find(function (item) { return item.dishId === dishId; });
28
+ return buffet === null || buffet === void 0 ? void 0 : buffet.dishes.find(function (item) { return String(item.dishId) === String(dishId); });
29
29
  }
30
30
  exports.getDishItemInBuffet = getDishItemInBuffet;
31
31
  function getMaxBuffetDishUpperLimit(_a) {
package/dist/index.js CHANGED
@@ -134,9 +134,9 @@ function calcContentPrice(_a) {
134
134
  exports.calcContentPrice = calcContentPrice;
135
135
  function getOrderedCountByDishId(dishId, contents, beforeKey) {
136
136
  var count = 0;
137
- for (var _i = 0, _a = contents.filter(function (content) { return content.dishSnapshot._id === dishId; }); _i < _a.length; _i++) {
137
+ for (var _i = 0, _a = contents.filter(function (content) { return String(content.dishSnapshot._id) === String(dishId); }); _i < _a.length; _i++) {
138
138
  var content = _a[_i];
139
- if (beforeKey && content._id === beforeKey)
139
+ if (beforeKey && String(content._id) === String(beforeKey))
140
140
  break;
141
141
  count += content.count;
142
142
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freedom_sky/feige-lib",
3
- "version": "4.51.5",
3
+ "version": "4.51.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -20,7 +20,7 @@ export function dishShowPriceWithBuffet({dishPrice, dishId, buffet, orderedCound
20
20
  }
21
21
 
22
22
  export function getDishItemInBuffet({dishId, buffet}:{dishId:string, buffet?: BuffetCombosItems}):BuffetDishItem|undefined {
23
- return buffet?.dishes.find((item)=>item.dishId===dishId)
23
+ return buffet?.dishes.find((item)=>String(item.dishId)===String(dishId))
24
24
  }
25
25
 
26
26
  export function getMaxBuffetDishUpperLimit({buffetDishItem, adultNum, childNum}:{buffetDishItem:BuffetDishItem, adultNum: number, childNum: number}):number {
package/src/index.ts CHANGED
@@ -147,8 +147,8 @@ export function calcContentPrice({orderContentItem,buffetItem, orderType, adultN
147
147
 
148
148
  export function getOrderedCountByDishId(dishId, contents:Content[], beforeKey?:string): number{
149
149
  let count = 0;
150
- for(let content of contents.filter(content=>content.dishSnapshot._id===dishId)) {
151
- if(beforeKey && content._id === beforeKey) break;
150
+ for(let content of contents.filter(content=>String(content.dishSnapshot._id)===String(dishId))) {
151
+ if(beforeKey && String(content._id) === String(beforeKey)) break;
152
152
  count += content.count
153
153
  }
154
154
  return count