melonykit 0.10.2 → 0.11.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.
package/dist/browser.js CHANGED
@@ -1,4 +1,4 @@
1
- import { r as e } from "./functions-ytrrWBDV.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,12 +26,14 @@ 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/_format-date.js
29
+ //#region src/functions/checks/_is-string.js
30
30
  function r(e) {
31
- return Object.prototype.toString.call(e) === "[object Date]" && !isNaN(e);
31
+ return typeof e == "string";
32
32
  }
33
+ //#endregion
34
+ //#region src/functions/_format-date.js
33
35
  function i(e) {
34
- return typeof e == "string";
36
+ return Object.prototype.toString.call(e) === "[object Date]" && !isNaN(e);
35
37
  }
36
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 = {
37
39
  dayNames: [
@@ -88,7 +90,7 @@ var a = /d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'
88
90
  ]
89
91
  };
90
92
  function u(e, t = "dd.mm.yyyy", n, o) {
91
- if (!r(e) || !i(t)) return "";
93
+ if (!i(e) || !r(t)) return "";
92
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 = {
93
95
  d: () => u(),
94
96
  dd: () => c(u()),
@@ -163,13 +165,8 @@ var d = (e) => {
163
165
  return c.setDate(c[r + "Date"]() + 1), o[r + "FullYear"]() === e && o[r + "Month"]() === t && o[r + "Date"]() === n ? a ? "Tdy" : "Today" : s[r + "FullYear"]() === e && s[r + "Month"]() === t && s[r + "Date"]() === n ? a ? "Ysd" : "Yesterday" : c[r + "FullYear"]() === e && c[r + "Month"]() === t && c[r + "Date"]() === n ? a ? "Tmw" : "Tomorrow" : i;
164
166
  };
165
167
  //#endregion
166
- //#region src/functions/_is-empty.js
167
- function h(e) {
168
- 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;
169
- }
170
- //#endregion
171
168
  //#region src/functions/_request.js
172
- async function g({ url: e, body: t, method: n = "POST", headers: r = {} } = {}) {
169
+ async function h({ url: e, body: t, method: n = "POST", headers: r = {} } = {}) {
173
170
  let i = n !== "GET" && t !== void 0 ? JSON.stringify(t) : void 0, a = await fetch(e, {
174
171
  method: n,
175
172
  headers: {
@@ -190,12 +187,12 @@ async function g({ url: e, body: t, method: n = "POST", headers: r = {} } = {})
190
187
  }
191
188
  //#endregion
192
189
  //#region src/functions/_size.js
193
- function _(e) {
190
+ function g(e) {
194
191
  return e == null ? 0 : Array.isArray(e) || typeof e == "string" ? e.length : typeof e == "object" || typeof e == "function" ? Object.keys(e).length : 0;
195
192
  }
196
193
  //#endregion
197
194
  //#region src/functions/_to-number.js
198
- function v(e, t = null) {
195
+ function _(e, t = null) {
199
196
  let n = typeof e == "number" ? e : typeof e == "string" && e.trim() !== "" ? Number(e) : NaN;
200
197
  if (!Number.isFinite(n)) return null;
201
198
  if (t == null) return n;
@@ -203,4 +200,59 @@ function v(e, t = null) {
203
200
  return Math.round(n * r) / r;
204
201
  }
205
202
  //#endregion
206
- export { u as a, h as i, _ as n, n as o, g as r, t as s, v as t };
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 { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./functions-ytrrWBDV.js";
2
- export { a as convertHexToRgba, r as darkenHexColor, e as formatDate, t as isEmpty, i as request, n as size, o 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 };