@ancon/wildcat-utils 1.50.6 → 1.50.7
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("@ancon/wildcat-types"),i=require("./getSettingsForOrderFormat.js");var o=(e=>(e[e.Preset1=1]="Preset1",e[e.Preset2=2]="Preset2",e[e.Preset3=3]="Preset3",e))(o||{});function a(e){if(e){const t=[];return e.percentage1Enabled&&t.push({value:e.percentage1Value,preset:1}),e.percentage2Enabled&&t.push({value:e.percentage2Value,preset:2}),e.percentage3Enabled&&t.push({value:e.percentage3Value,preset:3}),t}return[]}function d(e,t){const{orderFormatSettings:s}=e,r=i(t,s);if(r!=null&&(n.OrderFormatOption.AOTipEnabled&r.options)===n.OrderFormatOption.AOTipEnabled){const u=(n.OrderFormatOption.AOCustomTipsEnabled&r.options)===n.OrderFormatOption.AOCustomTipsEnabled,l=a(r.aoTippingPercentages);return{aoAllowCustomTipping:u,tipPercentages:l}}return null}exports.TipPercentagePreset=o;exports.default=d;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OrderFormatOption as
|
|
2
|
-
import
|
|
1
|
+
import { OrderFormatOption as n } from "@ancon/wildcat-types";
|
|
2
|
+
import u from "./getSettingsForOrderFormat.mjs";
|
|
3
3
|
var a = /* @__PURE__ */ ((t) => (t[t.Preset1 = 1] = "Preset1", t[t.Preset2 = 2] = "Preset2", t[t.Preset3 = 3] = "Preset3", t))(a || {});
|
|
4
4
|
function i(t) {
|
|
5
5
|
if (t) {
|
|
@@ -21,12 +21,12 @@ function i(t) {
|
|
|
21
21
|
return [];
|
|
22
22
|
}
|
|
23
23
|
function f(t, e) {
|
|
24
|
-
const { orderFormatSettings: o } = t,
|
|
25
|
-
if ((
|
|
26
|
-
const s = (
|
|
24
|
+
const { orderFormatSettings: o } = t, r = u(e, o);
|
|
25
|
+
if (r != null && (n.AOTipEnabled & r.options) === n.AOTipEnabled) {
|
|
26
|
+
const s = (n.AOCustomTipsEnabled & r.options) === n.AOCustomTipsEnabled, l = i(r.aoTippingPercentages);
|
|
27
27
|
return {
|
|
28
28
|
aoAllowCustomTipping: s,
|
|
29
|
-
tipPercentages:
|
|
29
|
+
tipPercentages: l
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
return null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { OrderFormatSetting, OrderFormat } from '@ancon/wildcat-types';
|
|
2
|
-
export default function getSettingsForOrderFormat(orderFormat: OrderFormat, orderFormatSettings?: OrderFormatSetting[]): OrderFormatSetting;
|
|
2
|
+
export default function getSettingsForOrderFormat(orderFormat: OrderFormat, orderFormatSettings?: OrderFormatSetting[]): OrderFormatSetting | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function o(r,t=[]){return t.
|
|
1
|
+
"use strict";function o(r,t=[]){return t.find(e=>e.orderFormat===r)}module.exports=o;
|