@ancon/wildcat-utils 1.7.0 → 1.8.0
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/api/getEndpointWithVersion.cjs +1 -0
- package/{dist/api → api}/getEndpointWithVersion.d.ts +0 -0
- package/api/getEndpointWithVersion.js +6 -0
- package/api/getUrlAndParams.cjs +1 -0
- package/{dist/api → api}/getUrlAndParams.d.ts +0 -0
- package/api/getUrlAndParams.js +23 -0
- package/api/index.cjs +1 -0
- package/{dist/api → api}/index.d.ts +0 -2
- package/api/index.js +6 -0
- package/color/brighten.cjs +1 -0
- package/{dist/color → color}/brighten.d.ts +0 -0
- package/color/brighten.js +7 -0
- package/color/darken.cjs +1 -0
- package/{dist/color → color}/darken.d.ts +0 -0
- package/color/darken.js +7 -0
- package/color/index.cjs +1 -0
- package/{dist/color → color}/index.d.ts +0 -0
- package/color/index.js +9 -0
- package/color/lighten.cjs +1 -0
- package/{dist/color → color}/lighten.d.ts +0 -0
- package/color/lighten.js +7 -0
- package/index.cjs +1 -0
- package/{dist/index.d.ts → index.d.ts} +0 -0
- package/index.js +32 -0
- package/outlet/getListOutletOpeningHoursTable.cjs +1 -0
- package/{dist/outlet → outlet}/getListOutletOpeningHoursTable.d.ts +0 -0
- package/outlet/getListOutletOpeningHoursTable.js +172 -0
- package/outlet/index.cjs +1 -0
- package/{dist/outlet → outlet}/index.d.ts +0 -0
- package/outlet/index.js +8 -0
- package/outlet/types.cjs +1 -0
- package/{dist/outlet → outlet}/types.d.ts +0 -0
- package/outlet/types.js +1 -0
- package/package.json +85 -100
- package/shared/enums.cjs +1 -0
- package/{dist/shared → shared}/enums.d.ts +0 -0
- package/shared/enums.js +7 -0
- package/shared/generateId.cjs +1 -0
- package/{dist/shared → shared}/generateId.d.ts +0 -0
- package/shared/generateId.js +7 -0
- package/shared/index.cjs +1 -0
- package/{dist/shared → shared}/index.d.ts +0 -0
- package/shared/index.js +11 -0
- package/shared/isWithinFlag.cjs +1 -0
- package/{dist/shared → shared}/isWithinFlag.d.ts +0 -0
- package/shared/isWithinFlag.js +6 -0
- package/string/index.cjs +1 -0
- package/{dist/string → string}/index.d.ts +0 -0
- package/string/index.js +4 -0
- package/string/slugify.cjs +1 -0
- package/{dist/string → string}/slugify.d.ts +0 -0
- package/string/slugify.js +6 -0
- package/versioning/cleanVersionString.cjs +1 -0
- package/{dist/versioning → versioning}/cleanVersionString.d.ts +0 -0
- package/versioning/cleanVersionString.js +7 -0
- package/versioning/index.cjs +1 -0
- package/{dist/versioning → versioning}/index.d.ts +0 -0
- package/versioning/index.js +7 -0
- package/versioning/isVersionALessThanB.cjs +1 -0
- package/{dist/versioning → versioning}/isVersionALessThanB.d.ts +0 -0
- package/versioning/isVersionALessThanB.js +9 -0
- package/dist/api/getEndpointWithVersion.js +0 -12
- package/dist/api/getUrlAndParams.js +0 -37
- package/dist/api/index.js +0 -11
- package/dist/color/brighten.js +0 -17
- package/dist/color/darken.js +0 -17
- package/dist/color/index.js +0 -12
- package/dist/color/lighten.js +0 -17
- package/dist/index.js +0 -18
- package/dist/outlet/getListOutletOpeningHoursTable.js +0 -211
- package/dist/outlet/index.js +0 -8
- package/dist/outlet/types.js +0 -2
- package/dist/shared/enums.js +0 -31
- package/dist/shared/generateId.js +0 -7
- package/dist/shared/index.js +0 -15
- package/dist/shared/isWithinFlag.js +0 -6
- package/dist/string/index.js +0 -8
- package/dist/string/slugify.js +0 -15
- package/dist/versioning/cleanVersionString.js +0 -12
- package/dist/versioning/index.js +0 -10
- package/dist/versioning/isVersionALessThanB.js +0 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function i(t,e=1){return`v${e.toFixed(1)}/${t}`}module.exports=i;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=/(\/{.+?})/g,c=/[/{}]/g;function f(s,t){const o={url:s,params:t??{}};if(!t)return o;const n=s.match(l);return n!=null&&n.length?n.reduce((e,p)=>{const r=p.replace(c,""),g=t[r];return g?(delete e.params[r],e.url=e.url.replace(new RegExp(p,"g"),`/${g}`)):e.params[r]=t[r],e},{url:s,params:{...t}}):o}module.exports=f;
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const f = /(\/{.+?})/g, g = /[/{}]/g;
|
|
2
|
+
function a(o, e) {
|
|
3
|
+
const s = { url: o, params: e ?? {} };
|
|
4
|
+
if (!e)
|
|
5
|
+
return s;
|
|
6
|
+
const t = o.match(f);
|
|
7
|
+
return t != null && t.length ? t.reduce(
|
|
8
|
+
(n, l) => {
|
|
9
|
+
const r = l.replace(g, ""), p = e[r];
|
|
10
|
+
return p ? (delete n.params[r], n.url = n.url.replace(
|
|
11
|
+
new RegExp(l, "g"),
|
|
12
|
+
`/${p}`
|
|
13
|
+
)) : n.params[r] = e[r], n;
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
url: o,
|
|
17
|
+
params: { ...e }
|
|
18
|
+
}
|
|
19
|
+
) : s;
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
a as default
|
|
23
|
+
};
|
package/api/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getUrlAndParams.cjs"),t=require("./getEndpointWithVersion.cjs");exports.getUrlAndParams=e;exports.getEndpointWithVersion=t;
|
package/api/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("tinycolor2");function e(t,r){return n(t).brighten(r).toString()}module.exports=e;
|
|
File without changes
|
package/color/darken.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("tinycolor2");function e(r,t){return n(r).darken(t).toString()}module.exports=e;
|
|
File without changes
|
package/color/darken.js
ADDED
package/color/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./lighten.cjs"),r=require("./brighten.cjs"),o=require("./darken.cjs");require("tinycolor2");exports.lighten=e;exports.brighten=r;exports.darken=o;
|
|
File without changes
|
package/color/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("tinycolor2");function e(t,n){return r(t).lighten(n).toString()}module.exports=e;
|
|
File without changes
|
package/color/lighten.js
ADDED
package/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./shared/enums.cjs"),r=require("./shared/isWithinFlag.cjs"),t=require("./shared/generateId.cjs"),n=require("./outlet/getListOutletOpeningHoursTable.cjs"),i=require("./versioning/isVersionALessThanB.cjs"),s=require("./versioning/cleanVersionString.cjs"),o=require("./api/getUrlAndParams.cjs"),a=require("./api/getEndpointWithVersion.cjs"),u=require("./string/slugify.cjs"),g=require("./color/lighten.cjs"),l=require("./color/brighten.cjs"),c=require("./color/darken.cjs");require("moment");require("compare-versions");require("tinycolor2");exports.DayOfWeek=e.DayOfWeek;exports.IntervalState=e.IntervalState;exports.IntervalType=e.IntervalType;exports.OrderFormat=e.OrderFormat;exports.isWithinFlag=r;exports.generateId=t;exports.getListOutletOpeningHoursTable=n;exports.isVersionALessThanB=i;exports.cleanVersionString=s;exports.getUrlAndParams=o;exports.getEndpointWithVersion=a;exports.slugify=u;exports.lighten=g;exports.brighten=l;exports.darken=c;
|
|
File without changes
|
package/index.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { DayOfWeek as f, IntervalState as s, IntervalType as l, OrderFormat as i } from "./shared/enums.js";
|
|
2
|
+
import { default as p } from "./shared/isWithinFlag.js";
|
|
3
|
+
import { default as d } from "./shared/generateId.js";
|
|
4
|
+
import { default as x } from "./outlet/getListOutletOpeningHoursTable.js";
|
|
5
|
+
import { default as h } from "./versioning/isVersionALessThanB.js";
|
|
6
|
+
import { default as y } from "./versioning/cleanVersionString.js";
|
|
7
|
+
import { default as T } from "./api/getUrlAndParams.js";
|
|
8
|
+
import { default as W } from "./api/getEndpointWithVersion.js";
|
|
9
|
+
import { default as k } from "./string/slugify.js";
|
|
10
|
+
import { default as A } from "./color/lighten.js";
|
|
11
|
+
import { default as L } from "./color/brighten.js";
|
|
12
|
+
import { default as c } from "./color/darken.js";
|
|
13
|
+
import "moment";
|
|
14
|
+
import "compare-versions";
|
|
15
|
+
import "tinycolor2";
|
|
16
|
+
export {
|
|
17
|
+
f as DayOfWeek,
|
|
18
|
+
s as IntervalState,
|
|
19
|
+
l as IntervalType,
|
|
20
|
+
i as OrderFormat,
|
|
21
|
+
L as brighten,
|
|
22
|
+
y as cleanVersionString,
|
|
23
|
+
c as darken,
|
|
24
|
+
d as generateId,
|
|
25
|
+
W as getEndpointWithVersion,
|
|
26
|
+
x as getListOutletOpeningHoursTable,
|
|
27
|
+
T as getUrlAndParams,
|
|
28
|
+
h as isVersionALessThanB,
|
|
29
|
+
p as isWithinFlag,
|
|
30
|
+
A as lighten,
|
|
31
|
+
k as slugify
|
|
32
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const k=require("moment"),r=require("../shared/enums.cjs"),g=require("../shared/isWithinFlag.cjs"),I=require("../shared/generateId.cjs"),l=[{id:r.OrderFormat.EatIn,name:"eatIn"},{id:r.OrderFormat.Takeaway,name:"takeaway"},{id:r.OrderFormat.TableOrder,name:"tableOrder"},{id:r.OrderFormat.Delivery,name:"delivery"}];function F(e){const n=k.utc(e).subtract(1,"day").startOf("day"),t=[];for(let i=0,s=n;i<7;i+=1)s=s.clone().add(1,"day").startOf("day"),t.push(s.clone());return t}function v(e){return[...e].sort((n,t)=>n.isoWeekday()-t.isoWeekday())}function W(e){return e.split(":").map(Number)}function S(e,n){const[t,i]=W(e.start),[s,a]=W(e.duration);if(e.type===r.IntervalType.Interval){const o=n.clone().add(t,"hour").add(i,"minute"),u=o.clone().add(s,"hour").add(a,"minute");return{id:e.id,start:o.toISOString(),end:u.toISOString()}}if(e.type===r.IntervalType.Exception){const o=k(e.fromDate),u=k(e.toDate);if(n.isBetween(o,u,void 0,"[]")){const c=n.clone().add(t,"hour").add(i,"minute"),y=c.clone().add(s,"hour").add(a,"minute");return{id:e.id,start:c.toISOString(),end:y.toISOString(),reason:e.reason}}return null}throw new Error("Invalid interval type")}function h(e,n,t){const i={[r.DayOfWeek.Monday]:1,[r.DayOfWeek.Tuesday]:2,[r.DayOfWeek.Wednesday]:3,[r.DayOfWeek.Thursday]:4,[r.DayOfWeek.Friday]:5,[r.DayOfWeek.Saturday]:6,[r.DayOfWeek.Sunday]:7};for(let s=0;s<n.length;s+=1){const a=n[s],o=a.isoWeekday(),u=e.dayOfWeek,y=(i[u]??null)===o||u===r.DayOfWeek.Everyday;if(t[o]||(t[o]={isoWeekday:o,key:"",open:[],adjusted:[],closed:[]}),y){const d=S(e,a);d&&(t[o].key+=d.id,e.type===r.IntervalType.Interval&&e.state===r.IntervalState.Open?t[o].open.push(d):e.type===r.IntervalType.Interval&&e.state===r.IntervalState.Closed?t[o].closed.push(d):e.type===r.IntervalType.Exception&&e.state===r.IntervalState.Open?t[o].adjusted.push(d):e.type===r.IntervalType.Exception&&e.state===r.IntervalState.Closed&&t[o].closed.push(d))}}}function T(e){switch(e.type){case r.IntervalType.Exception:return I("interval-exception");case r.IntervalType.Interval:return I("interval-normal");default:return I("interval-unknown")}}function D(e){const n=e.reduce((t,i)=>(l.forEach(s=>{g(s.id,i.orderFormats)&&(t[s.id]||(t[s.id]={orderFormat:s,intervals:[]}),t[s.id].intervals.push(...i.intervals.sort((a,o)=>a.dayOfWeek-o.dayOfWeek)))}),t),{});return Object.values(n)}function M(e){return e.reduce((n,t,i)=>{const s=n.findIndex(a=>a!==t&&!a.orderFormats.some(o=>t.orderFormats.some(u=>u.id===o.id))&&a.openingHours.every(o=>t.openingHours.some(u=>u.key===o.key))&&t.openingHours.every(o=>a.openingHours.some(u=>u.key===o.key)));if(s>=0){const a=n[s];return n.splice(s,1,{...a,orderFormats:[...t.orderFormats,...a.orderFormats]}),n.splice(i,1),n}return n},[...e])}function H(e){return e.map(n=>({...n,intervals:n.intervals.map(t=>({...t,id:T(t)}))}))}function E(e,n){const t=D(H(e.serviceDateTimes)),i=F(n),s=v(i),a=t.reduce((y,d)=>(y[d.orderFormat.id]||(y[d.orderFormat.id]={}),d.intervals.reduce((O,p)=>(h(p,s,O),O),y[d.orderFormat.id]),y),{}),o={[r.OrderFormat.EatIn]:l[0],[r.OrderFormat.Takeaway]:l[1],[r.OrderFormat.TableOrder]:l[2],[r.OrderFormat.Delivery]:l[3]},u=Object.entries(a).map(([y,d])=>({orderFormats:[o[Number(y)]],openingHours:Object.entries(d).map(([O,p])=>({isoWeekday:Number(O),key:p.key,open:p.open.sort((m,f)=>m.start.localeCompare(f.start)),adjusted:p.adjusted.sort((m,f)=>m.start.localeCompare(f.start)),closed:p.closed.sort((m,f)=>m.start.localeCompare(f.start))}))}));return M(u).sort((y,d)=>y.orderFormats[0].id-d.orderFormats[0].id)}module.exports=E;
|
|
File without changes
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import F from "moment";
|
|
2
|
+
import { OrderFormat as p, DayOfWeek as m, IntervalType as y, IntervalState as O } from "../shared/enums.js";
|
|
3
|
+
import h from "../shared/isWithinFlag.js";
|
|
4
|
+
import W from "../shared/generateId.js";
|
|
5
|
+
const k = [
|
|
6
|
+
{ id: p.EatIn, name: "eatIn" },
|
|
7
|
+
{ id: p.Takeaway, name: "takeaway" },
|
|
8
|
+
{ id: p.TableOrder, name: "tableOrder" },
|
|
9
|
+
{ id: p.Delivery, name: "delivery" }
|
|
10
|
+
];
|
|
11
|
+
function M(e) {
|
|
12
|
+
const r = F.utc(e).subtract(1, "day").startOf("day"), t = [];
|
|
13
|
+
for (let a = 0, o = r; a < 7; a += 1)
|
|
14
|
+
o = o.clone().add(1, "day").startOf("day"), t.push(o.clone());
|
|
15
|
+
return t;
|
|
16
|
+
}
|
|
17
|
+
function v(e) {
|
|
18
|
+
return [...e].sort((r, t) => r.isoWeekday() - t.isoWeekday());
|
|
19
|
+
}
|
|
20
|
+
function S(e) {
|
|
21
|
+
return e.split(":").map(Number);
|
|
22
|
+
}
|
|
23
|
+
function H(e, r) {
|
|
24
|
+
const [t, a] = S(e.start), [o, s] = S(
|
|
25
|
+
e.duration
|
|
26
|
+
);
|
|
27
|
+
if (e.type === y.Interval) {
|
|
28
|
+
const n = r.clone().add(t, "hour").add(a, "minute"), i = n.clone().add(o, "hour").add(s, "minute");
|
|
29
|
+
return {
|
|
30
|
+
id: e.id,
|
|
31
|
+
start: n.toISOString(),
|
|
32
|
+
end: i.toISOString()
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
if (e.type === y.Exception) {
|
|
36
|
+
const n = F(e.fromDate), i = F(e.toDate);
|
|
37
|
+
if (r.isBetween(n, i, void 0, "[]")) {
|
|
38
|
+
const I = r.clone().add(t, "hour").add(a, "minute"), u = I.clone().add(o, "hour").add(s, "minute");
|
|
39
|
+
return {
|
|
40
|
+
id: e.id,
|
|
41
|
+
start: I.toISOString(),
|
|
42
|
+
end: u.toISOString(),
|
|
43
|
+
reason: e.reason
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
throw new Error("Invalid interval type");
|
|
49
|
+
}
|
|
50
|
+
function E(e, r, t) {
|
|
51
|
+
const a = {
|
|
52
|
+
[m.Monday]: 1,
|
|
53
|
+
[m.Tuesday]: 2,
|
|
54
|
+
[m.Wednesday]: 3,
|
|
55
|
+
[m.Thursday]: 4,
|
|
56
|
+
[m.Friday]: 5,
|
|
57
|
+
[m.Saturday]: 6,
|
|
58
|
+
[m.Sunday]: 7
|
|
59
|
+
};
|
|
60
|
+
for (let o = 0; o < r.length; o += 1) {
|
|
61
|
+
const s = r[o], n = s.isoWeekday(), i = e.dayOfWeek, u = (a[i] ?? null) === n || i === m.Everyday;
|
|
62
|
+
if (t[n] || (t[n] = {
|
|
63
|
+
isoWeekday: n,
|
|
64
|
+
key: "",
|
|
65
|
+
open: [],
|
|
66
|
+
adjusted: [],
|
|
67
|
+
closed: []
|
|
68
|
+
}), u) {
|
|
69
|
+
const d = H(e, s);
|
|
70
|
+
d && (t[n].key += d.id, e.type === y.Interval && e.state === O.Open ? t[n].open.push(d) : e.type === y.Interval && e.state === O.Closed ? t[n].closed.push(d) : e.type === y.Exception && e.state === O.Open ? t[n].adjusted.push(d) : e.type === y.Exception && e.state === O.Closed && t[n].closed.push(d));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function T(e) {
|
|
75
|
+
switch (e.type) {
|
|
76
|
+
case y.Exception:
|
|
77
|
+
return W("interval-exception");
|
|
78
|
+
case y.Interval:
|
|
79
|
+
return W("interval-normal");
|
|
80
|
+
default:
|
|
81
|
+
return W("interval-unknown");
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function x(e) {
|
|
85
|
+
const r = e.reduce(
|
|
86
|
+
(t, a) => (k.forEach((o) => {
|
|
87
|
+
h(o.id, a.orderFormats) && (t[o.id] || (t[o.id] = {
|
|
88
|
+
orderFormat: o,
|
|
89
|
+
intervals: []
|
|
90
|
+
}), t[o.id].intervals.push(
|
|
91
|
+
...a.intervals.sort(
|
|
92
|
+
(s, n) => s.dayOfWeek - n.dayOfWeek
|
|
93
|
+
)
|
|
94
|
+
));
|
|
95
|
+
}), t),
|
|
96
|
+
{}
|
|
97
|
+
);
|
|
98
|
+
return Object.values(r);
|
|
99
|
+
}
|
|
100
|
+
function j(e) {
|
|
101
|
+
return e.reduce(
|
|
102
|
+
(r, t, a) => {
|
|
103
|
+
const o = r.findIndex(
|
|
104
|
+
(s) => s !== t && !s.orderFormats.some(
|
|
105
|
+
(n) => t.orderFormats.some(
|
|
106
|
+
(i) => i.id === n.id
|
|
107
|
+
)
|
|
108
|
+
) && s.openingHours.every(
|
|
109
|
+
(n) => t.openingHours.some((i) => i.key === n.key)
|
|
110
|
+
) && t.openingHours.every(
|
|
111
|
+
(n) => s.openingHours.some((i) => i.key === n.key)
|
|
112
|
+
)
|
|
113
|
+
);
|
|
114
|
+
if (o >= 0) {
|
|
115
|
+
const s = r[o];
|
|
116
|
+
return r.splice(o, 1, {
|
|
117
|
+
...s,
|
|
118
|
+
orderFormats: [...t.orderFormats, ...s.orderFormats]
|
|
119
|
+
}), r.splice(a, 1), r;
|
|
120
|
+
}
|
|
121
|
+
return r;
|
|
122
|
+
},
|
|
123
|
+
[...e]
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
function w(e) {
|
|
127
|
+
return e.map((r) => ({
|
|
128
|
+
...r,
|
|
129
|
+
intervals: r.intervals.map((t) => ({
|
|
130
|
+
...t,
|
|
131
|
+
id: T(t)
|
|
132
|
+
}))
|
|
133
|
+
}));
|
|
134
|
+
}
|
|
135
|
+
function A(e, r) {
|
|
136
|
+
const t = x(
|
|
137
|
+
w(e.serviceDateTimes)
|
|
138
|
+
), a = M(r), o = v(a), s = t.reduce(
|
|
139
|
+
(u, d) => (u[d.orderFormat.id] || (u[d.orderFormat.id] = {}), d.intervals.reduce((g, f) => (E(f, o, g), g), u[d.orderFormat.id]), u),
|
|
140
|
+
{}
|
|
141
|
+
), n = {
|
|
142
|
+
[p.EatIn]: k[0],
|
|
143
|
+
[p.Takeaway]: k[1],
|
|
144
|
+
[p.TableOrder]: k[2],
|
|
145
|
+
[p.Delivery]: k[3]
|
|
146
|
+
}, i = Object.entries(
|
|
147
|
+
s
|
|
148
|
+
).map(([u, d]) => ({
|
|
149
|
+
orderFormats: [n[Number(u)]],
|
|
150
|
+
openingHours: Object.entries(d).map(
|
|
151
|
+
([g, f]) => ({
|
|
152
|
+
isoWeekday: Number(g),
|
|
153
|
+
key: f.key,
|
|
154
|
+
open: f.open.sort(
|
|
155
|
+
(c, l) => c.start.localeCompare(l.start)
|
|
156
|
+
),
|
|
157
|
+
adjusted: f.adjusted.sort(
|
|
158
|
+
(c, l) => c.start.localeCompare(l.start)
|
|
159
|
+
),
|
|
160
|
+
closed: f.closed.sort(
|
|
161
|
+
(c, l) => c.start.localeCompare(l.start)
|
|
162
|
+
)
|
|
163
|
+
})
|
|
164
|
+
)
|
|
165
|
+
}));
|
|
166
|
+
return j(i).sort(
|
|
167
|
+
(u, d) => u.orderFormats[0].id - d.orderFormats[0].id
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
export {
|
|
171
|
+
A as default
|
|
172
|
+
};
|
package/outlet/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getListOutletOpeningHoursTable.cjs");require("moment");require("../shared/enums.cjs");require("../shared/isWithinFlag.cjs");require("../shared/generateId.cjs");exports.getListOutletOpeningHoursTable=e;
|
|
File without changes
|
package/outlet/index.js
ADDED
package/outlet/types.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|
package/outlet/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/package.json
CHANGED
|
@@ -1,106 +1,91 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ancon/wildcat-utils",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "",
|
|
5
|
-
"repository": "git@bitbucket.org:anconab/wildcat.client.utils.git",
|
|
6
|
-
"main": "dist/index.js",
|
|
3
|
+
"version": "1.8.0",
|
|
7
4
|
"private": false,
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "index.cjs",
|
|
7
|
+
"module": "index.js",
|
|
8
|
+
"types": "index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
"./api/getEndpointWithVersion": {
|
|
11
|
+
"import": "./api/getEndpointWithVersion.js",
|
|
12
|
+
"require": "./api/getEndpointWithVersion.cjs"
|
|
13
|
+
},
|
|
14
|
+
"./api/getUrlAndParams": {
|
|
15
|
+
"import": "./api/getUrlAndParams.js",
|
|
16
|
+
"require": "./api/getUrlAndParams.cjs"
|
|
17
|
+
},
|
|
18
|
+
"./api": {
|
|
19
|
+
"import": "./api/index.js",
|
|
20
|
+
"require": "./api/index.cjs"
|
|
21
|
+
},
|
|
22
|
+
"./color/brighten": {
|
|
23
|
+
"import": "./color/brighten.js",
|
|
24
|
+
"require": "./color/brighten.cjs"
|
|
25
|
+
},
|
|
26
|
+
"./color/darken": {
|
|
27
|
+
"import": "./color/darken.js",
|
|
28
|
+
"require": "./color/darken.cjs"
|
|
29
|
+
},
|
|
30
|
+
"./color": {
|
|
31
|
+
"import": "./color/index.js",
|
|
32
|
+
"require": "./color/index.cjs"
|
|
33
|
+
},
|
|
34
|
+
"./color/lighten": {
|
|
35
|
+
"import": "./color/lighten.js",
|
|
36
|
+
"require": "./color/lighten.cjs"
|
|
37
|
+
},
|
|
38
|
+
".": {
|
|
39
|
+
"import": "./index.js",
|
|
40
|
+
"require": "./index.cjs"
|
|
41
|
+
},
|
|
42
|
+
"./outlet/getListOutletOpeningHoursTable": {
|
|
43
|
+
"import": "./outlet/getListOutletOpeningHoursTable.js",
|
|
44
|
+
"require": "./outlet/getListOutletOpeningHoursTable.cjs"
|
|
45
|
+
},
|
|
46
|
+
"./outlet": {
|
|
47
|
+
"import": "./outlet/index.js",
|
|
48
|
+
"require": "./outlet/index.cjs"
|
|
49
|
+
},
|
|
50
|
+
"./outlet/types": {
|
|
51
|
+
"import": "./outlet/types.js",
|
|
52
|
+
"require": "./outlet/types.cjs"
|
|
53
|
+
},
|
|
54
|
+
"./shared/enums": {
|
|
55
|
+
"import": "./shared/enums.js",
|
|
56
|
+
"require": "./shared/enums.cjs"
|
|
57
|
+
},
|
|
58
|
+
"./shared/generateId": {
|
|
59
|
+
"import": "./shared/generateId.js",
|
|
60
|
+
"require": "./shared/generateId.cjs"
|
|
61
|
+
},
|
|
62
|
+
"./shared": {
|
|
63
|
+
"import": "./shared/index.js",
|
|
64
|
+
"require": "./shared/index.cjs"
|
|
65
|
+
},
|
|
66
|
+
"./shared/isWithinFlag": {
|
|
67
|
+
"import": "./shared/isWithinFlag.js",
|
|
68
|
+
"require": "./shared/isWithinFlag.cjs"
|
|
69
|
+
},
|
|
70
|
+
"./string": {
|
|
71
|
+
"import": "./string/index.js",
|
|
72
|
+
"require": "./string/index.cjs"
|
|
73
|
+
},
|
|
74
|
+
"./string/slugify": {
|
|
75
|
+
"import": "./string/slugify.js",
|
|
76
|
+
"require": "./string/slugify.cjs"
|
|
77
|
+
},
|
|
78
|
+
"./versioning/cleanVersionString": {
|
|
79
|
+
"import": "./versioning/cleanVersionString.js",
|
|
80
|
+
"require": "./versioning/cleanVersionString.cjs"
|
|
81
|
+
},
|
|
82
|
+
"./versioning": {
|
|
83
|
+
"import": "./versioning/index.js",
|
|
84
|
+
"require": "./versioning/index.cjs"
|
|
85
|
+
},
|
|
86
|
+
"./versioning/isVersionALessThanB": {
|
|
87
|
+
"import": "./versioning/isVersionALessThanB.js",
|
|
88
|
+
"require": "./versioning/isVersionALessThanB.cjs"
|
|
70
89
|
}
|
|
71
|
-
},
|
|
72
|
-
"lint-staged": {
|
|
73
|
-
"src/**/*.ts": [
|
|
74
|
-
"eslint",
|
|
75
|
-
"prettier --write"
|
|
76
|
-
]
|
|
77
|
-
},
|
|
78
|
-
"release": {
|
|
79
|
-
"branches": [
|
|
80
|
-
"main"
|
|
81
|
-
],
|
|
82
|
-
"plugins": [
|
|
83
|
-
[
|
|
84
|
-
"@semantic-release/commit-analyzer"
|
|
85
|
-
],
|
|
86
|
-
[
|
|
87
|
-
"@semantic-release/release-notes-generator",
|
|
88
|
-
{
|
|
89
|
-
"preset": "conventionalCommits"
|
|
90
|
-
}
|
|
91
|
-
],
|
|
92
|
-
"@semantic-release/npm",
|
|
93
|
-
[
|
|
94
|
-
"@semantic-release/git",
|
|
95
|
-
{
|
|
96
|
-
"assets": [
|
|
97
|
-
"package.json"
|
|
98
|
-
]
|
|
99
|
-
}
|
|
100
|
-
]
|
|
101
|
-
]
|
|
102
|
-
},
|
|
103
|
-
"dependencies": {
|
|
104
|
-
"tinycolor2": "^1.4.2"
|
|
105
90
|
}
|
|
106
91
|
}
|
package/shared/enums.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var n=(d=>(d[d.EatIn=1]="EatIn",d[d.Takeaway=2]="Takeaway",d[d.TableOrder=4]="TableOrder",d[d.Delivery=8]="Delivery",d))(n||{}),u=(d=>(d[d.Monday=1]="Monday",d[d.Tuesday=2]="Tuesday",d[d.Wednesday=4]="Wednesday",d[d.Thursday=8]="Thursday",d[d.Friday=16]="Friday",d[d.Saturday=32]="Saturday",d[d.Sunday=64]="Sunday",d[d.Everyday=127]="Everyday",d))(u||{}),a=(d=>(d[d.Open=0]="Open",d[d.Closed=1]="Closed",d))(a||{}),r=(d=>(d[d.Interval=0]="Interval",d[d.Exception=1]="Exception",d))(r||{});exports.DayOfWeek=u;exports.IntervalState=a;exports.IntervalType=r;exports.OrderFormat=n;
|
|
File without changes
|
package/shared/enums.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
var n = /* @__PURE__ */ ((d) => (d[d.EatIn = 1] = "EatIn", d[d.Takeaway = 2] = "Takeaway", d[d.TableOrder = 4] = "TableOrder", d[d.Delivery = 8] = "Delivery", d))(n || {}), u = /* @__PURE__ */ ((d) => (d[d.Monday = 1] = "Monday", d[d.Tuesday = 2] = "Tuesday", d[d.Wednesday = 4] = "Wednesday", d[d.Thursday = 8] = "Thursday", d[d.Friday = 16] = "Friday", d[d.Saturday = 32] = "Saturday", d[d.Sunday = 64] = "Sunday", d[d.Everyday = 127] = "Everyday", d))(u || {}), s = /* @__PURE__ */ ((d) => (d[d.Open = 0] = "Open", d[d.Closed = 1] = "Closed", d))(s || {}), i = /* @__PURE__ */ ((d) => (d[d.Interval = 0] = "Interval", d[d.Exception = 1] = "Exception", d))(i || {});
|
|
2
|
+
export {
|
|
3
|
+
u as DayOfWeek,
|
|
4
|
+
s as IntervalState,
|
|
5
|
+
i as IntervalType,
|
|
6
|
+
n as OrderFormat
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function n(t){const r=Math.random().toString();return`${t?`${t}-`:""}${r.substring(2)}`}module.exports=n;
|
|
File without changes
|
package/shared/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./enums.cjs"),r=require("./isWithinFlag.cjs"),t=require("./generateId.cjs");exports.DayOfWeek=e.DayOfWeek;exports.IntervalState=e.IntervalState;exports.IntervalType=e.IntervalType;exports.OrderFormat=e.OrderFormat;exports.isWithinFlag=r;exports.generateId=t;
|
|
File without changes
|
package/shared/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DayOfWeek as t, IntervalState as a, IntervalType as o, OrderFormat as f } from "./enums.js";
|
|
2
|
+
import { default as d } from "./isWithinFlag.js";
|
|
3
|
+
import { default as n } from "./generateId.js";
|
|
4
|
+
export {
|
|
5
|
+
t as DayOfWeek,
|
|
6
|
+
a as IntervalState,
|
|
7
|
+
o as IntervalType,
|
|
8
|
+
f as OrderFormat,
|
|
9
|
+
n as generateId,
|
|
10
|
+
d as isWithinFlag
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function r(t,i){return(i&t)===t}module.exports=r;
|
|
File without changes
|
package/string/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./slugify.cjs");exports.slugify=e;
|
|
File without changes
|
package/string/index.js
ADDED