melonykit 0.16.1 → 0.16.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,2 +1,2 @@
|
|
|
1
|
-
import { i as e, n as t, r as n, t as r } from "./browser-
|
|
1
|
+
import { i as e, n as t, r as n, t as r } from "./browser-DEPpkjr9.js";
|
|
2
2
|
export { t as getClientSetting, e as routeTo, r as setClientSetting, n as useQuery };
|
|
@@ -165,8 +165,13 @@ var d = (e) => {
|
|
|
165
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;
|
|
166
166
|
};
|
|
167
167
|
//#endregion
|
|
168
|
+
//#region src/functions/_kebab-case-to-title-case.js
|
|
169
|
+
function h(e) {
|
|
170
|
+
return r(e) ? e.split("-").filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()).join(" ") : "";
|
|
171
|
+
}
|
|
172
|
+
//#endregion
|
|
168
173
|
//#region src/functions/_request.js
|
|
169
|
-
async function
|
|
174
|
+
async function g({ url: e, body: t, method: n = "POST", headers: r = {} } = {}) {
|
|
170
175
|
let i = n !== "GET" && t !== void 0 ? JSON.stringify(t) : void 0, a = await fetch(e, {
|
|
171
176
|
method: n,
|
|
172
177
|
headers: {
|
|
@@ -187,12 +192,12 @@ async function h({ url: e, body: t, method: n = "POST", headers: r = {} } = {})
|
|
|
187
192
|
}
|
|
188
193
|
//#endregion
|
|
189
194
|
//#region src/functions/_size.js
|
|
190
|
-
function
|
|
195
|
+
function _(e) {
|
|
191
196
|
return e == null ? 0 : Array.isArray(e) || typeof e == "string" ? e.length : typeof e == "object" || typeof e == "function" ? Object.keys(e).length : 0;
|
|
192
197
|
}
|
|
193
198
|
//#endregion
|
|
194
199
|
//#region src/functions/_to-number.js
|
|
195
|
-
function
|
|
200
|
+
function v(e, t = null) {
|
|
196
201
|
let n = typeof e == "number" ? e : typeof e == "string" && e.trim() !== "" ? Number(e) : NaN;
|
|
197
202
|
if (!Number.isFinite(n)) return null;
|
|
198
203
|
if (t == null) return n;
|
|
@@ -201,32 +206,32 @@ function _(e, t = null) {
|
|
|
201
206
|
}
|
|
202
207
|
//#endregion
|
|
203
208
|
//#region src/functions/checks/_is-array.js
|
|
204
|
-
function
|
|
209
|
+
function y(e) {
|
|
205
210
|
return Array.isArray(e);
|
|
206
211
|
}
|
|
207
212
|
//#endregion
|
|
208
213
|
//#region src/functions/checks/_is-empty-array.js
|
|
209
|
-
function
|
|
210
|
-
return
|
|
214
|
+
function b(e) {
|
|
215
|
+
return y(e) && e.length === 0;
|
|
211
216
|
}
|
|
212
217
|
//#endregion
|
|
213
218
|
//#region src/functions/checks/_is-function.js
|
|
214
|
-
function
|
|
219
|
+
function x(e) {
|
|
215
220
|
return typeof e == "function";
|
|
216
221
|
}
|
|
217
222
|
//#endregion
|
|
218
223
|
//#region src/functions/checks/_is-number.js
|
|
219
|
-
function
|
|
224
|
+
function S(e) {
|
|
220
225
|
return typeof e == "number" && Number.isFinite(e);
|
|
221
226
|
}
|
|
222
227
|
//#endregion
|
|
223
228
|
//#region src/functions/checks/_is-positive-number.js
|
|
224
|
-
function
|
|
225
|
-
return
|
|
229
|
+
function C(e) {
|
|
230
|
+
return S(e) && e > 0;
|
|
226
231
|
}
|
|
227
232
|
//#endregion
|
|
228
233
|
//#region src/functions/_create-cache.js
|
|
229
|
-
function
|
|
234
|
+
function w({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
|
|
230
235
|
let i = /* @__PURE__ */ new Map();
|
|
231
236
|
async function a(t, n) {
|
|
232
237
|
if (i.has(t)) return !1;
|
|
@@ -235,12 +240,12 @@ function C({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
|
|
|
235
240
|
...n,
|
|
236
241
|
createdAt: r,
|
|
237
242
|
lastUpdate: r
|
|
238
|
-
}),
|
|
243
|
+
}), x(e) && await e(t), !0;
|
|
239
244
|
}
|
|
240
245
|
async function o(e, n) {
|
|
241
246
|
if (!i.has(e) || typeof n != "function") return !1;
|
|
242
247
|
let r = i.get(e);
|
|
243
|
-
return await n(r), r.lastUpdate = Date.now(),
|
|
248
|
+
return await n(r), r.lastUpdate = Date.now(), x(t) && await t(e), !0;
|
|
244
249
|
}
|
|
245
250
|
function s(e) {
|
|
246
251
|
return i.get(e) ?? null;
|
|
@@ -257,10 +262,10 @@ function C({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
|
|
|
257
262
|
async function d(e) {
|
|
258
263
|
if (!i.has(e)) return !1;
|
|
259
264
|
let t = i.get(e);
|
|
260
|
-
return i.delete(e),
|
|
265
|
+
return i.delete(e), x(n) && await n(e, t), !0;
|
|
261
266
|
}
|
|
262
267
|
function f({ interval: e, checks: t, now: n = Date.now, setIntervalFn: r = setInterval } = {}) {
|
|
263
|
-
|
|
268
|
+
C(e) && y(t) && !b(t) && t.every((e) => x(e)) && x(n) && x(r) && r(async () => {
|
|
264
269
|
let e = n();
|
|
265
270
|
for (let [n, r] of i) t.some((t) => t(r, e)) && await d(n);
|
|
266
271
|
}, e)?.unref?.();
|
|
@@ -277,33 +282,33 @@ function C({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
|
|
|
277
282
|
}
|
|
278
283
|
//#endregion
|
|
279
284
|
//#region src/functions/checks/_is-nil.js
|
|
280
|
-
function
|
|
285
|
+
function T(e) {
|
|
281
286
|
return e == null;
|
|
282
287
|
}
|
|
283
288
|
//#endregion
|
|
284
289
|
//#region src/functions/checks/_is-object.js
|
|
285
|
-
function
|
|
286
|
-
return !
|
|
290
|
+
function E(e) {
|
|
291
|
+
return !T(e) && typeof e == "object" && !y(e);
|
|
287
292
|
}
|
|
288
293
|
//#endregion
|
|
289
294
|
//#region src/functions/checks/_is-empty-object.js
|
|
290
|
-
function
|
|
291
|
-
return
|
|
295
|
+
function D(e) {
|
|
296
|
+
return E(e) && Reflect.ownKeys(e).every((t) => !Object.prototype.propertyIsEnumerable.call(e, t));
|
|
292
297
|
}
|
|
293
298
|
//#endregion
|
|
294
299
|
//#region src/functions/checks/_is-empty-string.js
|
|
295
|
-
function
|
|
300
|
+
function O(e) {
|
|
296
301
|
return r(e) && e.trim().length === 0;
|
|
297
302
|
}
|
|
298
303
|
//#endregion
|
|
299
304
|
//#region src/functions/checks/_is-empty.js
|
|
300
|
-
function
|
|
305
|
+
function k(e) {
|
|
301
306
|
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;
|
|
302
307
|
}
|
|
303
308
|
//#endregion
|
|
304
309
|
//#region src/functions/checks/_is-negative-number.js
|
|
305
|
-
function
|
|
306
|
-
return
|
|
310
|
+
function A(e) {
|
|
311
|
+
return S(e) && e < 0;
|
|
307
312
|
}
|
|
308
313
|
//#endregion
|
|
309
|
-
export {
|
|
314
|
+
export { u as _, E as a, t as b, C as c, b as d, y as f, h as g, g as h, D as i, S as l, _ as m, k as n, T as o, v as p, O as r, w as s, A as t, x as u, r as v, n as y };
|
package/dist/functions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as e, a as t,
|
|
2
|
-
export {
|
|
1
|
+
import { _ as e, a as t, b as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as g, u as _, v, y } from "./functions-HFX7hCQR.js";
|
|
2
|
+
export { n as convertHexToRgba, h as createCache, y as darkenHexColor, e as formatDate, a as isArray, d as isEmpty, i as isEmptyArray, c as isEmptyObject, m as isEmptyString, _ as isFunction, g as isNegativeNumber, f as isNil, l as isNumber, t as isObject, r as isPositiveNumber, v as isString, o as kebabCaseToTitleCase, s as request, u as size, p as toNumber };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as e, t } from "./browser-
|
|
2
|
-
import { r as n,
|
|
1
|
+
import { n as e, t } from "./browser-DEPpkjr9.js";
|
|
2
|
+
import { r as n, y as r } from "./functions-HFX7hCQR.js";
|
|
3
3
|
import { useSignal as i } from "@preact/signals";
|
|
4
4
|
import { useEffect as a, useId as o, useRef as s, useState as c } from "preact/hooks";
|
|
5
5
|
import { Fragment as l, jsx as u, jsxs as d } from "preact/jsx-runtime";
|