melonykit 0.11.0 → 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 +1 -1
- package/dist/{functions-P-iB52B8.js → functions-lglYN2Ig.js} +112 -107
- package/dist/functions.js +2 -2
- package/dist/index.js +657 -457
- package/dist/server/_imports.js +7 -3
- package/package.json +4 -4
package/dist/browser.js
CHANGED
|
@@ -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
|
|
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
|
|
35
|
+
function i(e) {
|
|
86
36
|
return Object.prototype.toString.call(e) === "[object Date]" && !isNaN(e);
|
|
87
37
|
}
|
|
88
|
-
var
|
|
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
|
|
143
|
-
if (!
|
|
144
|
-
let
|
|
145
|
-
d: () =>
|
|
146
|
-
dd: () =>
|
|
147
|
-
ddd: () =>
|
|
148
|
-
DDD: () =>
|
|
149
|
-
y:
|
|
150
|
-
m:
|
|
151
|
-
d:
|
|
152
|
-
_:
|
|
153
|
-
dayName:
|
|
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: () =>
|
|
157
|
-
DDDD: () =>
|
|
158
|
-
y:
|
|
159
|
-
m:
|
|
160
|
-
d:
|
|
161
|
-
_:
|
|
162
|
-
dayName:
|
|
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: () =>
|
|
165
|
-
mm: () =>
|
|
166
|
-
mmm: () =>
|
|
167
|
-
mmmm: () =>
|
|
168
|
-
yy: () => String(
|
|
169
|
-
yyyy: () =>
|
|
170
|
-
h: () =>
|
|
171
|
-
hh: () => v(
|
|
172
|
-
H: () =>
|
|
173
|
-
HH: () => v(
|
|
174
|
-
M: () =>
|
|
175
|
-
MM: () =>
|
|
176
|
-
s: () =>
|
|
177
|
-
ss: () =>
|
|
178
|
-
l: () =>
|
|
179
|
-
L: () =>
|
|
180
|
-
t: () =>
|
|
181
|
-
tt: () =>
|
|
182
|
-
T: () =>
|
|
183
|
-
TT: () =>
|
|
184
|
-
Z: () =>
|
|
185
|
-
o: () => (
|
|
186
|
-
p: () => (
|
|
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
|
-
][
|
|
193
|
-
W: () =>
|
|
194
|
-
WW: () =>
|
|
195
|
-
N: () =>
|
|
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(
|
|
147
|
+
return t.replace(a, (e) => e in T ? T[e]() : e.slice(1, e.length - 1));
|
|
198
148
|
}
|
|
199
|
-
var
|
|
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
|
-
},
|
|
158
|
+
}, f = (e) => {
|
|
209
159
|
let t = e.getDay();
|
|
210
160
|
return t === 0 && (t = 7), t;
|
|
211
|
-
},
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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-
|
|
2
|
-
export {
|
|
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 };
|