melonykit 1.4.0 → 1.5.1

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,4 +1,4 @@
1
- import { a as e } from "./functions-huvj-bhb.js";
1
+ import { a as e } from "./functions-DkAbnk05.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
package/dist/browser.js CHANGED
@@ -1 +1 @@
1
- export { n as getClientSetting, i as routeTo, t as setClientSetting, r as useQuery } from "./browser-jtptg5Z4.js";
1
+ export { n as getClientSetting, i as routeTo, t as setClientSetting, r as useQuery } from "./browser-CLUp6bMQ.js";
@@ -59,15 +59,10 @@ function c(e) {
59
59
  return typeof e == "number" && Number.isFinite(e);
60
60
  }
61
61
  //#endregion
62
- //#region src/functions/checks/_is-positive-number.js
63
- function l(e) {
64
- return c(e) && e > 0;
65
- }
66
- //#endregion
67
62
  //#region src/functions/_create-cache.js
68
- function u({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
63
+ function l({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
69
64
  let i = /* @__PURE__ */ new Map();
70
- async function c(t, n) {
65
+ async function l(t, n) {
71
66
  if (i.has(t)) return !1;
72
67
  let r = Date.now();
73
68
  return i.set(t, {
@@ -99,13 +94,13 @@ function u({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
99
94
  return i.delete(e), s(n) && await n(e, t), !0;
100
95
  }
101
96
  function g({ interval: e, checks: t, now: n = Date.now, setIntervalFn: r = setInterval } = {}) {
102
- l(e) && a(t) && !o(t) && t.every((e) => s(e)) && s(n) && s(r) && r(async () => {
97
+ !c(e) || e <= 0 || a(t) && !o(t) && t.every((e) => s(e)) && s(n) && s(r) && r(async () => {
103
98
  let e = n();
104
99
  for (let [n, r] of i) t.some((t) => t(r, e)) && await h(n);
105
100
  }, e)?.unref?.();
106
101
  }
107
102
  return g(r), {
108
- add: c,
103
+ add: l,
109
104
  get: d,
110
105
  size: f,
111
106
  entries: p,
@@ -116,7 +111,7 @@ function u({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
116
111
  }
117
112
  //#endregion
118
113
  //#region src/functions/_darken-hex-color.js
119
- function d(e, t) {
114
+ function u(e, t) {
120
115
  let n = r(e);
121
116
  if (!Number.isFinite(t)) throw TypeError("amount must be a finite number");
122
117
  if (t < 0 || t > 1) throw RangeError("amount must be between 0 and 1");
@@ -125,10 +120,10 @@ function d(e, t) {
125
120
  }
126
121
  //#endregion
127
122
  //#region src/functions/_format-date.js
128
- function f(e) {
123
+ function d(e) {
129
124
  return Object.prototype.toString.call(e) === "[object Date]" && !isNaN(e);
130
125
  }
131
- var p = /d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g, m = /\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g, h = /[^-+\dA-Z]/g, g = (e, t = 2) => String(e).padStart(t, "0"), _ = {
126
+ var f = /d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g, p = /\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g, m = /[^-+\dA-Z]/g, h = (e, t = 2) => String(e).padStart(t, "0"), g = {
132
127
  dayNames: [
133
128
  "So",
134
129
  "Mo",
@@ -182,51 +177,51 @@ var p = /d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'
182
177
  "PM"
183
178
  ]
184
179
  };
185
- function v(e, n = "dd.mm.yyyy", r, i) {
186
- if (!f(e) || !t(n)) return "";
187
- let a = () => r ? "getUTC" : "get", o = () => e[a() + "Date"](), s = () => e[a() + "Day"](), c = () => e[a() + "Month"](), l = () => e[a() + "FullYear"](), u = () => e[a() + "Hours"](), d = () => e[a() + "Minutes"](), m = () => e[a() + "Seconds"](), h = () => e[a() + "Milliseconds"](), v = () => r ? 0 : e.getTimezoneOffset(), C = () => y(e), w = () => b(e), T = {
180
+ function _(e, n = "dd.mm.yyyy", r, i) {
181
+ if (!d(e) || !t(n)) return "";
182
+ let a = () => r ? "getUTC" : "get", o = () => e[a() + "Date"](), s = () => e[a() + "Day"](), c = () => e[a() + "Month"](), l = () => e[a() + "FullYear"](), u = () => e[a() + "Hours"](), p = () => e[a() + "Minutes"](), m = () => e[a() + "Seconds"](), _ = () => e[a() + "Milliseconds"](), S = () => r ? 0 : e.getTimezoneOffset(), C = () => v(e), w = () => y(e), T = {
188
183
  d: () => o(),
189
- dd: () => g(o()),
190
- ddd: () => _.dayNames[s()],
191
- DDD: () => S({
184
+ dd: () => h(o()),
185
+ ddd: () => g.dayNames[s()],
186
+ DDD: () => x({
192
187
  y: l(),
193
188
  m: c(),
194
189
  d: o(),
195
190
  _: a(),
196
- dayName: _.dayNames[s()],
191
+ dayName: g.dayNames[s()],
197
192
  short: !0
198
193
  }),
199
- dddd: () => _.dayNames[s() + 7],
200
- DDDD: () => S({
194
+ dddd: () => g.dayNames[s() + 7],
195
+ DDDD: () => x({
201
196
  y: l(),
202
197
  m: c(),
203
198
  d: o(),
204
199
  _: a(),
205
- dayName: _.dayNames[s() + 7]
200
+ dayName: g.dayNames[s() + 7]
206
201
  }),
207
202
  m: () => c() + 1,
208
- mm: () => g(c() + 1),
209
- mmm: () => _.monthNames[c()],
210
- mmmm: () => _.monthNames[c() + 12],
203
+ mm: () => h(c() + 1),
204
+ mmm: () => g.monthNames[c()],
205
+ mmmm: () => g.monthNames[c() + 12],
211
206
  yy: () => String(l()).slice(2),
212
- yyyy: () => g(l(), 4),
207
+ yyyy: () => h(l(), 4),
213
208
  h: () => u() % 12 || 12,
214
- hh: () => g(u() % 12 || 12),
209
+ hh: () => h(u() % 12 || 12),
215
210
  H: () => u(),
216
- HH: () => g(u()),
217
- M: () => d(),
218
- MM: () => g(d()),
211
+ HH: () => h(u()),
212
+ M: () => p(),
213
+ MM: () => h(p()),
219
214
  s: () => m(),
220
- ss: () => g(m()),
221
- l: () => g(h(), 3),
222
- L: () => g(Math.floor(h() / 10)),
223
- t: () => u() < 12 ? _.timeNames[0] : _.timeNames[1],
224
- tt: () => u() < 12 ? _.timeNames[2] : _.timeNames[3],
225
- T: () => u() < 12 ? _.timeNames[4] : _.timeNames[5],
226
- TT: () => u() < 12 ? _.timeNames[6] : _.timeNames[7],
227
- Z: () => i ? "GMT" : r ? "UTC" : x(e),
228
- o: () => (v() > 0 ? "-" : "+") + g(Math.floor(Math.abs(v()) / 60) * 100 + Math.abs(v()) % 60, 4),
229
- p: () => (v() > 0 ? "-" : "+") + g(Math.floor(Math.abs(v()) / 60), 2) + ":" + g(Math.floor(Math.abs(v()) % 60), 2),
215
+ ss: () => h(m()),
216
+ l: () => h(_(), 3),
217
+ L: () => h(Math.floor(_() / 10)),
218
+ t: () => u() < 12 ? g.timeNames[0] : g.timeNames[1],
219
+ tt: () => u() < 12 ? g.timeNames[2] : g.timeNames[3],
220
+ T: () => u() < 12 ? g.timeNames[4] : g.timeNames[5],
221
+ TT: () => u() < 12 ? g.timeNames[6] : g.timeNames[7],
222
+ Z: () => i ? "GMT" : r ? "UTC" : b(e),
223
+ o: () => (S() > 0 ? "-" : "+") + h(Math.floor(Math.abs(S()) / 60) * 100 + Math.abs(S()) % 60, 4),
224
+ p: () => (S() > 0 ? "-" : "+") + h(Math.floor(Math.abs(S()) / 60), 2) + ":" + h(Math.floor(Math.abs(S()) % 60), 2),
230
225
  S: () => [
231
226
  "th",
232
227
  "st",
@@ -234,12 +229,12 @@ function v(e, n = "dd.mm.yyyy", r, i) {
234
229
  "rd"
235
230
  ][o() % 10 > 3 ? 0 : (o() % 100 - o() % 10 != 10) * o() % 10],
236
231
  W: () => C(),
237
- WW: () => g(C()),
232
+ WW: () => h(C()),
238
233
  N: () => w()
239
234
  };
240
- return n.replace(p, (e) => e in T ? T[e]() : e.slice(1, e.length - 1));
235
+ return n.replace(f, (e) => e in T ? T[e]() : e.slice(1, e.length - 1));
241
236
  }
242
- var y = (e) => {
237
+ var v = (e) => {
243
238
  let t = new Date(e.getFullYear(), e.getMonth(), e.getDate());
244
239
  t.setDate(t.getDate() - (t.getDay() + 6) % 7 + 3);
245
240
  let n = new Date(t.getFullYear(), 0, 4);
@@ -248,10 +243,10 @@ var y = (e) => {
248
243
  t.setHours(t.getHours() - r);
249
244
  let i = (t - n) / 6048e5;
250
245
  return 1 + Math.floor(i);
251
- }, b = (e) => {
246
+ }, y = (e) => {
252
247
  let t = e.getDay();
253
248
  return t === 0 && (t = 7), t;
254
- }, x = (e) => (String(e).match(m) || [""]).pop().replace(h, "").replace(/GMT\+0000/g, "UTC"), S = ({ y: e, m: t, d: n, _: r, dayName: i, short: a = !1 }) => {
249
+ }, b = (e) => (String(e).match(p) || [""]).pop().replace(m, "").replace(/GMT\+0000/g, "UTC"), x = ({ y: e, m: t, d: n, _: r, dayName: i, short: a = !1 }) => {
255
250
  let o = /* @__PURE__ */ new Date(), s = /* @__PURE__ */ new Date();
256
251
  s.setDate(s[r + "Date"]() - 1);
257
252
  let c = /* @__PURE__ */ new Date();
@@ -259,28 +254,33 @@ var y = (e) => {
259
254
  };
260
255
  //#endregion
261
256
  //#region src/functions/checks/_is-nil.js
262
- function C(e) {
257
+ function S(e) {
263
258
  return e == null;
264
259
  }
265
260
  //#endregion
266
261
  //#region src/functions/checks/_is-object.js
267
- function w(e) {
268
- return !C(e) && typeof e == "object" && !a(e);
262
+ function C(e) {
263
+ return !S(e) && typeof e == "object" && !a(e);
269
264
  }
270
265
  //#endregion
271
266
  //#region src/functions/checks/_is-empty-object.js
272
- function T(e) {
273
- return w(e) && Reflect.ownKeys(e).every((t) => !Object.prototype.propertyIsEnumerable.call(e, t));
267
+ function w(e) {
268
+ return C(e) && Reflect.ownKeys(e).every((t) => !Object.prototype.propertyIsEnumerable.call(e, t));
274
269
  }
275
270
  //#endregion
276
271
  //#region src/functions/checks/_is-empty-string.js
277
- function E(e) {
272
+ function T(e) {
278
273
  return t(e) && e.trim().length === 0;
279
274
  }
280
275
  //#endregion
281
- //#region src/functions/checks/_is-negative-number.js
276
+ //#region src/functions/checks/_is-float.js
277
+ function E(e) {
278
+ return c(e) && !Number.isInteger(e);
279
+ }
280
+ //#endregion
281
+ //#region src/functions/checks/_is-integer.js
282
282
  function D(e) {
283
- return c(e) && e < 0;
283
+ return Number.isInteger(e);
284
284
  }
285
285
  //#endregion
286
286
  //#region src/functions/_kebab-case-to-title-case.js
@@ -344,4 +344,4 @@ function P(e, t = null) {
344
344
  return Math.round(n * r) / r;
345
345
  }
346
346
  //#endregion
347
- export { t as C, n as S, c as _, A as a, a as b, D as c, w as d, C as f, l as g, u as h, j as i, E as l, d as m, N as n, k as o, v as p, M as r, O as s, P as t, T as u, s as v, e as w, i as x, o as y };
347
+ export { t as C, n as S, c as _, A as a, a as b, D as c, w as d, C as f, l as g, u as h, j as i, E as l, _ as m, N as n, k as o, S as p, M as r, O as s, P as t, T as u, s as v, e as w, i as x, o as y };
package/dist/functions.js CHANGED
@@ -1 +1 @@
1
- export { w as average, S as camelCaseToTitleCase, x as convertHexToRgba, h as createCache, m as darkenHexColor, p as formatDate, b as isArray, y as isEmptyArray, u as isEmptyObject, l as isEmptyString, v as isFunction, c as isNegativeNumber, f as isNil, _ as isNumber, d as isObject, g as isPositiveNumber, C as isString, s as kebabCaseToTitleCase, o as median, a as request, i as riskReward, r as size, n as slugify, t as toNumber } from "./functions-huvj-bhb.js";
1
+ export { w as average, S as camelCaseToTitleCase, x as convertHexToRgba, g as createCache, h as darkenHexColor, m as formatDate, b as isArray, y as isEmptyArray, d as isEmptyObject, u as isEmptyString, l as isFloat, v as isFunction, c as isInteger, p as isNil, _ as isNumber, f as isObject, C as isString, s as kebabCaseToTitleCase, o as median, a as request, i as riskReward, r as size, n as slugify, t as toNumber } from "./functions-DkAbnk05.js";