melonykit 0.11.0 → 0.11.2

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/dist/browser.js CHANGED
@@ -1,4 +1,4 @@
1
- import { r as e } from "./functions-P-iB52B8.js";
1
+ import { m as e } from "./functions-lglYN2Ig.js";
2
2
  import { signal as t } from "@preact/signals";
3
3
  import { useEffect as n, useMemo as r } from "preact/hooks";
4
4
  //#region src/browser/_route-to.js
@@ -26,66 +26,16 @@ function n(t, n) {
26
26
  return `#${r.map((e) => Math.round(e * i)).map((e) => e.toString(16).padStart(2, "0")).join("")}`;
27
27
  }
28
28
  //#endregion
29
- //#region src/functions/checks/_is-array.js
30
- function r(e) {
31
- return Array.isArray(e);
32
- }
33
- //#endregion
34
- //#region src/functions/checks/_is-empty-array.js
35
- function i(e) {
36
- return r(e) && e.length === 0;
37
- }
38
- //#endregion
39
- //#region src/functions/checks/_is-nil.js
40
- function a(e) {
41
- return e == null;
42
- }
43
- //#endregion
44
- //#region src/functions/checks/_is-object.js
45
- function o(e) {
46
- return !a(e) && typeof e == "object" && !r(e);
47
- }
48
- //#endregion
49
- //#region src/functions/checks/_is-empty-object.js
50
- function s(e) {
51
- return o(e) && Reflect.ownKeys(e).every((t) => !Object.prototype.propertyIsEnumerable.call(e, t));
52
- }
53
- //#endregion
54
29
  //#region src/functions/checks/_is-string.js
55
- function c(e) {
30
+ function r(e) {
56
31
  return typeof e == "string";
57
32
  }
58
33
  //#endregion
59
- //#region src/functions/checks/_is-empty-string.js
60
- function l(e) {
61
- return c(e) && e.trim().length === 0;
62
- }
63
- //#endregion
64
- //#region src/functions/checks/_is-function.js
65
- function u(e) {
66
- return typeof e == "function";
67
- }
68
- //#endregion
69
- //#region src/functions/checks/_is-number.js
70
- function d(e) {
71
- return typeof e == "number" && Number.isFinite(e);
72
- }
73
- //#endregion
74
- //#region src/functions/checks/_is-negative-number.js
75
- function f(e) {
76
- return d(e) && e < 0;
77
- }
78
- //#endregion
79
- //#region src/functions/checks/_is-positive-number.js
80
- function p(e) {
81
- return d(e) && e > 0;
82
- }
83
- //#endregion
84
34
  //#region src/functions/_format-date.js
85
- function m(e) {
35
+ function i(e) {
86
36
  return Object.prototype.toString.call(e) === "[object Date]" && !isNaN(e);
87
37
  }
88
- var h = /d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g, g = /\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g, _ = /[^-+\dA-Z]/g, v = (e, t = 2) => String(e).padStart(t, "0"), y = {
38
+ var a = /d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g, o = /\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g, s = /[^-+\dA-Z]/g, c = (e, t = 2) => String(e).padStart(t, "0"), l = {
89
39
  dayNames: [
90
40
  "So",
91
41
  "Mo",
@@ -139,64 +89,64 @@ var h = /d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'
139
89
  "PM"
140
90
  ]
141
91
  };
142
- function b(e, t = "dd.mm.yyyy", n, r) {
143
- if (!m(e) || !c(t)) return "";
144
- let i = () => n ? "getUTC" : "get", a = () => e[i() + "Date"](), o = () => e[i() + "Day"](), s = () => e[i() + "Month"](), l = () => e[i() + "FullYear"](), u = () => e[i() + "Hours"](), d = () => e[i() + "Minutes"](), f = () => e[i() + "Seconds"](), p = () => e[i() + "Milliseconds"](), g = () => n ? 0 : e.getTimezoneOffset(), _ = () => x(e), b = () => S(e), T = {
145
- d: () => a(),
146
- dd: () => v(a()),
147
- ddd: () => y.dayNames[o()],
148
- DDD: () => w({
149
- y: l(),
150
- m: s(),
151
- d: a(),
152
- _: i(),
153
- dayName: y.dayNames[o()],
92
+ function u(e, t = "dd.mm.yyyy", n, o) {
93
+ if (!i(e) || !r(t)) return "";
94
+ let s = () => n ? "getUTC" : "get", u = () => e[s() + "Date"](), h = () => e[s() + "Day"](), g = () => e[s() + "Month"](), _ = () => e[s() + "FullYear"](), v = () => e[s() + "Hours"](), y = () => e[s() + "Minutes"](), b = () => e[s() + "Seconds"](), x = () => e[s() + "Milliseconds"](), S = () => n ? 0 : e.getTimezoneOffset(), C = () => d(e), w = () => f(e), T = {
95
+ d: () => u(),
96
+ dd: () => c(u()),
97
+ ddd: () => l.dayNames[h()],
98
+ DDD: () => m({
99
+ y: _(),
100
+ m: g(),
101
+ d: u(),
102
+ _: s(),
103
+ dayName: l.dayNames[h()],
154
104
  short: !0
155
105
  }),
156
- dddd: () => y.dayNames[o() + 7],
157
- DDDD: () => w({
158
- y: l(),
159
- m: s(),
160
- d: a(),
161
- _: i(),
162
- dayName: y.dayNames[o() + 7]
106
+ dddd: () => l.dayNames[h() + 7],
107
+ DDDD: () => m({
108
+ y: _(),
109
+ m: g(),
110
+ d: u(),
111
+ _: s(),
112
+ dayName: l.dayNames[h() + 7]
163
113
  }),
164
- m: () => s() + 1,
165
- mm: () => v(s() + 1),
166
- mmm: () => y.monthNames[s()],
167
- mmmm: () => y.monthNames[s() + 12],
168
- yy: () => String(l()).slice(2),
169
- yyyy: () => v(l(), 4),
170
- h: () => u() % 12 || 12,
171
- hh: () => v(u() % 12 || 12),
172
- H: () => u(),
173
- HH: () => v(u()),
174
- M: () => d(),
175
- MM: () => v(d()),
176
- s: () => f(),
177
- ss: () => v(f()),
178
- l: () => v(p(), 3),
179
- L: () => v(Math.floor(p() / 10)),
180
- t: () => u() < 12 ? y.timeNames[0] : y.timeNames[1],
181
- tt: () => u() < 12 ? y.timeNames[2] : y.timeNames[3],
182
- T: () => u() < 12 ? y.timeNames[4] : y.timeNames[5],
183
- TT: () => u() < 12 ? y.timeNames[6] : y.timeNames[7],
184
- Z: () => r ? "GMT" : n ? "UTC" : C(e),
185
- o: () => (g() > 0 ? "-" : "+") + v(Math.floor(Math.abs(g()) / 60) * 100 + Math.abs(g()) % 60, 4),
186
- p: () => (g() > 0 ? "-" : "+") + v(Math.floor(Math.abs(g()) / 60), 2) + ":" + v(Math.floor(Math.abs(g()) % 60), 2),
114
+ m: () => g() + 1,
115
+ mm: () => c(g() + 1),
116
+ mmm: () => l.monthNames[g()],
117
+ mmmm: () => l.monthNames[g() + 12],
118
+ yy: () => String(_()).slice(2),
119
+ yyyy: () => c(_(), 4),
120
+ h: () => v() % 12 || 12,
121
+ hh: () => c(v() % 12 || 12),
122
+ H: () => v(),
123
+ HH: () => c(v()),
124
+ M: () => y(),
125
+ MM: () => c(y()),
126
+ s: () => b(),
127
+ ss: () => c(b()),
128
+ l: () => c(x(), 3),
129
+ L: () => c(Math.floor(x() / 10)),
130
+ t: () => v() < 12 ? l.timeNames[0] : l.timeNames[1],
131
+ tt: () => v() < 12 ? l.timeNames[2] : l.timeNames[3],
132
+ T: () => v() < 12 ? l.timeNames[4] : l.timeNames[5],
133
+ TT: () => v() < 12 ? l.timeNames[6] : l.timeNames[7],
134
+ Z: () => o ? "GMT" : n ? "UTC" : p(e),
135
+ o: () => (S() > 0 ? "-" : "+") + c(Math.floor(Math.abs(S()) / 60) * 100 + Math.abs(S()) % 60, 4),
136
+ p: () => (S() > 0 ? "-" : "+") + c(Math.floor(Math.abs(S()) / 60), 2) + ":" + c(Math.floor(Math.abs(S()) % 60), 2),
187
137
  S: () => [
188
138
  "th",
189
139
  "st",
190
140
  "nd",
191
141
  "rd"
192
- ][a() % 10 > 3 ? 0 : (a() % 100 - a() % 10 != 10) * a() % 10],
193
- W: () => _(),
194
- WW: () => v(_()),
195
- N: () => b()
142
+ ][u() % 10 > 3 ? 0 : (u() % 100 - u() % 10 != 10) * u() % 10],
143
+ W: () => C(),
144
+ WW: () => c(C()),
145
+ N: () => w()
196
146
  };
197
- return t.replace(h, (e) => e in T ? T[e]() : e.slice(1, e.length - 1));
147
+ return t.replace(a, (e) => e in T ? T[e]() : e.slice(1, e.length - 1));
198
148
  }
199
- var x = (e) => {
149
+ var d = (e) => {
200
150
  let t = new Date(e.getFullYear(), e.getMonth(), e.getDate());
201
151
  t.setDate(t.getDate() - (t.getDay() + 6) % 7 + 3);
202
152
  let n = new Date(t.getFullYear(), 0, 4);
@@ -205,10 +155,10 @@ var x = (e) => {
205
155
  t.setHours(t.getHours() - r);
206
156
  let i = (t - n) / 6048e5;
207
157
  return 1 + Math.floor(i);
208
- }, S = (e) => {
158
+ }, f = (e) => {
209
159
  let t = e.getDay();
210
160
  return t === 0 && (t = 7), t;
211
- }, C = (e) => (String(e).match(g) || [""]).pop().replace(_, "").replace(/GMT\+0000/g, "UTC"), w = ({ y: e, m: t, d: n, _: r, dayName: i, short: a = !1 }) => {
161
+ }, p = (e) => (String(e).match(o) || [""]).pop().replace(s, "").replace(/GMT\+0000/g, "UTC"), m = ({ y: e, m: t, d: n, _: r, dayName: i, short: a = !1 }) => {
212
162
  let o = /* @__PURE__ */ new Date(), s = /* @__PURE__ */ new Date();
213
163
  s.setDate(s[r + "Date"]() - 1);
214
164
  let c = /* @__PURE__ */ new Date();
@@ -216,7 +166,7 @@ var x = (e) => {
216
166
  };
217
167
  //#endregion
218
168
  //#region src/functions/_request.js
219
- async function T({ url: e, body: t, method: n = "POST", headers: r = {} } = {}) {
169
+ async function h({ url: e, body: t, method: n = "POST", headers: r = {} } = {}) {
220
170
  let i = n !== "GET" && t !== void 0 ? JSON.stringify(t) : void 0, a = await fetch(e, {
221
171
  method: n,
222
172
  headers: {
@@ -237,12 +187,12 @@ async function T({ url: e, body: t, method: n = "POST", headers: r = {} } = {})
237
187
  }
238
188
  //#endregion
239
189
  //#region src/functions/_size.js
240
- function E(e) {
190
+ function g(e) {
241
191
  return e == null ? 0 : Array.isArray(e) || typeof e == "string" ? e.length : typeof e == "object" || typeof e == "function" ? Object.keys(e).length : 0;
242
192
  }
243
193
  //#endregion
244
194
  //#region src/functions/_to-number.js
245
- function D(e, t = null) {
195
+ function _(e, t = null) {
246
196
  let n = typeof e == "number" ? e : typeof e == "string" && e.trim() !== "" ? Number(e) : NaN;
247
197
  if (!Number.isFinite(n)) return null;
248
198
  if (t == null) return n;
@@ -250,4 +200,59 @@ function D(e, t = null) {
250
200
  return Math.round(n * r) / r;
251
201
  }
252
202
  //#endregion
253
- export { t as _, p as a, u as c, s as d, o as f, n as g, r as h, b as i, l, i as m, E as n, f as o, a as p, T as r, d as s, D as t, c as u };
203
+ //#region src/functions/checks/_is-array.js
204
+ function v(e) {
205
+ return Array.isArray(e);
206
+ }
207
+ //#endregion
208
+ //#region src/functions/checks/_is-empty-array.js
209
+ function y(e) {
210
+ return v(e) && e.length === 0;
211
+ }
212
+ //#endregion
213
+ //#region src/functions/checks/_is-nil.js
214
+ function b(e) {
215
+ return e == null;
216
+ }
217
+ //#endregion
218
+ //#region src/functions/checks/_is-object.js
219
+ function x(e) {
220
+ return !b(e) && typeof e == "object" && !v(e);
221
+ }
222
+ //#endregion
223
+ //#region src/functions/checks/_is-empty-object.js
224
+ function S(e) {
225
+ return x(e) && Reflect.ownKeys(e).every((t) => !Object.prototype.propertyIsEnumerable.call(e, t));
226
+ }
227
+ //#endregion
228
+ //#region src/functions/checks/_is-empty-string.js
229
+ function C(e) {
230
+ return r(e) && e.trim().length === 0;
231
+ }
232
+ //#endregion
233
+ //#region src/functions/checks/_is-empty.js
234
+ function w(e) {
235
+ return e == null ? !0 : typeof e == "function" ? !1 : typeof e == "number" ? !Number.isFinite(e) : typeof e == "string" ? e.trim().length === 0 : Array.isArray(e) ? e.length === 0 : typeof e != "object" || Object.keys(e).length === 0 && Object.getOwnPropertySymbols(e).length === 0;
236
+ }
237
+ //#endregion
238
+ //#region src/functions/checks/_is-function.js
239
+ function T(e) {
240
+ return typeof e == "function";
241
+ }
242
+ //#endregion
243
+ //#region src/functions/checks/_is-number.js
244
+ function E(e) {
245
+ return typeof e == "number" && Number.isFinite(e);
246
+ }
247
+ //#endregion
248
+ //#region src/functions/checks/_is-negative-number.js
249
+ function D(e) {
250
+ return E(e) && e < 0;
251
+ }
252
+ //#endregion
253
+ //#region src/functions/checks/_is-positive-number.js
254
+ function O(e) {
255
+ return E(e) && e > 0;
256
+ }
257
+ //#endregion
258
+ export { n as _, w as a, x as c, v as d, _ as f, r as g, u as h, T as i, b as l, h as m, D as n, C as o, g as p, E as r, S as s, O as t, y as u, t as v };
package/dist/functions.js CHANGED
@@ -1,2 +1,2 @@
1
- import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "./functions-P-iB52B8.js";
2
- export { e as convertHexToRgba, a as darkenHexColor, s as formatDate, o as isArray, l as isEmptyArray, r as isEmptyObject, c as isEmptyString, n as isFunction, d as isNegativeNumber, f as isNil, m as isNumber, i as isObject, t as isPositiveNumber, g as isString, p as request, u as size, h as toNumber };
1
+ import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g, v as _ } from "./functions-lglYN2Ig.js";
2
+ export { _ as convertHexToRgba, e as darkenHexColor, o as formatDate, r as isArray, t as isEmpty, g as isEmptyArray, m as isEmptyObject, d as isEmptyString, s as isFunction, u as isNegativeNumber, c as isNil, p as isNumber, n as isObject, h as isPositiveNumber, a as isString, l as request, f as size, i as toNumber };