@freedom_sky/feige-lib 4.58.4 → 4.58.5

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.
@@ -8,7 +8,7 @@ export interface PrinteDishInfo {
8
8
  /**
9
9
  *
10
10
  */
11
- export declare function getDishArrFromContents({ contents, lang, order, showBuffet, text, }: {
11
+ export declare function getDishArrFromContents({ contents, lang, order, showBuffet, text, addSpecificationsAfterName, }: {
12
12
  contents: Content[];
13
13
  lang: string;
14
14
  order: Order;
@@ -17,4 +17,5 @@ export declare function getDishArrFromContents({ contents, lang, order, showBuff
17
17
  adult: string;
18
18
  child: string;
19
19
  };
20
+ addSpecificationsAfterName?: boolean;
20
21
  }): PrinteDishInfo[];
@@ -5,7 +5,7 @@ var index_1 = require("../index");
5
5
  *
6
6
  */
7
7
  function getDishArrFromContents(_a) {
8
- var contents = _a.contents, lang = _a.lang, order = _a.order, showBuffet = _a.showBuffet, text = _a.text;
8
+ var contents = _a.contents, lang = _a.lang, order = _a.order, showBuffet = _a.showBuffet, text = _a.text, addSpecificationsAfterName = _a.addSpecificationsAfterName;
9
9
  var result = contents.map(function (dishGroup) {
10
10
  var _a;
11
11
  var selectedNames = [];
@@ -47,6 +47,11 @@ function getDishArrFromContents(_a) {
47
47
  specifications: specifications,
48
48
  });
49
49
  }
50
+ if (addSpecificationsAfterName) {
51
+ result.forEach(function (item) {
52
+ item.name += item.specifications.length > 0 ? "(" + item.specifications.join() + ")" : '';
53
+ });
54
+ }
50
55
  return result;
51
56
  }
52
57
  exports.getDishArrFromContents = getDishArrFromContents;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freedom_sky/feige-lib",
3
- "version": "4.58.4",
3
+ "version": "4.58.5",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -25,6 +25,7 @@ export function getDishArrFromContents({
25
25
  order,
26
26
  showBuffet,
27
27
  text,
28
+ addSpecificationsAfterName,
28
29
  }: {
29
30
  contents: Content[];
30
31
  lang: string;
@@ -34,6 +35,7 @@ export function getDishArrFromContents({
34
35
  adult: string;
35
36
  child: string;
36
37
  };
38
+ addSpecificationsAfterName?: boolean;
37
39
  }): PrinteDishInfo[] {
38
40
  const result = contents.map((dishGroup) => {
39
41
  const selectedNames = [];
@@ -78,5 +80,10 @@ export function getDishArrFromContents({
78
80
  specifications: specifications,
79
81
  });
80
82
  }
83
+ if (addSpecificationsAfterName) {
84
+ result.forEach((item) => {
85
+ item.name += item.specifications.length > 0 ? `(${item.specifications.join()})` : '';
86
+ });
87
+ }
81
88
  return result;
82
89
  }