rattail 0.0.10 → 0.0.11
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/lib/index.cjs +524 -324
- package/lib/index.d.cts +160 -65
- package/lib/index.d.ts +160 -65
- package/lib/index.js +522 -324
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -65,6 +65,8 @@ __export(src_exports, {
|
|
|
65
65
|
debounce: () => debounce,
|
|
66
66
|
delay: () => delay,
|
|
67
67
|
doubleRaf: () => doubleRaf,
|
|
68
|
+
ensurePrefix: () => ensurePrefix,
|
|
69
|
+
ensureSuffix: () => ensureSuffix,
|
|
68
70
|
find: () => find,
|
|
69
71
|
genNumberKey: () => genNumberKey,
|
|
70
72
|
genStringKey: () => genStringKey,
|
|
@@ -155,62 +157,148 @@ __export(src_exports, {
|
|
|
155
157
|
});
|
|
156
158
|
module.exports = __toCommonJS(src_exports);
|
|
157
159
|
|
|
158
|
-
// src/
|
|
160
|
+
// src/array/at.ts
|
|
161
|
+
function at(arr, index) {
|
|
162
|
+
if (!arr.length) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (index < 0) {
|
|
166
|
+
index += arr.length;
|
|
167
|
+
}
|
|
168
|
+
return arr[index];
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// src/number/clamp.ts
|
|
172
|
+
function clamp(num, min, max) {
|
|
173
|
+
return Math.min(max, Math.max(min, num));
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// src/number/clampArrayRange.ts
|
|
177
|
+
function clampArrayRange(index, arr) {
|
|
178
|
+
return clamp(index, 0, arr.length - 1);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// src/number/delay.ts
|
|
182
|
+
function delay(time) {
|
|
183
|
+
return new Promise((resolve) => {
|
|
184
|
+
setTimeout(resolve, time);
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// src/number/randomNumber.ts
|
|
189
|
+
function randomNumber(min = 0, max = 100) {
|
|
190
|
+
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// src/number/times.ts
|
|
194
|
+
function times(num, fn) {
|
|
195
|
+
return Array.from({ length: num }, (_, index) => fn(index));
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// src/general/inBrowser.ts
|
|
199
|
+
function inBrowser() {
|
|
200
|
+
return typeof window !== "undefined";
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// src/general/getGlobalThis.ts
|
|
204
|
+
function getGlobalThis() {
|
|
205
|
+
if (typeof globalThis !== "undefined") {
|
|
206
|
+
return globalThis;
|
|
207
|
+
}
|
|
208
|
+
if (inBrowser()) {
|
|
209
|
+
return window;
|
|
210
|
+
}
|
|
211
|
+
return typeof global !== "undefined" ? global : self;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// src/general/hasOwn.ts
|
|
215
|
+
var { hasOwnProperty } = Object.prototype;
|
|
216
|
+
function hasOwn(val, key3) {
|
|
217
|
+
return hasOwnProperty.call(val, key3);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// src/general/inMobile.ts
|
|
221
|
+
function inMobile() {
|
|
222
|
+
return inBrowser() && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// src/general/isArray.ts
|
|
226
|
+
function isArray(val) {
|
|
227
|
+
return Array.isArray(val);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// src/general/toTypeString.ts
|
|
159
231
|
var objectToString = Object.prototype.toString;
|
|
160
232
|
function toTypeString(value) {
|
|
161
233
|
return objectToString.call(value);
|
|
162
234
|
}
|
|
163
|
-
|
|
164
|
-
|
|
235
|
+
|
|
236
|
+
// src/general/toRawType.ts
|
|
237
|
+
function toRawType(value) {
|
|
238
|
+
return toTypeString(value).slice(8, -1);
|
|
165
239
|
}
|
|
240
|
+
|
|
241
|
+
// src/general/isArrayBuffer.ts
|
|
242
|
+
function isArrayBuffer(val) {
|
|
243
|
+
return toRawType(val) === "ArrayBuffer";
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// src/general/isBoolean.ts
|
|
166
247
|
function isBoolean(val) {
|
|
167
248
|
return typeof val === "boolean";
|
|
168
249
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
return typeof val === "symbol";
|
|
250
|
+
|
|
251
|
+
// src/general/isDataView.ts
|
|
252
|
+
function isDataView(val) {
|
|
253
|
+
return toRawType(val) === "DataView";
|
|
174
254
|
}
|
|
175
|
-
|
|
176
|
-
|
|
255
|
+
|
|
256
|
+
// src/general/isDate.ts
|
|
257
|
+
function isDate(val) {
|
|
258
|
+
return toRawType(val) === "Date";
|
|
177
259
|
}
|
|
260
|
+
|
|
261
|
+
// src/general/isDOMException.ts
|
|
178
262
|
function isDOMException(val) {
|
|
179
263
|
return toRawType(val) === "DOMException";
|
|
180
264
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
return toRawType(val) === "Object";
|
|
186
|
-
}
|
|
187
|
-
function isObject(val) {
|
|
188
|
-
return typeof val === "object" && val !== null;
|
|
189
|
-
}
|
|
190
|
-
function isPromise(val) {
|
|
191
|
-
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
|
265
|
+
|
|
266
|
+
// src/general/isEmpty.ts
|
|
267
|
+
function isEmpty(val) {
|
|
268
|
+
return val === void 0 || val === null || val === "" || isArray(val) && !val.length;
|
|
192
269
|
}
|
|
270
|
+
|
|
271
|
+
// src/general/isMap.ts
|
|
193
272
|
function isMap(val) {
|
|
194
273
|
return toRawType(val) === "Map";
|
|
195
274
|
}
|
|
275
|
+
|
|
276
|
+
// src/general/isPlainObject.ts
|
|
277
|
+
function isPlainObject(val) {
|
|
278
|
+
return toRawType(val) === "Object";
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// src/general/isSet.ts
|
|
196
282
|
function isSet(val) {
|
|
197
283
|
return toRawType(val) === "Set";
|
|
198
284
|
}
|
|
199
|
-
|
|
200
|
-
|
|
285
|
+
|
|
286
|
+
// src/general/isObject.ts
|
|
287
|
+
function isObject(val) {
|
|
288
|
+
return typeof val === "object" && val !== null;
|
|
201
289
|
}
|
|
290
|
+
|
|
291
|
+
// src/general/isRegExp.ts
|
|
202
292
|
function isRegExp(val) {
|
|
203
293
|
return toRawType(val) === "RegExp";
|
|
204
294
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
return toRawType(val) === "WeakSet";
|
|
210
|
-
}
|
|
211
|
-
function isArrayBuffer(val) {
|
|
212
|
-
return toRawType(val) === "ArrayBuffer";
|
|
295
|
+
|
|
296
|
+
// src/general/isError.ts
|
|
297
|
+
function isError(val) {
|
|
298
|
+
return toRawType(val) === "Error";
|
|
213
299
|
}
|
|
300
|
+
|
|
301
|
+
// src/general/isTypedArray.ts
|
|
214
302
|
function isTypedArray(val) {
|
|
215
303
|
return [
|
|
216
304
|
"Int8Array",
|
|
@@ -226,55 +314,8 @@ function isTypedArray(val) {
|
|
|
226
314
|
"BigUint64Array"
|
|
227
315
|
].includes(toRawType(val));
|
|
228
316
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}
|
|
232
|
-
function toRawType(value) {
|
|
233
|
-
return toTypeString(value).slice(8, -1);
|
|
234
|
-
}
|
|
235
|
-
function isFunction(val) {
|
|
236
|
-
return typeof val === "function";
|
|
237
|
-
}
|
|
238
|
-
function isArray(val) {
|
|
239
|
-
return Array.isArray(val);
|
|
240
|
-
}
|
|
241
|
-
function isNullish(val) {
|
|
242
|
-
return val == null;
|
|
243
|
-
}
|
|
244
|
-
function isTruthy(v) {
|
|
245
|
-
return Boolean(v);
|
|
246
|
-
}
|
|
247
|
-
function isEmpty(val) {
|
|
248
|
-
return val === void 0 || val === null || val === "" || isArray(val) && !val.length;
|
|
249
|
-
}
|
|
250
|
-
function isWindow(val) {
|
|
251
|
-
return val === window;
|
|
252
|
-
}
|
|
253
|
-
function supportTouch() {
|
|
254
|
-
return inBrowser() && "ontouchstart" in window;
|
|
255
|
-
}
|
|
256
|
-
function inBrowser() {
|
|
257
|
-
return typeof window !== "undefined";
|
|
258
|
-
}
|
|
259
|
-
function inMobile() {
|
|
260
|
-
return inBrowser() && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
261
|
-
}
|
|
262
|
-
var { hasOwnProperty } = Object.prototype;
|
|
263
|
-
function hasOwn(val, key3) {
|
|
264
|
-
return hasOwnProperty.call(val, key3);
|
|
265
|
-
}
|
|
266
|
-
function getGlobalThis() {
|
|
267
|
-
if (typeof globalThis !== "undefined") {
|
|
268
|
-
return globalThis;
|
|
269
|
-
}
|
|
270
|
-
if (inBrowser()) {
|
|
271
|
-
return window;
|
|
272
|
-
}
|
|
273
|
-
return typeof global !== "undefined" ? global : self;
|
|
274
|
-
}
|
|
275
|
-
function isNonEmptyArray(val) {
|
|
276
|
-
return isArray(val) && !!val.length;
|
|
277
|
-
}
|
|
317
|
+
|
|
318
|
+
// src/general/isEqualWith.ts
|
|
278
319
|
function isEqualWith(value, other, fn) {
|
|
279
320
|
const valueStack = /* @__PURE__ */ new WeakMap();
|
|
280
321
|
const otherStack = /* @__PURE__ */ new WeakMap();
|
|
@@ -368,11 +409,78 @@ function isEqualWith(value, other, fn) {
|
|
|
368
409
|
}
|
|
369
410
|
return baseIsEqual(value, other, valueStack, otherStack);
|
|
370
411
|
}
|
|
412
|
+
|
|
413
|
+
// src/general/isEqual.ts
|
|
371
414
|
function isEqual(value, other) {
|
|
372
415
|
return isEqualWith(value, other, () => void 0);
|
|
373
416
|
}
|
|
374
417
|
|
|
375
|
-
// src/
|
|
418
|
+
// src/general/isFunction.ts
|
|
419
|
+
function isFunction(val) {
|
|
420
|
+
return typeof val === "function";
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// src/general/isNonEmptyArray.ts
|
|
424
|
+
function isNonEmptyArray(val) {
|
|
425
|
+
return isArray(val) && !!val.length;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
// src/general/isNullish.ts
|
|
429
|
+
function isNullish(val) {
|
|
430
|
+
return val == null;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
// src/general/isNumber.ts
|
|
434
|
+
function isNumber(val) {
|
|
435
|
+
return typeof val === "number";
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
// src/general/isString.ts
|
|
439
|
+
function isString(val) {
|
|
440
|
+
return typeof val === "string";
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
// src/general/isNumeric.ts
|
|
444
|
+
function isNumeric(val) {
|
|
445
|
+
return isNumber(val) || isString(val) && /^[-+]?\d+$/.test(val);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
// src/general/isPromise.ts
|
|
449
|
+
function isPromise(val) {
|
|
450
|
+
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
// src/general/isSymbol.ts
|
|
454
|
+
function isSymbol(val) {
|
|
455
|
+
return typeof val === "symbol";
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
// src/general/isTruthy.ts
|
|
459
|
+
function isTruthy(v) {
|
|
460
|
+
return Boolean(v);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
// src/general/isWeakMap.ts
|
|
464
|
+
function isWeakMap(val) {
|
|
465
|
+
return toRawType(val) === "WeakMap";
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
// src/general/isWeakSet.ts
|
|
469
|
+
function isWeakSet(val) {
|
|
470
|
+
return toRawType(val) === "WeakSet";
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
// src/general/isWindow.ts
|
|
474
|
+
function isWindow(val) {
|
|
475
|
+
return val === window;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// src/general/supportTouch.ts
|
|
479
|
+
function supportTouch() {
|
|
480
|
+
return inBrowser() && "ontouchstart" in window;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
// src/number/toNumber.ts
|
|
376
484
|
function toNumber(val) {
|
|
377
485
|
if (val == null) {
|
|
378
486
|
return 0;
|
|
@@ -387,32 +495,47 @@ function toNumber(val) {
|
|
|
387
495
|
}
|
|
388
496
|
return val;
|
|
389
497
|
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
}
|
|
393
|
-
function clampArrayRange(index, arr) {
|
|
394
|
-
return clamp(index, 0, arr.length - 1);
|
|
395
|
-
}
|
|
498
|
+
|
|
499
|
+
// src/number/genNumberKey.ts
|
|
396
500
|
var key = 0;
|
|
397
501
|
function genNumberKey() {
|
|
398
502
|
return key++;
|
|
399
503
|
}
|
|
400
|
-
|
|
401
|
-
|
|
504
|
+
|
|
505
|
+
// src/array/chunk.ts
|
|
506
|
+
function chunk(arr, size = 1) {
|
|
507
|
+
size = clamp(size, 1, arr.length);
|
|
508
|
+
const result = [];
|
|
509
|
+
let index = 0;
|
|
510
|
+
while (index < arr.length) {
|
|
511
|
+
result.push(arr.slice(index, index + size));
|
|
512
|
+
index += size;
|
|
513
|
+
}
|
|
514
|
+
return result;
|
|
402
515
|
}
|
|
403
|
-
|
|
404
|
-
|
|
516
|
+
|
|
517
|
+
// src/array/removeItem.ts
|
|
518
|
+
function removeItem(arr, item) {
|
|
519
|
+
if (arr.length) {
|
|
520
|
+
const index = arr.indexOf(item);
|
|
521
|
+
if (index > -1) {
|
|
522
|
+
return arr.splice(index, 1);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
405
525
|
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
526
|
+
|
|
527
|
+
// src/array/toggleItem.ts
|
|
528
|
+
function toggleItem(arr, item) {
|
|
529
|
+
arr.includes(item) ? removeItem(arr, item) : arr.push(item);
|
|
530
|
+
return arr;
|
|
410
531
|
}
|
|
411
532
|
|
|
412
|
-
// src/array.ts
|
|
533
|
+
// src/array/uniq.ts
|
|
413
534
|
function uniq(arr) {
|
|
414
535
|
return [...new Set(arr)];
|
|
415
536
|
}
|
|
537
|
+
|
|
538
|
+
// src/array/uniqBy.ts
|
|
416
539
|
function uniqBy(arr, fn) {
|
|
417
540
|
return arr.reduce((ret, i) => {
|
|
418
541
|
const index = ret.findIndex((j) => fn(i, j));
|
|
@@ -422,25 +545,8 @@ function uniqBy(arr, fn) {
|
|
|
422
545
|
return ret;
|
|
423
546
|
}, []);
|
|
424
547
|
}
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
}
|
|
428
|
-
function removeItem(arr, item) {
|
|
429
|
-
if (arr.length) {
|
|
430
|
-
const index = arr.indexOf(item);
|
|
431
|
-
if (index > -1) {
|
|
432
|
-
return arr.splice(index, 1);
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
function toggleItem(arr, item) {
|
|
437
|
-
arr.includes(item) ? removeItem(arr, item) : arr.push(item);
|
|
438
|
-
return arr;
|
|
439
|
-
}
|
|
440
|
-
function removeArrayBlank(arr) {
|
|
441
|
-
return arr.filter((item) => item != null);
|
|
442
|
-
}
|
|
443
|
-
var removeArrayEmpty = (arr) => arr.filter((item) => item != null && item !== "");
|
|
548
|
+
|
|
549
|
+
// src/array/find.ts
|
|
444
550
|
function find(arr, fn, from = "start") {
|
|
445
551
|
let i = from === "start" ? 0 : arr.length - 1;
|
|
446
552
|
while (arr.length > 0 && i >= 0 && i <= arr.length - 1) {
|
|
@@ -452,15 +558,8 @@ function find(arr, fn, from = "start") {
|
|
|
452
558
|
}
|
|
453
559
|
return [null, -1];
|
|
454
560
|
}
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
return;
|
|
458
|
-
}
|
|
459
|
-
if (index < 0) {
|
|
460
|
-
index += arr.length;
|
|
461
|
-
}
|
|
462
|
-
return arr[index];
|
|
463
|
-
}
|
|
561
|
+
|
|
562
|
+
// src/array/shuffle.ts
|
|
464
563
|
function shuffle(arr) {
|
|
465
564
|
for (let i = arr.length - 1; i > 0; i--) {
|
|
466
565
|
const j = Math.floor(Math.random() * (i + 1));
|
|
@@ -468,46 +567,108 @@ function shuffle(arr) {
|
|
|
468
567
|
}
|
|
469
568
|
return arr;
|
|
470
569
|
}
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
while (index < arr.length) {
|
|
476
|
-
result.push(arr.slice(index, index + size));
|
|
477
|
-
index += size;
|
|
478
|
-
}
|
|
479
|
-
return result;
|
|
570
|
+
|
|
571
|
+
// src/array/removeArrayBlank.ts
|
|
572
|
+
function removeArrayBlank(arr) {
|
|
573
|
+
return arr.filter((item) => item != null);
|
|
480
574
|
}
|
|
481
575
|
|
|
482
|
-
// src/
|
|
483
|
-
function
|
|
484
|
-
return
|
|
576
|
+
// src/array/removeArrayEmpty.ts
|
|
577
|
+
function removeArrayEmpty(arr) {
|
|
578
|
+
return arr.filter((item) => item != null && item !== "");
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// src/array/normalizeToArray.ts
|
|
582
|
+
function normalizeToArray(value) {
|
|
583
|
+
return isArray(value) ? value : [value];
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
// src/util/cancelAnimationFrame.ts
|
|
587
|
+
function cancelAnimationFrame(handle) {
|
|
588
|
+
const globalThis2 = getGlobalThis();
|
|
589
|
+
globalThis2.cancelAnimationFrame ? globalThis2.cancelAnimationFrame(handle) : globalThis2.clearTimeout(handle);
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
// src/util/classes.ts
|
|
593
|
+
function classes(...classes2) {
|
|
594
|
+
return classes2.map((className) => {
|
|
595
|
+
if (isArray(className)) {
|
|
596
|
+
const [condition, truthy, falsy = null] = className;
|
|
597
|
+
return condition ? truthy : falsy;
|
|
598
|
+
}
|
|
599
|
+
return className;
|
|
600
|
+
});
|
|
485
601
|
}
|
|
602
|
+
|
|
603
|
+
// src/util/copyText.ts
|
|
604
|
+
function copyText(value) {
|
|
605
|
+
if (!value) {
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
const textArea = document.createElement("textarea");
|
|
609
|
+
textArea.value = value;
|
|
610
|
+
textArea.style.position = "fixed";
|
|
611
|
+
textArea.style.opacity = "0";
|
|
612
|
+
document.body.appendChild(textArea);
|
|
613
|
+
textArea.select();
|
|
614
|
+
document.execCommand("copy");
|
|
615
|
+
document.body.removeChild(textArea);
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
// src/string/camelize.ts
|
|
486
619
|
function camelize(s) {
|
|
487
620
|
s = s.replace(/-(\w)/g, (_, p) => p.toUpperCase());
|
|
488
621
|
return s.replace(s.charAt(0), s.charAt(0).toLowerCase());
|
|
489
622
|
}
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
623
|
+
|
|
624
|
+
// src/string/ensurePrefix.ts
|
|
625
|
+
function ensurePrefix(s, prefix) {
|
|
626
|
+
return s.startsWith(prefix) ? s : prefix + s;
|
|
493
627
|
}
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
}
|
|
499
|
-
return path.replace(/\\/g, "/");
|
|
628
|
+
|
|
629
|
+
// src/string/ensureSuffix.ts
|
|
630
|
+
function ensureSuffix(s, suffix) {
|
|
631
|
+
return s.endsWith(suffix) ? s : s + suffix;
|
|
500
632
|
}
|
|
633
|
+
|
|
634
|
+
// src/string/genStringKey.ts
|
|
501
635
|
var key2 = 0;
|
|
502
636
|
function genStringKey() {
|
|
503
637
|
return `generated-key-${key2++}`;
|
|
504
638
|
}
|
|
505
|
-
|
|
506
|
-
|
|
639
|
+
|
|
640
|
+
// src/string/kebabCase.ts
|
|
641
|
+
function kebabCase(s) {
|
|
642
|
+
const ret = s.replace(/([A-Z])/g, " $1").trim();
|
|
643
|
+
return ret.split(" ").join("-").toLowerCase();
|
|
507
644
|
}
|
|
645
|
+
|
|
646
|
+
// src/string/pascalCase.ts
|
|
647
|
+
function pascalCase(s) {
|
|
648
|
+
return camelize(s).replace(s.charAt(0), s.charAt(0).toUpperCase());
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
// src/string/lowerFirst.ts
|
|
508
652
|
function lowerFirst(s) {
|
|
509
653
|
return s.charAt(0).toLowerCase() + s.slice(1);
|
|
510
654
|
}
|
|
655
|
+
|
|
656
|
+
// src/string/upperFirst.ts
|
|
657
|
+
function upperFirst(s) {
|
|
658
|
+
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
// src/string/randomColor.ts
|
|
662
|
+
function randomColor() {
|
|
663
|
+
const letters = "0123456789abcdef";
|
|
664
|
+
let color = "#";
|
|
665
|
+
for (let i = 0; i < 6; i++) {
|
|
666
|
+
color += letters[Math.floor(Math.random() * 16)];
|
|
667
|
+
}
|
|
668
|
+
return color;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
// src/string/randomString.ts
|
|
511
672
|
function randomString(length = 10) {
|
|
512
673
|
let str = baseRandomString();
|
|
513
674
|
while (str.length < length) {
|
|
@@ -518,29 +679,44 @@ function randomString(length = 10) {
|
|
|
518
679
|
}
|
|
519
680
|
return str.slice(0, length);
|
|
520
681
|
}
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
682
|
+
|
|
683
|
+
// src/string/slash.ts
|
|
684
|
+
function slash(path) {
|
|
685
|
+
const isExtendedLengthPath = path.startsWith("\\\\?\\");
|
|
686
|
+
if (isExtendedLengthPath) {
|
|
687
|
+
return path;
|
|
526
688
|
}
|
|
527
|
-
return
|
|
689
|
+
return path.replace(/\\/g, "/");
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
// src/util/createNamespaceFn.ts
|
|
693
|
+
function createNamespaceFn(namespace) {
|
|
694
|
+
return (name) => {
|
|
695
|
+
const componentName = `${namespace}-${name}`;
|
|
696
|
+
const createBEM = (suffix) => {
|
|
697
|
+
if (!suffix) {
|
|
698
|
+
return componentName;
|
|
699
|
+
}
|
|
700
|
+
if (suffix[0] === "$") {
|
|
701
|
+
return suffix.replace("$", namespace);
|
|
702
|
+
}
|
|
703
|
+
return suffix.startsWith("--") ? `${componentName}${suffix}` : `${componentName}__${suffix}`;
|
|
704
|
+
};
|
|
705
|
+
return {
|
|
706
|
+
name: pascalCase(componentName),
|
|
707
|
+
n: createBEM,
|
|
708
|
+
classes
|
|
709
|
+
};
|
|
710
|
+
};
|
|
528
711
|
}
|
|
529
712
|
|
|
530
|
-
// src/util.ts
|
|
713
|
+
// src/util/requestAnimationFrame.ts
|
|
531
714
|
function requestAnimationFrame(fn) {
|
|
532
715
|
const globalThis2 = getGlobalThis();
|
|
533
716
|
return globalThis2.requestAnimationFrame ? globalThis2.requestAnimationFrame(fn) : globalThis2.setTimeout(fn);
|
|
534
717
|
}
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
globalThis2.cancelAnimationFrame ? globalThis2.cancelAnimationFrame(handle) : globalThis2.clearTimeout(handle);
|
|
538
|
-
}
|
|
539
|
-
function raf() {
|
|
540
|
-
return new Promise((resolve) => {
|
|
541
|
-
requestAnimationFrame(resolve);
|
|
542
|
-
});
|
|
543
|
-
}
|
|
718
|
+
|
|
719
|
+
// src/util/doubleRaf.ts
|
|
544
720
|
function doubleRaf() {
|
|
545
721
|
return new Promise((resolve) => {
|
|
546
722
|
requestAnimationFrame(() => {
|
|
@@ -548,36 +724,13 @@ function doubleRaf() {
|
|
|
548
724
|
});
|
|
549
725
|
});
|
|
550
726
|
}
|
|
727
|
+
|
|
728
|
+
// src/util/getStyle.ts
|
|
551
729
|
function getStyle(element) {
|
|
552
730
|
return window.getComputedStyle(element);
|
|
553
731
|
}
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
const width = element.innerWidth;
|
|
557
|
-
const height = element.innerHeight;
|
|
558
|
-
const rect = {
|
|
559
|
-
x: 0,
|
|
560
|
-
y: 0,
|
|
561
|
-
top: 0,
|
|
562
|
-
left: 0,
|
|
563
|
-
right: width,
|
|
564
|
-
bottom: height,
|
|
565
|
-
width,
|
|
566
|
-
height
|
|
567
|
-
};
|
|
568
|
-
return __spreadProps(__spreadValues({}, rect), {
|
|
569
|
-
toJSON: () => rect
|
|
570
|
-
});
|
|
571
|
-
}
|
|
572
|
-
return element.getBoundingClientRect();
|
|
573
|
-
}
|
|
574
|
-
function inViewport(element) {
|
|
575
|
-
const { top, bottom, left, right } = getRect(element);
|
|
576
|
-
const { width, height } = getRect(window);
|
|
577
|
-
const xInViewport = left <= width && right >= 0;
|
|
578
|
-
const yInViewport = top <= height && bottom >= 0;
|
|
579
|
-
return xInViewport && yInViewport;
|
|
580
|
-
}
|
|
732
|
+
|
|
733
|
+
// src/util/getParentScroller.ts
|
|
581
734
|
function getParentScroller(el) {
|
|
582
735
|
let element = el;
|
|
583
736
|
while (element) {
|
|
@@ -596,6 +749,8 @@ function getParentScroller(el) {
|
|
|
596
749
|
}
|
|
597
750
|
return window;
|
|
598
751
|
}
|
|
752
|
+
|
|
753
|
+
// src/util/getAllParentScroller.ts
|
|
599
754
|
function getAllParentScroller(el) {
|
|
600
755
|
const allParentScroller = [];
|
|
601
756
|
let element = el;
|
|
@@ -603,60 +758,73 @@ function getAllParentScroller(el) {
|
|
|
603
758
|
element = getParentScroller(element);
|
|
604
759
|
allParentScroller.push(element);
|
|
605
760
|
}
|
|
606
|
-
return allParentScroller;
|
|
761
|
+
return allParentScroller;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
// src/util/getRect.ts
|
|
765
|
+
function getRect(element) {
|
|
766
|
+
if (isWindow(element)) {
|
|
767
|
+
const width = element.innerWidth;
|
|
768
|
+
const height = element.innerHeight;
|
|
769
|
+
const rect = {
|
|
770
|
+
x: 0,
|
|
771
|
+
y: 0,
|
|
772
|
+
top: 0,
|
|
773
|
+
left: 0,
|
|
774
|
+
right: width,
|
|
775
|
+
bottom: height,
|
|
776
|
+
width,
|
|
777
|
+
height
|
|
778
|
+
};
|
|
779
|
+
return __spreadProps(__spreadValues({}, rect), {
|
|
780
|
+
toJSON: () => rect
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
return element.getBoundingClientRect();
|
|
607
784
|
}
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
785
|
+
|
|
786
|
+
// src/util/getScrollLeft.ts
|
|
787
|
+
function getScrollLeft(element) {
|
|
788
|
+
const left = "scrollLeft" in element ? element.scrollLeft : element.scrollX;
|
|
789
|
+
return Math.max(left, 0);
|
|
613
790
|
}
|
|
791
|
+
|
|
792
|
+
// src/util/getScrollTop.ts
|
|
614
793
|
function getScrollTop(element) {
|
|
615
794
|
const top = "scrollTop" in element ? element.scrollTop : element.scrollY;
|
|
616
795
|
return Math.max(top, 0);
|
|
617
796
|
}
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
return void 0;
|
|
627
|
-
}
|
|
797
|
+
|
|
798
|
+
// src/util/inViewport.ts
|
|
799
|
+
function inViewport(element) {
|
|
800
|
+
const { top, bottom, left, right } = getRect(element);
|
|
801
|
+
const { width, height } = getRect(window);
|
|
802
|
+
const xInViewport = left <= width && right >= 0;
|
|
803
|
+
const yInViewport = top <= height && bottom >= 0;
|
|
804
|
+
return xInViewport && yInViewport;
|
|
628
805
|
}
|
|
806
|
+
|
|
807
|
+
// src/util/prettyJSONObject.ts
|
|
629
808
|
function prettyJSONObject(jsonObject) {
|
|
630
809
|
return JSON.stringify(jsonObject, null, 2);
|
|
631
810
|
}
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
});
|
|
811
|
+
|
|
812
|
+
// src/util/preventDefault.ts
|
|
813
|
+
function preventDefault(event) {
|
|
814
|
+
if (event.cancelable === false) {
|
|
815
|
+
return;
|
|
816
|
+
}
|
|
817
|
+
event.preventDefault();
|
|
640
818
|
}
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
}
|
|
648
|
-
if (suffix[0] === "$") {
|
|
649
|
-
return suffix.replace("$", namespace);
|
|
650
|
-
}
|
|
651
|
-
return suffix.startsWith("--") ? `${componentName}${suffix}` : `${componentName}__${suffix}`;
|
|
652
|
-
};
|
|
653
|
-
return {
|
|
654
|
-
name: pascalCase(componentName),
|
|
655
|
-
n: createBEM,
|
|
656
|
-
classes
|
|
657
|
-
};
|
|
658
|
-
};
|
|
819
|
+
|
|
820
|
+
// src/util/raf.ts
|
|
821
|
+
function raf() {
|
|
822
|
+
return new Promise((resolve) => {
|
|
823
|
+
requestAnimationFrame(resolve);
|
|
824
|
+
});
|
|
659
825
|
}
|
|
826
|
+
|
|
827
|
+
// src/util/storage.ts
|
|
660
828
|
function createStorage(storage) {
|
|
661
829
|
return __spreadProps(__spreadValues({}, storage), {
|
|
662
830
|
set(key3, value) {
|
|
@@ -681,23 +849,43 @@ function createStorage(storage) {
|
|
|
681
849
|
}
|
|
682
850
|
});
|
|
683
851
|
}
|
|
684
|
-
var sessionStorage = createStorage(
|
|
685
|
-
var localStorage = createStorage(
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
document.execCommand("copy");
|
|
695
|
-
document.body.removeChild(textArea);
|
|
852
|
+
var sessionStorage = createStorage(getGlobalThis().sessionStorage);
|
|
853
|
+
var localStorage = createStorage(getGlobalThis().localStorage);
|
|
854
|
+
|
|
855
|
+
// src/util/tryParseJSON.ts
|
|
856
|
+
function tryParseJSON(json) {
|
|
857
|
+
try {
|
|
858
|
+
return JSON.parse(json);
|
|
859
|
+
} catch (e) {
|
|
860
|
+
return void 0;
|
|
861
|
+
}
|
|
696
862
|
}
|
|
697
863
|
|
|
698
|
-
// src/function.ts
|
|
699
|
-
function
|
|
864
|
+
// src/function/call.ts
|
|
865
|
+
function call(fn, ...args) {
|
|
866
|
+
if (isArray(fn)) {
|
|
867
|
+
return fn.map((f) => f(...args));
|
|
868
|
+
}
|
|
869
|
+
if (fn) {
|
|
870
|
+
return fn(...args);
|
|
871
|
+
}
|
|
700
872
|
}
|
|
873
|
+
|
|
874
|
+
// src/function/once.ts
|
|
875
|
+
function once(fn) {
|
|
876
|
+
let called = false;
|
|
877
|
+
let result;
|
|
878
|
+
return function(...args) {
|
|
879
|
+
if (called) {
|
|
880
|
+
return result;
|
|
881
|
+
}
|
|
882
|
+
called = true;
|
|
883
|
+
result = fn.apply(this, args);
|
|
884
|
+
return result;
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
// src/function/debounce.ts
|
|
701
889
|
function debounce(fn, delay2 = 0) {
|
|
702
890
|
let timer;
|
|
703
891
|
return function(...args) {
|
|
@@ -709,6 +897,8 @@ function debounce(fn, delay2 = 0) {
|
|
|
709
897
|
}, delay2);
|
|
710
898
|
};
|
|
711
899
|
}
|
|
900
|
+
|
|
901
|
+
// src/function/throttle.ts
|
|
712
902
|
function throttle(fn, delay2 = 200) {
|
|
713
903
|
let timer;
|
|
714
904
|
let start = 0;
|
|
@@ -731,58 +921,12 @@ function throttle(fn, delay2 = 200) {
|
|
|
731
921
|
}
|
|
732
922
|
};
|
|
733
923
|
}
|
|
734
|
-
function call(fn, ...args) {
|
|
735
|
-
if (isArray(fn)) {
|
|
736
|
-
return fn.map((f) => f(...args));
|
|
737
|
-
}
|
|
738
|
-
if (fn) {
|
|
739
|
-
return fn(...args);
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
function once(fn) {
|
|
743
|
-
let called = false;
|
|
744
|
-
let result;
|
|
745
|
-
return function(...args) {
|
|
746
|
-
if (called) {
|
|
747
|
-
return result;
|
|
748
|
-
}
|
|
749
|
-
called = true;
|
|
750
|
-
result = fn.apply(this, args);
|
|
751
|
-
return result;
|
|
752
|
-
};
|
|
753
|
-
}
|
|
754
924
|
|
|
755
|
-
// src/
|
|
756
|
-
function
|
|
757
|
-
function baseMerge(target, src) {
|
|
758
|
-
for (const key3 in src) {
|
|
759
|
-
if (hasOwn(src, key3)) {
|
|
760
|
-
const srcValue = src[key3];
|
|
761
|
-
const targetValue = target[key3];
|
|
762
|
-
const customResult = fn(targetValue, srcValue, key3, object, source);
|
|
763
|
-
if (customResult !== void 0) {
|
|
764
|
-
target[key3] = customResult;
|
|
765
|
-
} else if (isObject(srcValue)) {
|
|
766
|
-
if (isObject(targetValue)) {
|
|
767
|
-
target[key3] = baseMerge(targetValue, srcValue);
|
|
768
|
-
} else {
|
|
769
|
-
target[key3] = baseMerge(isArray(srcValue) ? [] : {}, srcValue);
|
|
770
|
-
}
|
|
771
|
-
} else {
|
|
772
|
-
target[key3] = srcValue;
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
|
-
return target;
|
|
777
|
-
}
|
|
778
|
-
return baseMerge(object, source);
|
|
779
|
-
}
|
|
780
|
-
function merge(object, source) {
|
|
781
|
-
return mergeWith(object, source, () => void 0);
|
|
782
|
-
}
|
|
783
|
-
function cloneDeep(value) {
|
|
784
|
-
return cloneDeepWith(value, () => void 0);
|
|
925
|
+
// src/function/NOOP.ts
|
|
926
|
+
function NOOP() {
|
|
785
927
|
}
|
|
928
|
+
|
|
929
|
+
// src/collection/cloneDeepWith.ts
|
|
786
930
|
function cloneDeepWith(value, fn) {
|
|
787
931
|
const cache = /* @__PURE__ */ new WeakMap();
|
|
788
932
|
function baseCloneDeep(value2, cache2) {
|
|
@@ -863,66 +1007,102 @@ function cloneDeepWith(value, fn) {
|
|
|
863
1007
|
return baseCloneDeep(value, cache);
|
|
864
1008
|
}
|
|
865
1009
|
|
|
866
|
-
// src/
|
|
867
|
-
function
|
|
1010
|
+
// src/collection/cloneDeep.ts
|
|
1011
|
+
function cloneDeep(value) {
|
|
1012
|
+
return cloneDeepWith(value, () => void 0);
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
// src/collection/mergeWith.ts
|
|
1016
|
+
function mergeWith(object, source, fn) {
|
|
1017
|
+
function baseMerge(target, src) {
|
|
1018
|
+
for (const key3 in src) {
|
|
1019
|
+
if (hasOwn(src, key3)) {
|
|
1020
|
+
const srcValue = src[key3];
|
|
1021
|
+
const targetValue = target[key3];
|
|
1022
|
+
const customResult = fn(targetValue, srcValue, key3, object, source);
|
|
1023
|
+
if (customResult !== void 0) {
|
|
1024
|
+
target[key3] = customResult;
|
|
1025
|
+
} else if (isObject(srcValue)) {
|
|
1026
|
+
if (isObject(targetValue)) {
|
|
1027
|
+
target[key3] = baseMerge(targetValue, srcValue);
|
|
1028
|
+
} else {
|
|
1029
|
+
target[key3] = baseMerge(isArray(srcValue) ? [] : {}, srcValue);
|
|
1030
|
+
}
|
|
1031
|
+
} else {
|
|
1032
|
+
target[key3] = srcValue;
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
return target;
|
|
1037
|
+
}
|
|
1038
|
+
return baseMerge(object, source);
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
// src/collection/merge.ts
|
|
1042
|
+
function merge(object, source) {
|
|
1043
|
+
return mergeWith(object, source, () => void 0);
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
// src/file/toArrayBuffer.ts
|
|
1047
|
+
function toArrayBuffer(file) {
|
|
868
1048
|
return new Promise((resolve) => {
|
|
869
1049
|
const fileReader = new FileReader();
|
|
870
1050
|
fileReader.onload = () => {
|
|
871
1051
|
resolve(fileReader.result);
|
|
872
1052
|
};
|
|
873
|
-
fileReader.
|
|
1053
|
+
fileReader.readAsArrayBuffer(file);
|
|
874
1054
|
});
|
|
875
1055
|
}
|
|
876
|
-
|
|
1056
|
+
|
|
1057
|
+
// src/file/toDataURL.ts
|
|
1058
|
+
function toDataURL(file) {
|
|
877
1059
|
return new Promise((resolve) => {
|
|
878
1060
|
const fileReader = new FileReader();
|
|
879
1061
|
fileReader.onload = () => {
|
|
880
1062
|
resolve(fileReader.result);
|
|
881
1063
|
};
|
|
882
|
-
fileReader.
|
|
1064
|
+
fileReader.readAsDataURL(file);
|
|
883
1065
|
});
|
|
884
1066
|
}
|
|
885
|
-
|
|
1067
|
+
|
|
1068
|
+
// src/file/toText.ts
|
|
1069
|
+
function toText(file) {
|
|
886
1070
|
return new Promise((resolve) => {
|
|
887
1071
|
const fileReader = new FileReader();
|
|
888
1072
|
fileReader.onload = () => {
|
|
889
1073
|
resolve(fileReader.result);
|
|
890
1074
|
};
|
|
891
|
-
fileReader.
|
|
1075
|
+
fileReader.readAsText(file);
|
|
892
1076
|
});
|
|
893
1077
|
}
|
|
894
1078
|
|
|
895
|
-
// src/math.ts
|
|
896
|
-
function sum(arr) {
|
|
897
|
-
return arr.reduce((ret, val) => ret + val, 0);
|
|
898
|
-
}
|
|
899
|
-
function sumBy(arr, fn) {
|
|
900
|
-
return arr.reduce((ret, val) => ret + fn(val), 0);
|
|
901
|
-
}
|
|
902
|
-
function minBy(arr, fn) {
|
|
903
|
-
if (!arr.length) {
|
|
904
|
-
return;
|
|
905
|
-
}
|
|
906
|
-
return arr.reduce((result, item) => fn(result) < fn(item) ? result : item, arr[0]);
|
|
907
|
-
}
|
|
1079
|
+
// src/math/maxBy.ts
|
|
908
1080
|
function maxBy(arr, fn) {
|
|
909
1081
|
if (!arr.length) {
|
|
910
1082
|
return;
|
|
911
1083
|
}
|
|
912
1084
|
return arr.reduce((result, item) => fn(result) > fn(item) ? result : item, arr[0]);
|
|
913
1085
|
}
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
function meanBy(arr, fn) {
|
|
918
|
-
return sumBy(arr, fn) / arr.length;
|
|
919
|
-
}
|
|
920
|
-
function sample(arr) {
|
|
1086
|
+
|
|
1087
|
+
// src/math/minBy.ts
|
|
1088
|
+
function minBy(arr, fn) {
|
|
921
1089
|
if (!arr.length) {
|
|
922
1090
|
return;
|
|
923
1091
|
}
|
|
924
|
-
return arr
|
|
1092
|
+
return arr.reduce((result, item) => fn(result) < fn(item) ? result : item, arr[0]);
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
// src/math/sum.ts
|
|
1096
|
+
function sum(arr) {
|
|
1097
|
+
return arr.reduce((ret, val) => ret + val, 0);
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
// src/math/sumBy.ts
|
|
1101
|
+
function sumBy(arr, fn) {
|
|
1102
|
+
return arr.reduce((ret, val) => ret + fn(val), 0);
|
|
925
1103
|
}
|
|
1104
|
+
|
|
1105
|
+
// src/math/sumHash.ts
|
|
926
1106
|
function sumHash(value) {
|
|
927
1107
|
function sum2(hash, value2) {
|
|
928
1108
|
for (let i = 0; i < value2.length; i++) {
|
|
@@ -958,6 +1138,24 @@ function sumHash(value) {
|
|
|
958
1138
|
return baseSumHash(0, value, "", []).toString(16).padStart(8, "0");
|
|
959
1139
|
}
|
|
960
1140
|
|
|
1141
|
+
// src/math/mean.ts
|
|
1142
|
+
function mean(arr) {
|
|
1143
|
+
return sum(arr) / arr.length;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
// src/math/meanBy.ts
|
|
1147
|
+
function meanBy(arr, fn) {
|
|
1148
|
+
return sumBy(arr, fn) / arr.length;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
// src/math/sample.ts
|
|
1152
|
+
function sample(arr) {
|
|
1153
|
+
if (!arr.length) {
|
|
1154
|
+
return;
|
|
1155
|
+
}
|
|
1156
|
+
return arr[randomNumber(0, arr.length - 1)];
|
|
1157
|
+
}
|
|
1158
|
+
|
|
961
1159
|
// src/index.ts
|
|
962
1160
|
__reExport(src_exports, require("mitt"), module.exports);
|
|
963
1161
|
var import_mitt = __toESM(require("mitt"), 1);
|
|
@@ -980,6 +1178,8 @@ var import_mitt = __toESM(require("mitt"), 1);
|
|
|
980
1178
|
debounce,
|
|
981
1179
|
delay,
|
|
982
1180
|
doubleRaf,
|
|
1181
|
+
ensurePrefix,
|
|
1182
|
+
ensureSuffix,
|
|
983
1183
|
find,
|
|
984
1184
|
genNumberKey,
|
|
985
1185
|
genStringKey,
|