@ancon/wildcat-utils 1.18.4 → 1.18.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.
- package/checkout/getCheckoutItemModifications.d.ts +12 -0
- package/checkout/getCheckoutItemModifications.js +1 -0
- package/checkout/getCheckoutItemModifications.mjs +50 -0
- package/checkout/getCheckoutProductName.d.ts +7 -0
- package/checkout/getCheckoutProductName.js +1 -0
- package/checkout/getCheckoutProductName.mjs +7 -0
- package/checkout/index.d.ts +3 -0
- package/checkout/index.js +1 -0
- package/checkout/index.mjs +9 -0
- package/currency/getFormattedCurrency.d.ts +9 -0
- package/currency/getFormattedCurrency.js +1 -0
- package/currency/getFormattedCurrency.mjs +10 -0
- package/currency/getFormattedCurrencyPostfix.d.ts +6 -0
- package/currency/getFormattedCurrencyPostfix.js +1 -0
- package/currency/getFormattedCurrencyPostfix.mjs +12 -0
- package/currency/index.d.ts +2 -0
- package/currency/index.js +1 -0
- package/currency/index.mjs +5 -0
- package/index.d.ts +3 -0
- package/index.js +1 -1
- package/index.mjs +84 -71
- package/inventory/index.d.ts +4 -0
- package/inventory/index.js +1 -0
- package/inventory/index.mjs +8 -0
- package/inventory/isDetailedProductOutOfStock.d.ts +2 -0
- package/inventory/isDetailedProductOutOfStock.js +1 -0
- package/inventory/isDetailedProductOutOfStock.mjs +10 -0
- package/inventory/isDetailedProductVariantOutOfStocks.d.ts +2 -0
- package/inventory/isDetailedProductVariantOutOfStocks.js +1 -0
- package/inventory/isDetailedProductVariantOutOfStocks.mjs +9 -0
- package/inventory/isMenuTreeProductOutOfStock.d.ts +2 -0
- package/inventory/isMenuTreeProductOutOfStock.js +1 -0
- package/inventory/isMenuTreeProductOutOfStock.mjs +9 -0
- package/package.json +51 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CheckoutItemModification } from '@ancon/wildcat-types';
|
|
2
|
+
export declare type GroupedModification = {
|
|
3
|
+
added: string[];
|
|
4
|
+
removed: string[];
|
|
5
|
+
replaced: string[];
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Get grouped modifications of checkout item from checkout details
|
|
9
|
+
* @param modifications - Checkout modification array
|
|
10
|
+
* @returns - Grouped modifications
|
|
11
|
+
*/
|
|
12
|
+
export default function getCheckoutGroupedModifications(modifications: CheckoutItemModification[]): GroupedModification;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("@ancon/wildcat-types"),u=require("../currency/getFormattedCurrency.js");require("../currency/getFormattedCurrencyPostfix.js");function y(e,t){return t?e-t>0?e-t:t:e}function M(e){return e.reduce((i,s)=>{const{modification:p,name:o,freeAmount:f,quantity:c,cost:n,replacementName:m,totalCost:d}=s;switch(p){case a.ModificationType.Remove:i.removed.push(o);break;case a.ModificationType.Replace:{const r=`${o} → ${m} (${u(d.amount,d.currency)})`;i.replaced.push(r);break}default:{const r=y(c,f),l=`${c}x ${o} (${r}x ${u(n.amount,n.currency)})`;i.added.push(l)}}return i},{added:[],removed:[],replaced:[]})}module.exports=M;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ModificationType as c } from "@ancon/wildcat-types";
|
|
2
|
+
import u from "../currency/getFormattedCurrency.mjs";
|
|
3
|
+
import "../currency/getFormattedCurrencyPostfix.mjs";
|
|
4
|
+
function M(e, t) {
|
|
5
|
+
return t ? e - t > 0 ? e - t : t : e;
|
|
6
|
+
}
|
|
7
|
+
function x(e) {
|
|
8
|
+
return e.reduce(
|
|
9
|
+
(o, s) => {
|
|
10
|
+
const {
|
|
11
|
+
modification: p,
|
|
12
|
+
name: i,
|
|
13
|
+
freeAmount: m,
|
|
14
|
+
quantity: n,
|
|
15
|
+
cost: a,
|
|
16
|
+
replacementName: f,
|
|
17
|
+
totalCost: d
|
|
18
|
+
} = s;
|
|
19
|
+
switch (p) {
|
|
20
|
+
case c.Remove:
|
|
21
|
+
o.removed.push(i);
|
|
22
|
+
break;
|
|
23
|
+
case c.Replace: {
|
|
24
|
+
const r = `${i} → ${f} (${u(
|
|
25
|
+
d.amount,
|
|
26
|
+
d.currency
|
|
27
|
+
)})`;
|
|
28
|
+
o.replaced.push(r);
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
default: {
|
|
32
|
+
const r = M(n, m), l = `${n}x ${i} (${r}x ${u(
|
|
33
|
+
a.amount,
|
|
34
|
+
a.currency
|
|
35
|
+
)})`;
|
|
36
|
+
o.added.push(l);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return o;
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
added: [],
|
|
43
|
+
removed: [],
|
|
44
|
+
replaced: []
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
x as default
|
|
50
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function r(t){const{hasVariants:a,name:e,variantName:n}=t;return a?n:e}module.exports=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getCheckoutItemModifications.js"),t=require("./getCheckoutProductName.js");require("@ancon/wildcat-types");require("../currency/getFormattedCurrency.js");require("../currency/getFormattedCurrencyPostfix.js");exports.getCheckoutGroupedModifications=e;exports.getCheckoutProductName=t;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as i } from "./getCheckoutItemModifications.mjs";
|
|
2
|
+
import { default as p } from "./getCheckoutProductName.mjs";
|
|
3
|
+
import "@ancon/wildcat-types";
|
|
4
|
+
import "../currency/getFormattedCurrency.mjs";
|
|
5
|
+
import "../currency/getFormattedCurrencyPostfix.mjs";
|
|
6
|
+
export {
|
|
7
|
+
i as getCheckoutGroupedModifications,
|
|
8
|
+
p as getCheckoutProductName
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats the given monetary value
|
|
3
|
+
* @param {number} value - The numeric value
|
|
4
|
+
* @param {string} currency - The currency string
|
|
5
|
+
* @param {boolean} [formatPostfix] - Whether or not to format the currency postfix (ie SEK -> kr)
|
|
6
|
+
* @return {string} - Formatted monetary value
|
|
7
|
+
*/
|
|
8
|
+
declare function getFormattedCurrency(value?: number | null, currency?: string | null, formatPostfix?: boolean): string;
|
|
9
|
+
export default getFormattedCurrency;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("./getFormattedCurrencyPostfix.js");function u(e=0,t="SEK",i=!0){let r=0;!e||Number.isNaN(Number(e))?r=0:Number.isInteger(Number(e))?r=e:r=Number(e).toFixed(2);const s=i?o.getFormattedCurrencyPostfix(t):t;return`${r} ${s}`}module.exports=u;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { getFormattedCurrencyPostfix as m } from "./getFormattedCurrencyPostfix.mjs";
|
|
2
|
+
function s(e = 0, t = "SEK", i = !0) {
|
|
3
|
+
let r = 0;
|
|
4
|
+
!e || Number.isNaN(Number(e)) ? r = 0 : Number.isInteger(Number(e)) ? r = e : r = Number(e).toFixed(2);
|
|
5
|
+
const o = i ? m(t) : t;
|
|
6
|
+
return `${r} ${o}`;
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
s as default
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function e(t){switch(t){case"SEK":case"NOK":return"kr";default:return"kr"}}exports.getFormattedCurrencyPostfix=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getFormattedCurrency.js");require("./getFormattedCurrencyPostfix.js");exports.getFormattedCurrency=e;
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./shared/enums.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./shared/enums.js"),t=require("./shared/isWithinFlag.js"),r=require("./shared/generateId.js"),i=require("./outlet/getListOutletOpeningHoursTable.js"),n=require("./outlet/getOutletTagInformation.js"),o=require("./outlet/getOutletAvailabilityInfo.js"),u=require("./outlet/getOutletOfflineOrderFormats.js"),s=require("./outlet/getOutletAvailableOrderFormats.js"),a=require("./outlet/getOutletFormattedDistance.js"),l=require("./outlet/isOutletAcceptingPreOrders.js"),c=require("./outlet/getOutletDeliveryFee.js"),g=require("./outlet/getOutletTodayOpeningTimes.js"),d=require("./outlet/getOutletOrderFormats.js"),q=require("./outlet/serviceDateTimesFromOpeningHours.js"),O=require("./versioning/isVersionALessThanB.js"),_=require("./versioning/cleanVersionString.js"),m=require("./api/getUrlAndParams.js"),f=require("./api/getEndpointWithVersion.js"),p=require("./api/generateBackoffWithEqualJitter.js"),y=require("./string/slugify.js"),P=require("./string/truncate.js"),k=require("./color/lighten.js"),F=require("./color/brighten.js"),T=require("./color/darken.js"),v=require("./color/isDarkBackground.js"),h=require("./user/getFullName.js"),S=require("./user/getFullAddressString.js"),D=require("./logger/Logger.js"),I=require("./logger/types.js"),b=require("./logger/sanitizeAsStringDict.js"),A=require("./printing/getPrinterType.js"),V=require("./printing/isValidPrinter.js"),L=require("./printing/isValidNetworkPrinter.js"),C=require("./printing/isValidStarCloudPrinter.js"),W=require("./printing/isTerminalPrinter.js"),B=require("./number/randomIntFromInterval.js"),N=require("./tables/decodeTableQRPayload.js"),M=require("./checkout/getCheckoutItemModifications.js"),E=require("./checkout/getCheckoutProductName.js"),H=require("./currency/getFormattedCurrency.js"),w=require("./inventory/isDetailedProductOutOfStock.js"),z=require("./inventory/isDetailedProductVariantOutOfStocks.js"),J=require("./inventory/isMenuTreeProductOutOfStock.js");require("moment");require("@ancon/wildcat-types");require("./outlet/types.js");require("./outlet/constants.js");require("./outlet/getOutletCurrentActiveOperatingHour.js");require("./outlet/getMomentFromDateAndTimeString.js");require("./outlet/searchNextOpeningMoment.js");require("lodash");require("compare-versions");require("tinycolor2");require("@ancon/wildcat-printing");require("./currency/getFormattedCurrencyPostfix.js");exports.DayOfWeek=e.DayOfWeek;exports.IntervalState=e.IntervalState;exports.IntervalType=e.IntervalType;exports.OrderFormat=e.OrderFormat;exports.isWithinFlag=t;exports.generateId=r;exports.getListOutletOpeningHoursTable=i;exports.getOutletTagInformation=n.default;exports.getOutletAvailabilityInfo=o.default;exports.getOutletOfflineOrderFormats=u;exports.getOutletAvailableOrderFormats=s;exports.getOutletFormattedDistance=a;exports.isOutletAcceptingPreOrders=l;exports.getOutletDeliveryFee=c;exports.getOutletTodayOpeningTimes=g;exports.getOutletOrderFormats=d;exports.serviceDateTimesFromOpeningHours=q;exports.isVersionALessThanB=O;exports.cleanVersionString=_;exports.getUrlAndParams=m;exports.getEndpointWithVersion=f;exports.generateBackoffWithEqualJitter=p;exports.slugify=y;exports.truncate=P;exports.lighten=k;exports.brighten=F;exports.darken=T;exports.isDarkBackground=v;exports.getFullName=h;exports.getFullAddressString=S;exports.Logger=D;exports.LogLevel=I.LogLevel;exports.sanitizeAsStringDict=b;exports.getPrinterType=A;exports.isValidPrinter=V;exports.isValidNetworkPrinter=L;exports.isValidStarCloudPrinter=C;exports.isTerminalPrinter=W;exports.randomIntFromInterval=B;exports.decodeTableQRPayload=N;exports.getCheckoutGroupedModifications=M;exports.getCheckoutProductName=E;exports.getFormattedCurrency=H;exports.isDetailedProductOutOfStock=w;exports.isDetailedProductVariantOutOfStocks=z;exports.isMenuTreeProductOutOfStock=J;
|
package/index.mjs
CHANGED
|
@@ -1,40 +1,46 @@
|
|
|
1
|
-
import { DayOfWeek as
|
|
2
|
-
import { default as
|
|
3
|
-
import { default as
|
|
4
|
-
import { default as
|
|
5
|
-
import { default as
|
|
6
|
-
import { default as
|
|
1
|
+
import { DayOfWeek as x, IntervalState as g, IntervalType as O, OrderFormat as c } from "./shared/enums.mjs";
|
|
2
|
+
import { default as P } from "./shared/isWithinFlag.mjs";
|
|
3
|
+
import { default as T } from "./shared/generateId.mjs";
|
|
4
|
+
import { default as h } from "./outlet/getListOutletOpeningHoursTable.mjs";
|
|
5
|
+
import { default as D } from "./outlet/getOutletTagInformation.mjs";
|
|
6
|
+
import { default as A } from "./outlet/getOutletAvailabilityInfo.mjs";
|
|
7
7
|
import { default as V } from "./outlet/getOutletOfflineOrderFormats.mjs";
|
|
8
8
|
import { default as L } from "./outlet/getOutletAvailableOrderFormats.mjs";
|
|
9
9
|
import { default as W } from "./outlet/getOutletFormattedDistance.mjs";
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
15
|
-
import { default as
|
|
16
|
-
import { default as
|
|
17
|
-
import { default as
|
|
18
|
-
import { default as
|
|
19
|
-
import { default as
|
|
20
|
-
import { default as
|
|
21
|
-
import { default as
|
|
22
|
-
import { default as
|
|
23
|
-
import { default as
|
|
24
|
-
import { default as
|
|
25
|
-
import { default as
|
|
26
|
-
import { default as
|
|
27
|
-
import { default as
|
|
28
|
-
import { default as
|
|
29
|
-
import { LogLevel as
|
|
30
|
-
import { default as
|
|
31
|
-
import { default as
|
|
32
|
-
import { default as
|
|
33
|
-
import { default as
|
|
34
|
-
import { default as
|
|
35
|
-
import { default as
|
|
36
|
-
import { default as
|
|
37
|
-
import { default as
|
|
10
|
+
import { default as N } from "./outlet/isOutletAcceptingPreOrders.mjs";
|
|
11
|
+
import { default as H } from "./outlet/getOutletDeliveryFee.mjs";
|
|
12
|
+
import { default as q } from "./outlet/getOutletTodayOpeningTimes.mjs";
|
|
13
|
+
import { default as z } from "./outlet/getOutletOrderFormats.mjs";
|
|
14
|
+
import { default as J } from "./outlet/serviceDateTimesFromOpeningHours.mjs";
|
|
15
|
+
import { default as R } from "./versioning/isVersionALessThanB.mjs";
|
|
16
|
+
import { default as j } from "./versioning/cleanVersionString.mjs";
|
|
17
|
+
import { default as X } from "./api/getUrlAndParams.mjs";
|
|
18
|
+
import { default as Z } from "./api/getEndpointWithVersion.mjs";
|
|
19
|
+
import { default as $ } from "./api/generateBackoffWithEqualJitter.mjs";
|
|
20
|
+
import { default as et } from "./string/slugify.mjs";
|
|
21
|
+
import { default as ot } from "./string/truncate.mjs";
|
|
22
|
+
import { default as ft } from "./color/lighten.mjs";
|
|
23
|
+
import { default as st } from "./color/brighten.mjs";
|
|
24
|
+
import { default as it } from "./color/darken.mjs";
|
|
25
|
+
import { default as mt } from "./color/isDarkBackground.mjs";
|
|
26
|
+
import { default as nt } from "./user/getFullName.mjs";
|
|
27
|
+
import { default as gt } from "./user/getFullAddressString.mjs";
|
|
28
|
+
import { default as ct } from "./logger/Logger.mjs";
|
|
29
|
+
import { LogLevel as Pt } from "./logger/types.mjs";
|
|
30
|
+
import { default as Tt } from "./logger/sanitizeAsStringDict.mjs";
|
|
31
|
+
import { default as ht } from "./printing/getPrinterType.mjs";
|
|
32
|
+
import { default as Dt } from "./printing/isValidPrinter.mjs";
|
|
33
|
+
import { default as At } from "./printing/isValidNetworkPrinter.mjs";
|
|
34
|
+
import { default as Vt } from "./printing/isValidStarCloudPrinter.mjs";
|
|
35
|
+
import { default as Lt } from "./printing/isTerminalPrinter.mjs";
|
|
36
|
+
import { default as Wt } from "./number/randomIntFromInterval.mjs";
|
|
37
|
+
import { default as Nt } from "./tables/decodeTableQRPayload.mjs";
|
|
38
|
+
import { default as Ht } from "./checkout/getCheckoutItemModifications.mjs";
|
|
39
|
+
import { default as qt } from "./checkout/getCheckoutProductName.mjs";
|
|
40
|
+
import { default as zt } from "./currency/getFormattedCurrency.mjs";
|
|
41
|
+
import { default as Jt } from "./inventory/isDetailedProductOutOfStock.mjs";
|
|
42
|
+
import { default as Rt } from "./inventory/isDetailedProductVariantOutOfStocks.mjs";
|
|
43
|
+
import { default as jt } from "./inventory/isMenuTreeProductOutOfStock.mjs";
|
|
38
44
|
import "moment";
|
|
39
45
|
import "@ancon/wildcat-types";
|
|
40
46
|
import "./outlet/types.mjs";
|
|
@@ -46,45 +52,52 @@ import "lodash";
|
|
|
46
52
|
import "compare-versions";
|
|
47
53
|
import "tinycolor2";
|
|
48
54
|
import "@ancon/wildcat-printing";
|
|
55
|
+
import "./currency/getFormattedCurrencyPostfix.mjs";
|
|
49
56
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
x as DayOfWeek,
|
|
58
|
+
g as IntervalState,
|
|
59
|
+
O as IntervalType,
|
|
60
|
+
Pt as LogLevel,
|
|
61
|
+
ct as Logger,
|
|
62
|
+
c as OrderFormat,
|
|
63
|
+
st as brighten,
|
|
64
|
+
j as cleanVersionString,
|
|
65
|
+
it as darken,
|
|
66
|
+
Nt as decodeTableQRPayload,
|
|
67
|
+
$ as generateBackoffWithEqualJitter,
|
|
68
|
+
T as generateId,
|
|
69
|
+
Ht as getCheckoutGroupedModifications,
|
|
70
|
+
qt as getCheckoutProductName,
|
|
71
|
+
Z as getEndpointWithVersion,
|
|
72
|
+
zt as getFormattedCurrency,
|
|
73
|
+
gt as getFullAddressString,
|
|
74
|
+
nt as getFullName,
|
|
75
|
+
h as getListOutletOpeningHoursTable,
|
|
76
|
+
A as getOutletAvailabilityInfo,
|
|
67
77
|
L as getOutletAvailableOrderFormats,
|
|
68
|
-
|
|
78
|
+
H as getOutletDeliveryFee,
|
|
69
79
|
W as getOutletFormattedDistance,
|
|
70
80
|
V as getOutletOfflineOrderFormats,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
81
|
+
z as getOutletOrderFormats,
|
|
82
|
+
D as getOutletTagInformation,
|
|
83
|
+
q as getOutletTodayOpeningTimes,
|
|
84
|
+
ht as getPrinterType,
|
|
85
|
+
X as getUrlAndParams,
|
|
86
|
+
mt as isDarkBackground,
|
|
87
|
+
Jt as isDetailedProductOutOfStock,
|
|
88
|
+
Rt as isDetailedProductVariantOutOfStocks,
|
|
89
|
+
jt as isMenuTreeProductOutOfStock,
|
|
90
|
+
N as isOutletAcceptingPreOrders,
|
|
91
|
+
Lt as isTerminalPrinter,
|
|
92
|
+
At as isValidNetworkPrinter,
|
|
93
|
+
Dt as isValidPrinter,
|
|
94
|
+
Vt as isValidStarCloudPrinter,
|
|
95
|
+
R as isVersionALessThanB,
|
|
96
|
+
P as isWithinFlag,
|
|
97
|
+
ft as lighten,
|
|
98
|
+
Wt as randomIntFromInterval,
|
|
99
|
+
Tt as sanitizeAsStringDict,
|
|
100
|
+
J as serviceDateTimesFromOpeningHours,
|
|
101
|
+
et as slugify,
|
|
102
|
+
ot as truncate
|
|
90
103
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import isDetailedProductOutOfStock from './isDetailedProductOutOfStock';
|
|
2
|
+
import isDetailedProductVariantOutOfStocks from './isDetailedProductVariantOutOfStocks';
|
|
3
|
+
import isMenuTreeProductOutOfStock from './isMenuTreeProductOutOfStock';
|
|
4
|
+
export { isDetailedProductOutOfStock, isDetailedProductVariantOutOfStocks, isMenuTreeProductOutOfStock, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./isDetailedProductOutOfStock.js"),e=require("./isDetailedProductVariantOutOfStocks.js"),r=require("./isMenuTreeProductOutOfStock.js");exports.isDetailedProductOutOfStock=t;exports.isDetailedProductVariantOutOfStocks=e;exports.isMenuTreeProductOutOfStock=r;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as o } from "./isDetailedProductOutOfStock.mjs";
|
|
2
|
+
import { default as a } from "./isDetailedProductVariantOutOfStocks.mjs";
|
|
3
|
+
import { default as f } from "./isMenuTreeProductOutOfStock.mjs";
|
|
4
|
+
export {
|
|
5
|
+
o as isDetailedProductOutOfStock,
|
|
6
|
+
a as isDetailedProductVariantOutOfStocks,
|
|
7
|
+
f as isMenuTreeProductOutOfStock
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const f=require("./isDetailedProductVariantOutOfStocks.js");function l(i,e){var t;return((t=e||[])==null?void 0:t.length)>0&&(e==null?void 0:e.every(O=>f(O,i)))}module.exports=l;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function s(o,u){const t=o.outletStocks.find(c=>c.outletId===u);return!!(t!=null&&t.stockProductId&&t.stockCount<=0)}module.exports=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function f(e){var i;return((i=e||[])==null?void 0:i.length)>0&&(e==null?void 0:e.every(r=>r.stockProductId&&r.count<=0))}module.exports=f;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ancon/wildcat-utils",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -26,6 +26,21 @@
|
|
|
26
26
|
"require": "./api/index.js",
|
|
27
27
|
"types": "./api/index.d.ts"
|
|
28
28
|
},
|
|
29
|
+
"./checkout/getCheckoutItemModifications": {
|
|
30
|
+
"import": "./checkout/getCheckoutItemModifications.mjs",
|
|
31
|
+
"require": "./checkout/getCheckoutItemModifications.js",
|
|
32
|
+
"types": "./checkout/getCheckoutItemModifications.d.ts"
|
|
33
|
+
},
|
|
34
|
+
"./checkout/getCheckoutProductName": {
|
|
35
|
+
"import": "./checkout/getCheckoutProductName.mjs",
|
|
36
|
+
"require": "./checkout/getCheckoutProductName.js",
|
|
37
|
+
"types": "./checkout/getCheckoutProductName.d.ts"
|
|
38
|
+
},
|
|
39
|
+
"./checkout": {
|
|
40
|
+
"import": "./checkout/index.mjs",
|
|
41
|
+
"require": "./checkout/index.js",
|
|
42
|
+
"types": "./checkout/index.d.ts"
|
|
43
|
+
},
|
|
29
44
|
"./color/brighten": {
|
|
30
45
|
"import": "./color/brighten.mjs",
|
|
31
46
|
"require": "./color/brighten.js",
|
|
@@ -51,11 +66,46 @@
|
|
|
51
66
|
"require": "./color/lighten.js",
|
|
52
67
|
"types": "./color/lighten.d.ts"
|
|
53
68
|
},
|
|
69
|
+
"./currency/getFormattedCurrency": {
|
|
70
|
+
"import": "./currency/getFormattedCurrency.mjs",
|
|
71
|
+
"require": "./currency/getFormattedCurrency.js",
|
|
72
|
+
"types": "./currency/getFormattedCurrency.d.ts"
|
|
73
|
+
},
|
|
74
|
+
"./currency/getFormattedCurrencyPostfix": {
|
|
75
|
+
"import": "./currency/getFormattedCurrencyPostfix.mjs",
|
|
76
|
+
"require": "./currency/getFormattedCurrencyPostfix.js",
|
|
77
|
+
"types": "./currency/getFormattedCurrencyPostfix.d.ts"
|
|
78
|
+
},
|
|
79
|
+
"./currency": {
|
|
80
|
+
"import": "./currency/index.mjs",
|
|
81
|
+
"require": "./currency/index.js",
|
|
82
|
+
"types": "./currency/index.d.ts"
|
|
83
|
+
},
|
|
54
84
|
".": {
|
|
55
85
|
"import": "./index.mjs",
|
|
56
86
|
"require": "./index.js",
|
|
57
87
|
"types": "./index.d.ts"
|
|
58
88
|
},
|
|
89
|
+
"./inventory": {
|
|
90
|
+
"import": "./inventory/index.mjs",
|
|
91
|
+
"require": "./inventory/index.js",
|
|
92
|
+
"types": "./inventory/index.d.ts"
|
|
93
|
+
},
|
|
94
|
+
"./inventory/isDetailedProductOutOfStock": {
|
|
95
|
+
"import": "./inventory/isDetailedProductOutOfStock.mjs",
|
|
96
|
+
"require": "./inventory/isDetailedProductOutOfStock.js",
|
|
97
|
+
"types": "./inventory/isDetailedProductOutOfStock.d.ts"
|
|
98
|
+
},
|
|
99
|
+
"./inventory/isDetailedProductVariantOutOfStocks": {
|
|
100
|
+
"import": "./inventory/isDetailedProductVariantOutOfStocks.mjs",
|
|
101
|
+
"require": "./inventory/isDetailedProductVariantOutOfStocks.js",
|
|
102
|
+
"types": "./inventory/isDetailedProductVariantOutOfStocks.d.ts"
|
|
103
|
+
},
|
|
104
|
+
"./inventory/isMenuTreeProductOutOfStock": {
|
|
105
|
+
"import": "./inventory/isMenuTreeProductOutOfStock.mjs",
|
|
106
|
+
"require": "./inventory/isMenuTreeProductOutOfStock.js",
|
|
107
|
+
"types": "./inventory/isMenuTreeProductOutOfStock.d.ts"
|
|
108
|
+
},
|
|
59
109
|
"./logger/Logger": {
|
|
60
110
|
"import": "./logger/Logger.mjs",
|
|
61
111
|
"require": "./logger/Logger.js",
|