@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.
Files changed (81) hide show
  1. package/api/getEndpointWithVersion.cjs +1 -0
  2. package/{dist/api → api}/getEndpointWithVersion.d.ts +0 -0
  3. package/api/getEndpointWithVersion.js +6 -0
  4. package/api/getUrlAndParams.cjs +1 -0
  5. package/{dist/api → api}/getUrlAndParams.d.ts +0 -0
  6. package/api/getUrlAndParams.js +23 -0
  7. package/api/index.cjs +1 -0
  8. package/{dist/api → api}/index.d.ts +0 -2
  9. package/api/index.js +6 -0
  10. package/color/brighten.cjs +1 -0
  11. package/{dist/color → color}/brighten.d.ts +0 -0
  12. package/color/brighten.js +7 -0
  13. package/color/darken.cjs +1 -0
  14. package/{dist/color → color}/darken.d.ts +0 -0
  15. package/color/darken.js +7 -0
  16. package/color/index.cjs +1 -0
  17. package/{dist/color → color}/index.d.ts +0 -0
  18. package/color/index.js +9 -0
  19. package/color/lighten.cjs +1 -0
  20. package/{dist/color → color}/lighten.d.ts +0 -0
  21. package/color/lighten.js +7 -0
  22. package/index.cjs +1 -0
  23. package/{dist/index.d.ts → index.d.ts} +0 -0
  24. package/index.js +32 -0
  25. package/outlet/getListOutletOpeningHoursTable.cjs +1 -0
  26. package/{dist/outlet → outlet}/getListOutletOpeningHoursTable.d.ts +0 -0
  27. package/outlet/getListOutletOpeningHoursTable.js +172 -0
  28. package/outlet/index.cjs +1 -0
  29. package/{dist/outlet → outlet}/index.d.ts +0 -0
  30. package/outlet/index.js +8 -0
  31. package/outlet/types.cjs +1 -0
  32. package/{dist/outlet → outlet}/types.d.ts +0 -0
  33. package/outlet/types.js +1 -0
  34. package/package.json +85 -100
  35. package/shared/enums.cjs +1 -0
  36. package/{dist/shared → shared}/enums.d.ts +0 -0
  37. package/shared/enums.js +7 -0
  38. package/shared/generateId.cjs +1 -0
  39. package/{dist/shared → shared}/generateId.d.ts +0 -0
  40. package/shared/generateId.js +7 -0
  41. package/shared/index.cjs +1 -0
  42. package/{dist/shared → shared}/index.d.ts +0 -0
  43. package/shared/index.js +11 -0
  44. package/shared/isWithinFlag.cjs +1 -0
  45. package/{dist/shared → shared}/isWithinFlag.d.ts +0 -0
  46. package/shared/isWithinFlag.js +6 -0
  47. package/string/index.cjs +1 -0
  48. package/{dist/string → string}/index.d.ts +0 -0
  49. package/string/index.js +4 -0
  50. package/string/slugify.cjs +1 -0
  51. package/{dist/string → string}/slugify.d.ts +0 -0
  52. package/string/slugify.js +6 -0
  53. package/versioning/cleanVersionString.cjs +1 -0
  54. package/{dist/versioning → versioning}/cleanVersionString.d.ts +0 -0
  55. package/versioning/cleanVersionString.js +7 -0
  56. package/versioning/index.cjs +1 -0
  57. package/{dist/versioning → versioning}/index.d.ts +0 -0
  58. package/versioning/index.js +7 -0
  59. package/versioning/isVersionALessThanB.cjs +1 -0
  60. package/{dist/versioning → versioning}/isVersionALessThanB.d.ts +0 -0
  61. package/versioning/isVersionALessThanB.js +9 -0
  62. package/dist/api/getEndpointWithVersion.js +0 -12
  63. package/dist/api/getUrlAndParams.js +0 -37
  64. package/dist/api/index.js +0 -11
  65. package/dist/color/brighten.js +0 -17
  66. package/dist/color/darken.js +0 -17
  67. package/dist/color/index.js +0 -12
  68. package/dist/color/lighten.js +0 -17
  69. package/dist/index.js +0 -18
  70. package/dist/outlet/getListOutletOpeningHoursTable.js +0 -211
  71. package/dist/outlet/index.js +0 -8
  72. package/dist/outlet/types.js +0 -2
  73. package/dist/shared/enums.js +0 -31
  74. package/dist/shared/generateId.js +0 -7
  75. package/dist/shared/index.js +0 -15
  76. package/dist/shared/isWithinFlag.js +0 -6
  77. package/dist/string/index.js +0 -8
  78. package/dist/string/slugify.js +0 -15
  79. package/dist/versioning/cleanVersionString.js +0 -12
  80. package/dist/versioning/index.js +0 -10
  81. 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,6 @@
1
+ function n(t, e = 1) {
2
+ return `v${e.toFixed(1)}/${t}`;
3
+ }
4
+ export {
5
+ n as default
6
+ };
@@ -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;
@@ -1,5 +1,3 @@
1
1
  import getUrlAndParams from './getUrlAndParams';
2
2
  import getEndpointWithVersion from './getEndpointWithVersion';
3
3
  export { getUrlAndParams, getEndpointWithVersion };
4
- declare const _default: {};
5
- export default _default;
package/api/index.js ADDED
@@ -0,0 +1,6 @@
1
+ import { default as r } from "./getUrlAndParams.js";
2
+ import { default as o } from "./getEndpointWithVersion.js";
3
+ export {
4
+ o as getEndpointWithVersion,
5
+ r as getUrlAndParams
6
+ };
@@ -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
@@ -0,0 +1,7 @@
1
+ import n from "tinycolor2";
2
+ function i(t, r) {
3
+ return n(t).brighten(r).toString();
4
+ }
5
+ export {
6
+ i as default
7
+ };
@@ -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
@@ -0,0 +1,7 @@
1
+ import n from "tinycolor2";
2
+ function e(r, t) {
3
+ return n(r).darken(t).toString();
4
+ }
5
+ export {
6
+ e as default
7
+ };
@@ -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,9 @@
1
+ import { default as a } from "./lighten.js";
2
+ import { default as f } from "./brighten.js";
3
+ import { default as l } from "./darken.js";
4
+ import "tinycolor2";
5
+ export {
6
+ f as brighten,
7
+ l as darken,
8
+ a as lighten
9
+ };
@@ -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
@@ -0,0 +1,7 @@
1
+ import o from "tinycolor2";
2
+ function i(t, n) {
3
+ return o(t).lighten(n).toString();
4
+ }
5
+ export {
6
+ i as default
7
+ };
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;
@@ -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
+ };
@@ -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
@@ -0,0 +1,8 @@
1
+ import { default as m } from "./getListOutletOpeningHoursTable.js";
2
+ import "moment";
3
+ import "../shared/enums.js";
4
+ import "../shared/isWithinFlag.js";
5
+ import "../shared/generateId.js";
6
+ export {
7
+ m as getListOutletOpeningHoursTable
8
+ };
@@ -0,0 +1 @@
1
+ "use strict";
File without changes
@@ -0,0 +1 @@
1
+
package/package.json CHANGED
@@ -1,106 +1,91 @@
1
1
  {
2
2
  "name": "@ancon/wildcat-utils",
3
- "version": "1.7.0",
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
- "publishConfig": {
9
- "access": "public"
10
- },
11
- "files": [
12
- "dist"
13
- ],
14
- "scripts": {
15
- "test": "jest",
16
- "build": "tsc",
17
- "dev": "tsc -w"
18
- },
19
- "devDependencies": {
20
- "@ancon/wildcat-types": "^1.17.0",
21
- "@babel/core": "^7.16.5",
22
- "@babel/preset-env": "^7.16.5",
23
- "@babel/preset-typescript": "^7.16.5",
24
- "@commitlint/cli": "^16.0.1",
25
- "@commitlint/config-conventional": "^16.0.0",
26
- "@semantic-release/commit-analyzer": "^9.0.2",
27
- "@semantic-release/git": "^10.0.1",
28
- "@semantic-release/npm": "^8.0.3",
29
- "@semantic-release/release-notes-generator": "^10.0.3",
30
- "@types/jest": "^27.0.3",
31
- "@types/tinycolor2": "^1.4.3",
32
- "@typescript-eslint/eslint-plugin": "^5.8.1",
33
- "@typescript-eslint/parser": "^5.8.1",
34
- "axios": "^0.27.2",
35
- "babel-jest": "^27.4.5",
36
- "compare-versions": "^4.1.3",
37
- "eslint": "^8.5.0",
38
- "eslint-config-airbnb-base": "^15.0.0",
39
- "eslint-config-airbnb-typescript": "^16.1.0",
40
- "eslint-plugin-import": "^2.25.3",
41
- "husky": "^4.3.8",
42
- "jest": "^27.4.5",
43
- "lint-staged": "^10.2.11",
44
- "moment": "^2.29.1",
45
- "prettier": "^2.0.5",
46
- "semantic-release": "^18.0.1",
47
- "ts-jest": "^27.1.2",
48
- "typescript": "^4.5.4"
49
- },
50
- "peerDependencies": {
51
- "@ancon/wildcat-types": "*",
52
- "compare-versions": "^4.1.0",
53
- "moment": "^2.29.0"
54
- },
55
- "commitlint": {
56
- "extends": [
57
- "@commitlint/config-conventional"
58
- ]
59
- },
60
- "prettier": {
61
- "semi": false,
62
- "singleQuote": true,
63
- "trailingComma": "all",
64
- "arrowParens": "avoid"
65
- },
66
- "husky": {
67
- "hooks": {
68
- "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
69
- "pre-commit": "lint-staged"
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
  }
@@ -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
@@ -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
@@ -0,0 +1,7 @@
1
+ function r(t) {
2
+ const n = Math.random().toString();
3
+ return `${t ? `${t}-` : ""}${n.substring(2)}`;
4
+ }
5
+ export {
6
+ r as default
7
+ };
@@ -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
@@ -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
@@ -0,0 +1,6 @@
1
+ function a(t, i) {
2
+ return (i & t) === t;
3
+ }
4
+ export {
5
+ a as default
6
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./slugify.cjs");exports.slugify=e;
File without changes
@@ -0,0 +1,4 @@
1
+ import { default as e } from "./slugify.js";
2
+ export {
3
+ e as slugify
4
+ };