melonykit 1.1.1 → 1.1.3
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 +1 @@
|
|
|
1
|
-
export { n as getClientSetting, i as routeTo, t as setClientSetting, r as useQuery } from "./browser-
|
|
1
|
+
export { n as getClientSetting, i as routeTo, t as setClientSetting, r as useQuery } from "./browser-Cr0Wr7Lc.js";
|
|
@@ -201,8 +201,13 @@ function v(e) {
|
|
|
201
201
|
return e == null ? 0 : Array.isArray(e) || typeof e == "string" ? e.length : typeof e == "object" || typeof e == "function" ? Object.keys(e).length : 0;
|
|
202
202
|
}
|
|
203
203
|
//#endregion
|
|
204
|
+
//#region src/functions/_slugify.js
|
|
205
|
+
function y(e) {
|
|
206
|
+
return typeof e == "string" ? e.trim().toLowerCase().replace(/ä/g, "ae").replace(/ö/g, "oe").replace(/ü/g, "ue").replace(/ß/g, "ss").replace(/æ/g, "ae").replace(/œ/g, "oe").replace(/ø/g, "o").normalize("NFD").replace(/\p{Diacritic}/gu, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") : "";
|
|
207
|
+
}
|
|
208
|
+
//#endregion
|
|
204
209
|
//#region src/functions/_to-number.js
|
|
205
|
-
function
|
|
210
|
+
function b(e, t = null) {
|
|
206
211
|
let n = typeof e == "number" ? e : typeof e == "string" && e.trim() !== "" ? Number(e) : NaN;
|
|
207
212
|
if (!Number.isFinite(n)) return null;
|
|
208
213
|
if (t == null) return n;
|
|
@@ -211,32 +216,32 @@ function y(e, t = null) {
|
|
|
211
216
|
}
|
|
212
217
|
//#endregion
|
|
213
218
|
//#region src/functions/checks/_is-array.js
|
|
214
|
-
function
|
|
219
|
+
function x(e) {
|
|
215
220
|
return Array.isArray(e);
|
|
216
221
|
}
|
|
217
222
|
//#endregion
|
|
218
223
|
//#region src/functions/checks/_is-empty-array.js
|
|
219
|
-
function
|
|
220
|
-
return
|
|
224
|
+
function S(e) {
|
|
225
|
+
return x(e) && e.length === 0;
|
|
221
226
|
}
|
|
222
227
|
//#endregion
|
|
223
228
|
//#region src/functions/checks/_is-function.js
|
|
224
|
-
function
|
|
229
|
+
function C(e) {
|
|
225
230
|
return typeof e == "function";
|
|
226
231
|
}
|
|
227
232
|
//#endregion
|
|
228
233
|
//#region src/functions/checks/_is-number.js
|
|
229
|
-
function
|
|
234
|
+
function w(e) {
|
|
230
235
|
return typeof e == "number" && Number.isFinite(e);
|
|
231
236
|
}
|
|
232
237
|
//#endregion
|
|
233
238
|
//#region src/functions/checks/_is-positive-number.js
|
|
234
|
-
function
|
|
235
|
-
return
|
|
239
|
+
function T(e) {
|
|
240
|
+
return w(e) && e > 0;
|
|
236
241
|
}
|
|
237
242
|
//#endregion
|
|
238
243
|
//#region src/functions/_create-cache.js
|
|
239
|
-
function
|
|
244
|
+
function E({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
|
|
240
245
|
let i = /* @__PURE__ */ new Map();
|
|
241
246
|
async function a(t, n) {
|
|
242
247
|
if (i.has(t)) return !1;
|
|
@@ -245,12 +250,12 @@ function T({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
|
|
|
245
250
|
...n,
|
|
246
251
|
createdAt: r,
|
|
247
252
|
lastUpdate: r
|
|
248
|
-
}),
|
|
253
|
+
}), C(e) && await e(t), !0;
|
|
249
254
|
}
|
|
250
255
|
async function o(e, n) {
|
|
251
256
|
if (!i.has(e) || typeof n != "function") return !1;
|
|
252
257
|
let r = i.get(e);
|
|
253
|
-
return await n(r), r.lastUpdate = Date.now(),
|
|
258
|
+
return await n(r), r.lastUpdate = Date.now(), C(t) && await t(e), !0;
|
|
254
259
|
}
|
|
255
260
|
function s(e) {
|
|
256
261
|
return i.get(e) ?? null;
|
|
@@ -267,10 +272,10 @@ function T({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
|
|
|
267
272
|
async function d(e) {
|
|
268
273
|
if (!i.has(e)) return !1;
|
|
269
274
|
let t = i.get(e);
|
|
270
|
-
return i.delete(e),
|
|
275
|
+
return i.delete(e), C(n) && await n(e, t), !0;
|
|
271
276
|
}
|
|
272
277
|
function f({ interval: e, checks: t, now: n = Date.now, setIntervalFn: r = setInterval } = {}) {
|
|
273
|
-
|
|
278
|
+
T(e) && x(t) && !S(t) && t.every((e) => C(e)) && C(n) && C(r) && r(async () => {
|
|
274
279
|
let e = n();
|
|
275
280
|
for (let [n, r] of i) t.some((t) => t(r, e)) && await d(n);
|
|
276
281
|
}, e)?.unref?.();
|
|
@@ -287,28 +292,28 @@ function T({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
|
|
|
287
292
|
}
|
|
288
293
|
//#endregion
|
|
289
294
|
//#region src/functions/checks/_is-nil.js
|
|
290
|
-
function
|
|
295
|
+
function D(e) {
|
|
291
296
|
return e == null;
|
|
292
297
|
}
|
|
293
298
|
//#endregion
|
|
294
299
|
//#region src/functions/checks/_is-object.js
|
|
295
|
-
function
|
|
296
|
-
return !
|
|
300
|
+
function O(e) {
|
|
301
|
+
return !D(e) && typeof e == "object" && !x(e);
|
|
297
302
|
}
|
|
298
303
|
//#endregion
|
|
299
304
|
//#region src/functions/checks/_is-empty-object.js
|
|
300
|
-
function
|
|
301
|
-
return
|
|
305
|
+
function k(e) {
|
|
306
|
+
return O(e) && Reflect.ownKeys(e).every((t) => !Object.prototype.propertyIsEnumerable.call(e, t));
|
|
302
307
|
}
|
|
303
308
|
//#endregion
|
|
304
309
|
//#region src/functions/checks/_is-empty-string.js
|
|
305
|
-
function
|
|
310
|
+
function A(e) {
|
|
306
311
|
return n(e) && e.trim().length === 0;
|
|
307
312
|
}
|
|
308
313
|
//#endregion
|
|
309
314
|
//#region src/functions/checks/_is-negative-number.js
|
|
310
|
-
function
|
|
311
|
-
return
|
|
315
|
+
function j(e) {
|
|
316
|
+
return w(e) && e < 0;
|
|
312
317
|
}
|
|
313
318
|
//#endregion
|
|
314
|
-
export {
|
|
319
|
+
export { d as _, D as a, n as b, w as c, x as d, b as f, g, _ as h, O as i, C as l, v as m, A as n, E as o, y as p, k as r, T as s, j as t, S as u, i as v, t as x, r as y };
|
package/dist/functions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { y as camelCaseToTitleCase, x as convertHexToRgba, o as createCache, v as darkenHexColor, _ as formatDate, d as isArray, u as isEmptyArray, r as isEmptyObject, n as isEmptyString, l as isFunction, t as isNegativeNumber, a as isNil, c as isNumber, i as isObject, s as isPositiveNumber, b as isString, g as kebabCaseToTitleCase, h as request, m as size, p as slugify, f as toNumber } from "./functions-CZylI2gQ.js";
|