@amekusa/util.js 1.2.1 → 2.1.0

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,8 +1,202 @@
1
- 'use strict';
1
+ this.amekusa=this.amekusa||{};this.amekusa.util=(function(exports){'use strict';/*!
2
+ * === @amekusa/util.js/gen === *
3
+ * MIT License
4
+ *
5
+ * Copyright (c) 2024 Satoshi Soma
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in all
15
+ * copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ * SOFTWARE.
24
+ */
25
+
26
+ /**
27
+ * Coerces the given value into an array.
28
+ * @param {any} x
29
+ * @return {any[]}
30
+ */
31
+ function arr(x) {
32
+ return Array.isArray(x) ? x : [x];
33
+ }
34
+
35
+ /**
36
+ * Checks the type of the given value matches with one of the given types.
37
+ * If a constructor is given to `types`, it checks if `x` is `instanceof` the constructor.
38
+ * @param {any} x
39
+ * @param {...string|function} types - Type or Constructor
40
+ * @return {boolean}
41
+ */
42
+ function is(x, ...types) {
43
+ let t = typeof x;
44
+ for (let i = 0; i < types.length; i++) {
45
+ let v = types[i];
46
+ if (typeof v == 'string') {
47
+ if (v == 'array') {
48
+ if (Array.isArray(x)) return true;
49
+ } else if (t == v) return true;
50
+ } else if (x instanceof v) return true;
51
+ }
52
+ return false;
53
+ }
54
+
55
+ /**
56
+ * Returns whether the given value can be considered as "empty".
57
+ * @param {any} x
58
+ * @return {boolean}
59
+ */
60
+ function isEmpty(x) {
61
+ if (Array.isArray(x)) return x.length == 0;
62
+ switch (typeof x) {
63
+ case 'string':
64
+ return !x;
65
+ case 'object':
66
+ for (let _ in x) return false;
67
+ return true;
68
+ case 'undefined':
69
+ return true;
70
+ }
71
+ return false;
72
+ }
73
+
74
+ /**
75
+ * Returns whether the given value can be considered as "empty" or "falsy".
76
+ * Faster than {@link isEmpty}.
77
+ * @param {any} x
78
+ * @return {boolean}
79
+ */
80
+ function isEmptyOrFalsy(x) {
81
+ if (!x) return true;
82
+ if (Array.isArray(x)) return x.length == 0;
83
+ if (typeof x == 'object') {
84
+ for (let _ in x) return false;
85
+ }
86
+ return false;
87
+ }
88
+
89
+ /**
90
+ * @function isEmptyOrFalsey
91
+ * Alias of {@link isEmptyOrFalsy}.
92
+ */
93
+ const isEmptyOrFalsey = isEmptyOrFalsy;
94
+
95
+ /**
96
+ * Removes "empty" values from the given object or array.
97
+ * @param {object|any[]} x
98
+ * @param {number} recurse - Recursion limit
99
+ * @return {object|any[]} modified `x`
100
+ */
101
+ function clean(x, recurse = 8) {
102
+ if (recurse) {
103
+ if (Array.isArray(x)) {
104
+ let r = [];
105
+ for (let i = 0; i < x.length; i++) {
106
+ let v = clean(x[i], recurse - 1);
107
+ if (!isEmpty(v)) r.push(v);
108
+ }
109
+ return r;
110
+ }
111
+ if (typeof x == 'object') {
112
+ let r = {};
113
+ for (let k in x) {
114
+ let v = clean(x[k], recurse - 1);
115
+ if (!isEmpty(v)) r[k] = v;
116
+ }
117
+ return r;
118
+ }
119
+ }
120
+ return x;
121
+ }
2
122
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
123
+ /**
124
+ * Merges the 2nd object into the 1st object recursively (deep-merge). The 1st object will be modified.
125
+ * @param {object} x - The 1st object
126
+ * @param {object} y - The 2nd object
127
+ * @param {object} [opts] - Options
128
+ * @param {number} opts.recurse=8 - Recurstion limit. Negative number means unlimited
129
+ * @param {boolean|string} opts.mergeArrays - How to merge arrays
130
+ * - `true`: merge x with y
131
+ * - 'push': push y elements to x
132
+ * - 'concat': concat x and y
133
+ * - other: replace x with y
134
+ * @return {object} The 1st object
135
+ */
136
+ function merge(x, y, opts = {}) {
137
+ if (!('recurse' in opts)) opts.recurse = 8;
138
+ switch (Array.isArray(x) + Array.isArray(y)) {
139
+ case 0: // no array
140
+ if (opts.recurse && x && y && typeof x == 'object' && typeof y == 'object') {
141
+ opts.recurse--;
142
+ for (let k in y) x[k] = merge(x[k], y[k], opts);
143
+ opts.recurse++;
144
+ return x;
145
+ }
146
+ case 1: // 1 array
147
+ return y;
148
+ }
149
+ // 2 arrays
150
+ switch (opts.mergeArrays) {
151
+ case true:
152
+ for (let i = 0; i < y.length; i++) {
153
+ if (!x.includes(y[i])) x.push(y[i]);
154
+ }
155
+ return x;
156
+ case 'push':
157
+ x.push(...y);
158
+ return x;
159
+ case 'concat':
160
+ return x.concat(y);
161
+ }
162
+ return y;
163
+ }
164
+
165
+ /**
166
+ * Gets a property from the given object by the given string path.
167
+ * @param {object} obj - Object to traverse
168
+ * @param {string} path - Property names separated with '.'
169
+ * @return {any} value of the found property, or undefined if it's not found
170
+ */
171
+ function dig(obj, path) {
172
+ path = path.split('.');
173
+ for (let i = 0; i < path.length; i++) {
174
+ let p = path[i];
175
+ if (typeof obj == 'object' && p in obj) obj = obj[p];
176
+ else return undefined;
177
+ }
178
+ return obj;
179
+ }
4
180
 
5
- /*!
181
+ /**
182
+ * Substitutes the properties of the given data for the references in the given string.
183
+ * @param {string} str - String that contains references to the properties
184
+ * @param {object} data - Object that contains properties to replace the references
185
+ * @param {object} [opts] - Options
186
+ * @return {string} a modified `str`
187
+ */
188
+ function subst(str, data, opts = {}) {
189
+ let {
190
+ modifier = null,
191
+ start = '{{',
192
+ end = '}}',
193
+ } = opts;
194
+ let ref = new RegExp(start + '\\s*([-.\\w]+)\\s*' + end, 'g');
195
+ return str.replaceAll(ref, modifier
196
+ ? (_, m1) => (modifier(dig(data, m1), m1, data) || '')
197
+ : (_, m1) => (dig(data, m1) || '')
198
+ );
199
+ }var gen=/*#__PURE__*/Object.freeze({__proto__:null,arr:arr,clean:clean,dig:dig,is:is,isEmpty:isEmpty,isEmptyOrFalsey:isEmptyOrFalsey,isEmptyOrFalsy:isEmptyOrFalsy,merge:merge,subst:subst});/*!
6
200
  * === @amekusa/util.js/web === *
7
201
  * MIT License
8
202
  *
@@ -51,15 +245,7 @@ const escHTML_find = new RegExp(`["'<>]|(&(?!${Object.values(escHTML_map).join('
51
245
  // - This avoids double-escaping '&' symbols
52
246
  // - Regex negative match: (?!word)
53
247
 
54
- const escHTML_replace = found => `&${escHTML_map[found]};`;
55
-
56
- var web = /*#__PURE__*/Object.freeze({
57
- __proto__: null,
58
- escHTML: escHTML,
59
- escHtml: escHtml
60
- });
61
-
62
- /*!
248
+ const escHTML_replace = found => `&${escHTML_map[found]};`;var web=/*#__PURE__*/Object.freeze({__proto__:null,escHTML:escHTML,escHtml:escHtml});/*!
63
249
  * === @amekusa/util.js/time === *
64
250
  * MIT License
65
251
  *
@@ -229,179 +415,4 @@ function hms(d, format = null) {
229
415
  */
230
416
  function iso9075(d) {
231
417
  return ymd(d, '-') + ' ' + hms(d, ':');
232
- }
233
-
234
- var time = /*#__PURE__*/Object.freeze({
235
- __proto__: null,
236
- addTime: addTime,
237
- ceil: ceil,
238
- date: date,
239
- floor: floor,
240
- hms: hms,
241
- iso9075: iso9075,
242
- localize: localize,
243
- ms: ms,
244
- quantize: quantize,
245
- round: round,
246
- ymd: ymd
247
- });
248
-
249
- /*!
250
- * === @amekusa/util.js === *
251
- * MIT License
252
- *
253
- * Copyright (c) 2024 Satoshi Soma
254
- *
255
- * Permission is hereby granted, free of charge, to any person obtaining a copy
256
- * of this software and associated documentation files (the "Software"), to deal
257
- * in the Software without restriction, including without limitation the rights
258
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
259
- * copies of the Software, and to permit persons to whom the Software is
260
- * furnished to do so, subject to the following conditions:
261
- *
262
- * The above copyright notice and this permission notice shall be included in all
263
- * copies or substantial portions of the Software.
264
- *
265
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
266
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
267
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
268
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
269
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
270
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
271
- * SOFTWARE.
272
- */
273
-
274
- /**
275
- * Coerces the given value into an array.
276
- * @param {any} x
277
- * @return {any[]}
278
- */
279
- function arr(x) {
280
- return Array.isArray(x) ? x : [x];
281
- }
282
-
283
- /**
284
- * Alias of `Array.isArray`.
285
- * @return {boolean}
286
- */
287
- const isArray = Array.isArray;
288
-
289
- /**
290
- * Returns whether the given value is a number or a string.
291
- * @param {any} x
292
- * @return {boolean}
293
- */
294
- function isNumOrStr(x) {
295
- switch (typeof x) {
296
- case 'number':
297
- case 'string':
298
- return true;
299
- }
300
- return false;
301
- }
302
-
303
- /**
304
- * Returns whether the given value can be considered as "empty".
305
- * @param {any} x
306
- * @return {boolean}
307
- */
308
- function isEmpty(x) {
309
- if (Array.isArray(x)) return x.length == 0;
310
- switch (typeof x) {
311
- case 'string':
312
- return !x;
313
- case 'object':
314
- if (x === null) return true;
315
- for (let i in x) return false;
316
- case 'undefined':
317
- return true;
318
- }
319
- return false;
320
- }
321
-
322
- /**
323
- * Removes "empty" values from the given object or array.
324
- * @param {object|any[]} x
325
- * @param {number} recurse - Recursion limit
326
- * @return {object|any[]} modified `x`
327
- */
328
- function clean(x, recurse = 8) {
329
- if (recurse) {
330
- if (Array.isArray(x)) {
331
- let r = [];
332
- for (let i = 0; i < x.length; i++) {
333
- let I = clean(x[i], recurse - 1);
334
- if (!isEmpty(I)) r.push(I);
335
- }
336
- return r;
337
- }
338
- if (typeof x == 'object') {
339
- let r = {};
340
- for (let k in x) {
341
- let v = clean(x[k], recurse - 1);
342
- if (!isEmpty(v)) r[k] = v;
343
- }
344
- return r;
345
- }
346
- }
347
- return x;
348
- }
349
-
350
- /**
351
- * Merges the 2nd object into the 1st object recursively (deep-merge). The 1st object will be modified.
352
- * @param {object} x - The 1st object
353
- * @param {object} y - The 2nd object
354
- * @param {object} [opts] - Options
355
- * @param {number} opts.recurse=8 - Recurstion limit. Negative number means unlimited
356
- * @param {boolean|string} opts.mergeArrays - How to merge arrays
357
- * - `true`: merge x with y
358
- * - 'push': push y elements to x
359
- * - 'concat': concat x and y
360
- * - other: replace x with y
361
- * @return {object} The 1st object
362
- */
363
- function merge(x, y, opts = {}) {
364
- if (!('recurse' in opts)) opts.recurse = 8;
365
- switch (Array.isArray(x) + Array.isArray(y)) {
366
- case 0: // no array
367
- if (opts.recurse && x && y && typeof x == 'object' && typeof y == 'object') {
368
- opts.recurse--;
369
- for (let k in y) x[k] = merge(x[k], y[k], opts);
370
- opts.recurse++;
371
- return x;
372
- }
373
- case 1: // 1 array
374
- return y;
375
- }
376
- // 2 arrays
377
- switch (opts.mergeArrays) {
378
- case true:
379
- for (let i = 0; i < y.length; i++) {
380
- if (!x.includes(y[i])) x.push(y[i]);
381
- }
382
- return x;
383
- case 'push':
384
- x.push(...y);
385
- return x;
386
- case 'concat':
387
- return x.concat(y);
388
- }
389
- return y;
390
- }
391
-
392
- var main = {
393
- arr,
394
- isEmpty,
395
- clean,
396
- merge,
397
- };
398
-
399
- exports.arr = arr;
400
- exports.clean = clean;
401
- exports.default = main;
402
- exports.isArray = isArray;
403
- exports.isEmpty = isEmpty;
404
- exports.isNumOrStr = isNumOrStr;
405
- exports.merge = merge;
406
- exports.time = time;
407
- exports.web = web;
418
+ }var time=/*#__PURE__*/Object.freeze({__proto__:null,addTime:addTime,ceil:ceil,date:date,floor:floor,hms:hms,iso9075:iso9075,localize:localize,ms:ms,quantize:quantize,round:round,ymd:ymd});exports.arr=arr;exports.clean=clean;exports.dig=dig;exports.gen=gen;exports.is=is;exports.isEmpty=isEmpty;exports.isEmptyOrFalsey=isEmptyOrFalsey;exports.isEmptyOrFalsy=isEmptyOrFalsy;exports.merge=merge;exports.subst=subst;exports.time=time;exports.web=web;return exports;})({});
@@ -0,0 +1,73 @@
1
+ this.amekusa=this.amekusa||{},this.amekusa.util=function(e){"use strict";
2
+ /*!
3
+ * === @amekusa/util.js/gen === *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2024 Satoshi Soma
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ */function t(e){return Array.isArray(e)?e:[e]}function r(e,...t){let r=typeof e;for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i){if("array"==i){if(Array.isArray(e))return!0}else if(r==i)return!0}else if(e instanceof i)return!0}return!1}function n(e){if(Array.isArray(e))return 0==e.length;switch(typeof e){case"string":return!e;case"object":for(let t in e)return!1;return!0;case"undefined":return!0}return!1}function i(e){if(!e)return!0;if(Array.isArray(e))return 0==e.length;if("object"==typeof e)for(let t in e)return!1;return!1}const u=i;function o(e,t=8){if(t){if(Array.isArray(e)){let r=[];for(let i=0;i<e.length;i++){let u=o(e[i],t-1);n(u)||r.push(u)}return r}if("object"==typeof e){let r={};for(let i in e){let u=o(e[i],t-1);n(u)||(r[i]=u)}return r}}return e}function s(e,t,r={}){switch("recurse"in r||(r.recurse=8),Array.isArray(e)+Array.isArray(t)){case 0:if(r.recurse&&e&&t&&"object"==typeof e&&"object"==typeof t){r.recurse--;for(let n in t)e[n]=s(e[n],t[n],r);return r.recurse++,e}case 1:return t}switch(r.mergeArrays){case!0:for(let r=0;r<t.length;r++)e.includes(t[r])||e.push(t[r]);return e;case"push":return e.push(...t),e;case"concat":return e.concat(t)}return t}function a(e,t){t=t.split(".");for(let r=0;r<t.length;r++){let n=t[r];if("object"!=typeof e||!(n in e))return;e=e[n]}return e}function c(e,t,r={}){let{modifier:n=null,start:i="{{",end:u="}}"}=r,o=new RegExp(i+"\\s*([-.\\w]+)\\s*"+u,"g");return e.replaceAll(o,n?(e,r)=>n(a(t,r),r,t)||"":(e,r)=>a(t,r)||"")}var f=Object.freeze({__proto__:null,arr:t,clean:o,dig:a,is:r,isEmpty:n,isEmptyOrFalsey:u,isEmptyOrFalsy:i,merge:s,subst:c});
26
+ /*!
27
+ * === @amekusa/util.js/web === *
28
+ * MIT License
29
+ *
30
+ * Copyright (c) 2024 Satoshi Soma
31
+ *
32
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
33
+ * of this software and associated documentation files (the "Software"), to deal
34
+ * in the Software without restriction, including without limitation the rights
35
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
36
+ * copies of the Software, and to permit persons to whom the Software is
37
+ * furnished to do so, subject to the following conditions:
38
+ *
39
+ * The above copyright notice and this permission notice shall be included in all
40
+ * copies or substantial portions of the Software.
41
+ *
42
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
43
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
44
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
45
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
46
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
47
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
48
+ * SOFTWARE.
49
+ */function l(e){return`${e}`.replace(p,m)}const g=l,y={"&":"amp",'"':"quot","'":"apos","<":"lt",">":"gt"},p=new RegExp(`["'<>]|(&(?!${Object.values(y).join("|")};))`,"g"),m=e=>`&${y[e]};`;var h=Object.freeze({__proto__:null,escHTML:l,escHtml:g});
50
+ /*!
51
+ * === @amekusa/util.js/time === *
52
+ * MIT License
53
+ *
54
+ * Copyright (c) 2024 Satoshi Soma
55
+ *
56
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
57
+ * of this software and associated documentation files (the "Software"), to deal
58
+ * in the Software without restriction, including without limitation the rights
59
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
60
+ * copies of the Software, and to permit persons to whom the Software is
61
+ * furnished to do so, subject to the following conditions:
62
+ *
63
+ * The above copyright notice and this permission notice shall be included in all
64
+ * copies or substantial portions of the Software.
65
+ *
66
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
67
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
68
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
69
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
70
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
71
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
72
+ * SOFTWARE.
73
+ */function d(e,t,r="round"){return e.setTime(Math[r](e.getTime()/t)*t),e}function b(e,t=null){let r=[e.getFullYear().toString(),(e.getMonth()+1).toString().padStart(2,"0"),e.getDate().toString().padStart(2,"0")];switch(typeof t){case"string":return r.join(t);case"object":return t?(t.Y=r[0],t.M=r[1],t.D=r[2],t):r;default:if(!t)return r;throw"invalid type"}}function A(e,t=null){let r=[e.getHours().toString().padStart(2,"0"),e.getMinutes().toString().padStart(2,"0"),e.getSeconds().toString().padStart(2,"0")];switch(typeof t){case"string":return r.join(t);case"object":return t?(t.h=r[0],t.m=r[1],t.s=r[2],t):r;default:if(!t)return r;throw"invalid type"}}var j=Object.freeze({__proto__:null,addTime:function(e,t){return e.setTime(e.getTime()+t),e},ceil:function(e,t){return d(e,t,"ceil")},date:function(...e){return e.length&&e[0]?e[0]instanceof Date?e[0]:new Date(...e):new Date},floor:function(e,t){return d(e,t,"floor")},hms:A,iso9075:function(e){return b(e,"-")+" "+A(e,":")},localize:function(e){return e.setTime(e.getTime()-6e4*e.getTimezoneOffset()),e},ms:function(...e){if(!e.length||!e[0])return Date.now();let t=e[0];return"number"==typeof t?t:t instanceof Date?t.getTime():new Date(...e).getTime()},quantize:d,round:function(e,t){return d(e,t,"round")},ymd:b});return e.arr=t,e.clean=o,e.dig=a,e.gen=f,e.is=r,e.isEmpty=n,e.isEmptyOrFalsey=u,e.isEmptyOrFalsy=i,e.merge=s,e.subst=c,e.time=j,e.web=h,e}({});