@react-hive/honey-utils 3.13.0 → 3.14.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.
@@ -12,7 +12,7 @@ __webpack_require__.r(__webpack_exports__);
12
12
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13
13
  /* harmony export */ getFocusableHtmlElements: () => (/* binding */ getFocusableHtmlElements)
14
14
  /* harmony export */ });
15
- /* harmony import */ var _is_html_element_focusable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-html-element-focusable */ "./src/a11y/focus/is-html-element-focusable.ts");
15
+ /* harmony import */ var _a11y__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ~/a11y */ "./src/a11y/index.ts");
16
16
 
17
17
  /**
18
18
  * Collects all focusable descendant elements within a container.
@@ -25,7 +25,7 @@ __webpack_require__.r(__webpack_exports__);
25
25
  *
26
26
  * @returns An array of focusable HTMLElements in DOM order.
27
27
  */
28
- const getFocusableHtmlElements = (container) => Array.from(container.querySelectorAll('*')).filter(_is_html_element_focusable__WEBPACK_IMPORTED_MODULE_0__.isHtmlElementFocusable);
28
+ const getFocusableHtmlElements = (container) => Array.from(container.querySelectorAll('*')).filter(_a11y__WEBPACK_IMPORTED_MODULE_0__.isHtmlElementFocusable);
29
29
 
30
30
 
31
31
  /***/ }),
@@ -64,7 +64,7 @@ __webpack_require__.r(__webpack_exports__);
64
64
  /* harmony export */ FOCUSABLE_HTML_TAGS: () => (/* binding */ FOCUSABLE_HTML_TAGS),
65
65
  /* harmony export */ isHtmlElementFocusable: () => (/* binding */ isHtmlElementFocusable)
66
66
  /* harmony export */ });
67
- /* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../dom */ "./src/dom/index.ts");
67
+ /* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ~/dom */ "./src/dom/index.ts");
68
68
 
69
69
  const FOCUSABLE_HTML_TAGS = ['INPUT', 'SELECT', 'TEXTAREA', 'BUTTON', 'A'];
70
70
  /**
@@ -126,7 +126,7 @@ __webpack_require__.r(__webpack_exports__);
126
126
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
127
127
  /* harmony export */ moveFocusWithinContainer: () => (/* binding */ moveFocusWithinContainer)
128
128
  /* harmony export */ });
129
- /* harmony import */ var _get_focusable_html_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./get-focusable-html-elements */ "./src/a11y/focus/get-focusable-html-elements.ts");
129
+ /* harmony import */ var _a11y__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ~/a11y */ "./src/a11y/index.ts");
130
130
 
131
131
  /**
132
132
  * Moves focus to the next or previous focusable element within a container.
@@ -158,7 +158,7 @@ const moveFocusWithinContainer = (direction, container = null, { wrap = true, ge
158
158
  if (!activeElement || !scope) {
159
159
  return;
160
160
  }
161
- const focusableElements = (0,_get_focusable_html_elements__WEBPACK_IMPORTED_MODULE_0__.getFocusableHtmlElements)(scope);
161
+ const focusableElements = (0,_a11y__WEBPACK_IMPORTED_MODULE_0__.getFocusableHtmlElements)(scope);
162
162
  if (focusableElements.length === 0) {
163
163
  return;
164
164
  }
@@ -398,10 +398,10 @@ const compose = (...fns) => (arg) => fns.reduceRight((prev, fn) => fn(prev), arg
398
398
 
399
399
  /***/ }),
400
400
 
401
- /***/ "./src/async.ts":
402
- /*!**********************!*\
403
- !*** ./src/async.ts ***!
404
- \**********************/
401
+ /***/ "./src/async/async.ts":
402
+ /*!****************************!*\
403
+ !*** ./src/async/async.ts ***!
404
+ \****************************/
405
405
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
406
406
 
407
407
  __webpack_require__.r(__webpack_exports__);
@@ -416,8 +416,8 @@ __webpack_require__.r(__webpack_exports__);
416
416
  /* harmony export */ runSequential: () => (/* binding */ runSequential),
417
417
  /* harmony export */ someAsync: () => (/* binding */ someAsync)
418
418
  /* harmony export */ });
419
- /* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./array */ "./src/array.ts");
420
- /* harmony import */ var _function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./function */ "./src/function.ts");
419
+ /* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ~/array */ "./src/array.ts");
420
+ /* harmony import */ var _function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ~/function */ "./src/function/index.ts");
421
421
 
422
422
 
423
423
  /**
@@ -614,6 +614,207 @@ const findAsync = async (array, predicate) => {
614
614
  };
615
615
 
616
616
 
617
+ /***/ }),
618
+
619
+ /***/ "./src/async/delay.ts":
620
+ /*!****************************!*\
621
+ !*** ./src/async/delay.ts ***!
622
+ \****************************/
623
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
624
+
625
+ __webpack_require__.r(__webpack_exports__);
626
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
627
+ /* harmony export */ delay: () => (/* binding */ delay)
628
+ /* harmony export */ });
629
+ /**
630
+ * Creates a promise that resolves after the specified delay.
631
+ *
632
+ * Useful for creating artificial delays, implementing timeouts, or spacing operations.
633
+ *
634
+ * @param delayMs - The delay in milliseconds.
635
+ *
636
+ * @returns A promise that resolves after the specified delay.
637
+ *
638
+ * @example
639
+ * ```ts
640
+ * // Wait for 1 second
641
+ * await delay(1000);
642
+ * console.log('This logs after 1 second');
643
+ *
644
+ * // Use with other async operations
645
+ * const fetchWithTimeout = async () => {
646
+ * const timeoutPromise = delay(5000).then(() => {
647
+ * throw new Error('Request timed out');
648
+ * });
649
+ *
650
+ * return Promise.race([fetchData(), timeoutPromise]);
651
+ * }
652
+ * ```
653
+ */
654
+ const delay = (delayMs) => new Promise(resolve => setTimeout(resolve, delayMs));
655
+
656
+
657
+ /***/ }),
658
+
659
+ /***/ "./src/async/index.ts":
660
+ /*!****************************!*\
661
+ !*** ./src/async/index.ts ***!
662
+ \****************************/
663
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
664
+
665
+ __webpack_require__.r(__webpack_exports__);
666
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
667
+ /* harmony export */ delay: () => (/* reexport safe */ _delay__WEBPACK_IMPORTED_MODULE_1__.delay),
668
+ /* harmony export */ everyAsync: () => (/* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_0__.everyAsync),
669
+ /* harmony export */ filterParallel: () => (/* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_0__.filterParallel),
670
+ /* harmony export */ filterSequential: () => (/* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_0__.filterSequential),
671
+ /* harmony export */ findAsync: () => (/* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_0__.findAsync),
672
+ /* harmony export */ isPromise: () => (/* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_0__.isPromise),
673
+ /* harmony export */ reduceAsync: () => (/* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_0__.reduceAsync),
674
+ /* harmony export */ retry: () => (/* reexport safe */ _retry__WEBPACK_IMPORTED_MODULE_3__.retry),
675
+ /* harmony export */ runParallel: () => (/* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_0__.runParallel),
676
+ /* harmony export */ runSequential: () => (/* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_0__.runSequential),
677
+ /* harmony export */ someAsync: () => (/* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_0__.someAsync),
678
+ /* harmony export */ timeout: () => (/* reexport safe */ _timeout__WEBPACK_IMPORTED_MODULE_2__.timeout)
679
+ /* harmony export */ });
680
+ /* harmony import */ var _async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./async */ "./src/async/async.ts");
681
+ /* harmony import */ var _delay__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./delay */ "./src/async/delay.ts");
682
+ /* harmony import */ var _timeout__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./timeout */ "./src/async/timeout.ts");
683
+ /* harmony import */ var _retry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./retry */ "./src/async/retry.ts");
684
+
685
+
686
+
687
+
688
+
689
+
690
+ /***/ }),
691
+
692
+ /***/ "./src/async/retry.ts":
693
+ /*!****************************!*\
694
+ !*** ./src/async/retry.ts ***!
695
+ \****************************/
696
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
697
+
698
+ __webpack_require__.r(__webpack_exports__);
699
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
700
+ /* harmony export */ retry: () => (/* binding */ retry)
701
+ /* harmony export */ });
702
+ /* harmony import */ var _async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ~/async */ "./src/async/index.ts");
703
+
704
+ /**
705
+ * Wraps an asynchronous function with retry logic.
706
+ *
707
+ * The returned function will attempt to call the original function up to `maxAttempts` times,
708
+ * with a delay between retries. If all attempts fail, the last encountered error is thrown.
709
+ *
710
+ * Useful for operations that may fail intermittently, such as network requests.
711
+ *
712
+ * @template Task - The type of the async function to wrap.
713
+ * @template TaskResult - The result type of the async function.
714
+ *
715
+ * @param task - The async function to wrap with retry logic.
716
+ * @param options - Configuration options for retry behavior.
717
+ *
718
+ * @returns A function that wraps the original function with retry support.
719
+ *
720
+ * @example
721
+ * ```ts
722
+ * async function fetchData() {
723
+ * const response = await fetch('/api/data');
724
+ *
725
+ * if (!response.ok) {
726
+ * throw new Error('Network error');
727
+ * }
728
+ *
729
+ * return await response.json();
730
+ * }
731
+ *
732
+ * const fetchWithRetry = retry(fetchData, {
733
+ * maxAttempts: 5,
734
+ * delayMs: 500,
735
+ * onRetry: (attempt, error) => {
736
+ * console.warn(`Attempt ${attempt} failed:`, error);
737
+ * }
738
+ * });
739
+ *
740
+ * fetchWithRetry()
741
+ * .then(data => console.log('Success:', data))
742
+ * .catch(error => console.error('Failed after retries:', error));
743
+ * ```
744
+ */
745
+ const retry = (task, { maxAttempts = 3, delayMs = 300, backoff = true, onRetry } = {}) => {
746
+ return async (...args) => {
747
+ let lastError;
748
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
749
+ try {
750
+ return await task(...args);
751
+ }
752
+ catch (e) {
753
+ lastError = e;
754
+ if (attempt < maxAttempts) {
755
+ onRetry?.(attempt, e);
756
+ const delayTime = backoff ? delayMs * 2 ** (attempt - 1) : delayMs;
757
+ await (0,_async__WEBPACK_IMPORTED_MODULE_0__.delay)(delayTime);
758
+ }
759
+ }
760
+ }
761
+ throw lastError;
762
+ };
763
+ };
764
+
765
+
766
+ /***/ }),
767
+
768
+ /***/ "./src/async/timeout.ts":
769
+ /*!******************************!*\
770
+ !*** ./src/async/timeout.ts ***!
771
+ \******************************/
772
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
773
+
774
+ __webpack_require__.r(__webpack_exports__);
775
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
776
+ /* harmony export */ timeout: () => (/* binding */ timeout)
777
+ /* harmony export */ });
778
+ /* harmony import */ var _async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ~/async */ "./src/async/index.ts");
779
+
780
+ /**
781
+ * Wraps a promise with a timeout. If the promise does not settle within the specified time,
782
+ * it will reject with a timeout error.
783
+ *
784
+ * @template T - The type of the promise result.
785
+ *
786
+ * @param promise - The promise to wrap.
787
+ * @param timeoutMs - Timeout duration in milliseconds.
788
+ * @param errorMessage - Optional custom error message.
789
+ *
790
+ * @returns A promise that resolves or rejects with the original promise,
791
+ * or rejects with a timeout error if the duration is exceeded.
792
+ *
793
+ * @example
794
+ * ```ts
795
+ * // Rejects if fetch takes longer than 3 seconds
796
+ * const response = await timeout(fetch('/api/data'), 3000);
797
+ *
798
+ * // With custom message
799
+ * await timeout(fetchData(), 2000, 'Too long');
800
+ * ```
801
+ */
802
+ const timeout = async (promise, timeoutMs, errorMessage = 'Operation timed out') => {
803
+ const timeoutId = null;
804
+ try {
805
+ return await Promise.race([
806
+ promise,
807
+ (0,_async__WEBPACK_IMPORTED_MODULE_0__.delay)(timeoutMs).then(() => Promise.reject(new Error(errorMessage))),
808
+ ]);
809
+ }
810
+ finally {
811
+ if (timeoutId) {
812
+ clearTimeout(timeoutId);
813
+ }
814
+ }
815
+ };
816
+
817
+
617
818
  /***/ }),
618
819
 
619
820
  /***/ "./src/dom/dom.ts":
@@ -685,8 +886,8 @@ __webpack_require__.r(__webpack_exports__);
685
886
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
686
887
  /* harmony export */ downloadFile: () => (/* binding */ downloadFile)
687
888
  /* harmony export */ });
688
- /* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../string */ "./src/string.ts");
689
- /* harmony import */ var _guards__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../guards */ "./src/guards.ts");
889
+ /* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ~/string */ "./src/string/index.ts");
890
+ /* harmony import */ var _guards__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ~/guards */ "./src/guards.ts");
690
891
 
691
892
 
692
893
  /**
@@ -801,8 +1002,8 @@ __webpack_require__.r(__webpack_exports__);
801
1002
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
802
1003
  /* harmony export */ centerElementInContainer: () => (/* binding */ centerElementInContainer)
803
1004
  /* harmony export */ });
804
- /* harmony import */ var _overflow__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./overflow */ "./src/dom/layout/overflow.ts");
805
- /* harmony import */ var _geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../geometry */ "./src/geometry/index.ts");
1005
+ /* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ~/dom */ "./src/dom/index.ts");
1006
+ /* harmony import */ var _geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ~/geometry */ "./src/geometry/index.ts");
806
1007
 
807
1008
 
808
1009
  /**
@@ -829,7 +1030,7 @@ const centerElementInContainer = (containerElement, elementToCenter, { axis = 'b
829
1030
  let translateY = 0;
830
1031
  if (axis === 'x' || axis === 'both') {
831
1032
  translateX = (0,_geometry__WEBPACK_IMPORTED_MODULE_1__.calculateCenterOffset)({
832
- overflowSize: (0,_overflow__WEBPACK_IMPORTED_MODULE_0__.getXOverflowWidth)(containerElement),
1033
+ overflowSize: (0,_dom__WEBPACK_IMPORTED_MODULE_0__.getXOverflowWidth)(containerElement),
833
1034
  containerSize: containerElement.clientWidth,
834
1035
  elementOffset: elementToCenter.offsetLeft,
835
1036
  elementSize: elementToCenter.clientWidth,
@@ -837,7 +1038,7 @@ const centerElementInContainer = (containerElement, elementToCenter, { axis = 'b
837
1038
  }
838
1039
  if (axis === 'y' || axis === 'both') {
839
1040
  translateY = (0,_geometry__WEBPACK_IMPORTED_MODULE_1__.calculateCenterOffset)({
840
- overflowSize: (0,_overflow__WEBPACK_IMPORTED_MODULE_0__.getYOverflowHeight)(containerElement),
1041
+ overflowSize: (0,_dom__WEBPACK_IMPORTED_MODULE_0__.getYOverflowHeight)(containerElement),
841
1042
  containerSize: containerElement.clientHeight,
842
1043
  elementOffset: elementToCenter.offsetTop,
843
1044
  elementSize: elementToCenter.clientHeight,
@@ -1127,7 +1328,7 @@ __webpack_require__.r(__webpack_exports__);
1127
1328
  /* harmony export */ readFilesFromDataTransfer: () => (/* binding */ readFilesFromDataTransfer),
1128
1329
  /* harmony export */ traverseFileSystemDirectory: () => (/* binding */ traverseFileSystemDirectory)
1129
1330
  /* harmony export */ });
1130
- /* harmony import */ var _async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./async */ "./src/async.ts");
1331
+ /* harmony import */ var _async_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./async/async */ "./src/async/async.ts");
1131
1332
 
1132
1333
  /**
1133
1334
  * Checks if a value is a `File` object.
@@ -1249,7 +1450,7 @@ const traverseFileSystemDirectory = async (directoryEntry, { skipFiles = [
1249
1450
  ], } = {}) => {
1250
1451
  const skipFilesSet = new Set(skipFiles);
1251
1452
  const entries = await readFileSystemDirectoryEntries(directoryEntry);
1252
- const filePromises = await (0,_async__WEBPACK_IMPORTED_MODULE_0__.runParallel)(entries, async (entry) => {
1453
+ const filePromises = await (0,_async_async__WEBPACK_IMPORTED_MODULE_0__.runParallel)(entries, async (entry) => {
1253
1454
  if (entry.isDirectory) {
1254
1455
  return traverseFileSystemDirectory(entry, {
1255
1456
  skipFiles,
@@ -1318,22 +1519,18 @@ const readFilesFromDataTransfer = async (dataTransfer, traverseOptions = {}) =>
1318
1519
 
1319
1520
  /***/ }),
1320
1521
 
1321
- /***/ "./src/function.ts":
1322
- /*!*************************!*\
1323
- !*** ./src/function.ts ***!
1324
- \*************************/
1522
+ /***/ "./src/function/function.ts":
1523
+ /*!**********************************!*\
1524
+ !*** ./src/function/function.ts ***!
1525
+ \**********************************/
1325
1526
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1326
1527
 
1327
1528
  __webpack_require__.r(__webpack_exports__);
1328
1529
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1329
- /* harmony export */ delay: () => (/* binding */ delay),
1330
- /* harmony export */ invokeIfFunction: () => (/* binding */ invokeIfFunction),
1331
1530
  /* harmony export */ isFunction: () => (/* binding */ isFunction),
1332
1531
  /* harmony export */ noop: () => (/* binding */ noop),
1333
1532
  /* harmony export */ not: () => (/* binding */ not),
1334
- /* harmony export */ once: () => (/* binding */ once),
1335
- /* harmony export */ retry: () => (/* binding */ retry),
1336
- /* harmony export */ timeout: () => (/* binding */ timeout)
1533
+ /* harmony export */ once: () => (/* binding */ once)
1337
1534
  /* harmony export */ });
1338
1535
  const noop = () => { };
1339
1536
  /**
@@ -1363,6 +1560,71 @@ const isFunction = (value) => typeof value === 'function';
1363
1560
  * ```
1364
1561
  */
1365
1562
  const not = (fn) => (...args) => !fn(...args);
1563
+ /**
1564
+ * Wraps a function so that it can only be executed once.
1565
+ * The wrapped function remembers (caches) the result of the first invocation
1566
+ * and returns that same result for all subsequent calls, regardless of the arguments provided.
1567
+ *
1568
+ * Common use cases include:
1569
+ * - initializing singletons
1570
+ * - running setup logic only once
1571
+ * - avoiding repeated expensive computations
1572
+ *
1573
+ * @template T - A function type whose return value should be cached.
1574
+ *
1575
+ * @param fn - The function to execute at most once.
1576
+ *
1577
+ * @returns A new function with the same signature as `fn`, but guaranteed to
1578
+ * execute `fn` only on the first call and return the cached result
1579
+ * thereafter.
1580
+ */
1581
+ const once = (fn) => {
1582
+ let called = false;
1583
+ let result;
1584
+ return function (...args) {
1585
+ if (!called) {
1586
+ called = true;
1587
+ result = fn.apply(this, args);
1588
+ }
1589
+ return result;
1590
+ };
1591
+ };
1592
+
1593
+
1594
+ /***/ }),
1595
+
1596
+ /***/ "./src/function/index.ts":
1597
+ /*!*******************************!*\
1598
+ !*** ./src/function/index.ts ***!
1599
+ \*******************************/
1600
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1601
+
1602
+ __webpack_require__.r(__webpack_exports__);
1603
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1604
+ /* harmony export */ invokeIfFunction: () => (/* reexport safe */ _invoke_if_function__WEBPACK_IMPORTED_MODULE_1__.invokeIfFunction),
1605
+ /* harmony export */ isFunction: () => (/* reexport safe */ _function__WEBPACK_IMPORTED_MODULE_0__.isFunction),
1606
+ /* harmony export */ noop: () => (/* reexport safe */ _function__WEBPACK_IMPORTED_MODULE_0__.noop),
1607
+ /* harmony export */ not: () => (/* reexport safe */ _function__WEBPACK_IMPORTED_MODULE_0__.not),
1608
+ /* harmony export */ once: () => (/* reexport safe */ _function__WEBPACK_IMPORTED_MODULE_0__.once)
1609
+ /* harmony export */ });
1610
+ /* harmony import */ var _function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./function */ "./src/function/function.ts");
1611
+ /* harmony import */ var _invoke_if_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./invoke-if-function */ "./src/function/invoke-if-function.ts");
1612
+
1613
+
1614
+
1615
+
1616
+ /***/ }),
1617
+
1618
+ /***/ "./src/function/invoke-if-function.ts":
1619
+ /*!********************************************!*\
1620
+ !*** ./src/function/invoke-if-function.ts ***!
1621
+ \********************************************/
1622
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1623
+
1624
+ __webpack_require__.r(__webpack_exports__);
1625
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1626
+ /* harmony export */ invokeIfFunction: () => (/* binding */ invokeIfFunction)
1627
+ /* harmony export */ });
1366
1628
  /**
1367
1629
  * Invokes the given input if it is a function, passing the provided arguments.
1368
1630
  * Otherwise, returns the input as-is.
@@ -1376,157 +1638,6 @@ const not = (fn) => (...args) => !fn(...args);
1376
1638
  * @returns The result of invoking the function, or the original value if it's not a function.
1377
1639
  */
1378
1640
  const invokeIfFunction = (input, ...args) => (typeof input === 'function' ? input(...args) : input);
1379
- /**
1380
- * Creates a promise that resolves after the specified delay.
1381
- *
1382
- * Useful for creating artificial delays, implementing timeouts, or spacing operations.
1383
- *
1384
- * @param delayMs - The delay in milliseconds.
1385
- *
1386
- * @returns A promise that resolves after the specified delay.
1387
- *
1388
- * @example
1389
- * ```ts
1390
- * // Wait for 1 second
1391
- * await delay(1000);
1392
- * console.log('This logs after 1 second');
1393
- *
1394
- * // Use with other async operations
1395
- * const fetchWithTimeout = async () => {
1396
- * const timeoutPromise = delay(5000).then(() => {
1397
- * throw new Error('Request timed out');
1398
- * });
1399
- *
1400
- * return Promise.race([fetchData(), timeoutPromise]);
1401
- * }
1402
- * ```
1403
- */
1404
- const delay = (delayMs) => new Promise(resolve => setTimeout(resolve, delayMs));
1405
- /**
1406
- * Wraps a promise with a timeout. If the promise does not settle within the specified time,
1407
- * it will reject with a timeout error.
1408
- *
1409
- * @template T - The type of the promise result.
1410
- *
1411
- * @param promise - The promise to wrap.
1412
- * @param timeoutMs - Timeout duration in milliseconds.
1413
- * @param errorMessage - Optional custom error message.
1414
- *
1415
- * @returns A promise that resolves or rejects with the original promise,
1416
- * or rejects with a timeout error if the duration is exceeded.
1417
- *
1418
- * @example
1419
- * ```ts
1420
- * // Rejects if fetch takes longer than 3 seconds
1421
- * const response = await timeout(fetch('/api/data'), 3000);
1422
- *
1423
- * // With custom message
1424
- * await timeout(fetchData(), 2000, 'Too long');
1425
- * ```
1426
- */
1427
- const timeout = async (promise, timeoutMs, errorMessage = 'Operation timed out') => {
1428
- const timeoutId = null;
1429
- try {
1430
- return await Promise.race([
1431
- promise,
1432
- delay(timeoutMs).then(() => Promise.reject(new Error(errorMessage))),
1433
- ]);
1434
- }
1435
- finally {
1436
- if (timeoutId) {
1437
- clearTimeout(timeoutId);
1438
- }
1439
- }
1440
- };
1441
- /**
1442
- * Wraps an asynchronous function with retry logic.
1443
- *
1444
- * The returned function will attempt to call the original function up to `maxAttempts` times,
1445
- * with a delay between retries. If all attempts fail, the last encountered error is thrown.
1446
- *
1447
- * Useful for operations that may fail intermittently, such as network requests.
1448
- *
1449
- * @template Task - The type of the async function to wrap.
1450
- * @template TaskResult - The result type of the async function.
1451
- *
1452
- * @param task - The async function to wrap with retry logic.
1453
- * @param options - Configuration options for retry behavior.
1454
- *
1455
- * @returns A function that wraps the original function with retry support.
1456
- *
1457
- * @example
1458
- * ```ts
1459
- * async function fetchData() {
1460
- * const response = await fetch('/api/data');
1461
- *
1462
- * if (!response.ok) {
1463
- * throw new Error('Network error');
1464
- * }
1465
- *
1466
- * return await response.json();
1467
- * }
1468
- *
1469
- * const fetchWithRetry = retry(fetchData, {
1470
- * maxAttempts: 5,
1471
- * delayMs: 500,
1472
- * onRetry: (attempt, error) => {
1473
- * console.warn(`Attempt ${attempt} failed:`, error);
1474
- * }
1475
- * });
1476
- *
1477
- * fetchWithRetry()
1478
- * .then(data => console.log('Success:', data))
1479
- * .catch(error => console.error('Failed after retries:', error));
1480
- * ```
1481
- */
1482
- const retry = (task, { maxAttempts = 3, delayMs = 300, backoff = true, onRetry } = {}) => {
1483
- return async (...args) => {
1484
- let lastError;
1485
- for (let attempt = 1; attempt <= maxAttempts; attempt++) {
1486
- try {
1487
- return await task(...args);
1488
- }
1489
- catch (e) {
1490
- lastError = e;
1491
- if (attempt < maxAttempts) {
1492
- onRetry?.(attempt, e);
1493
- const delayTime = backoff ? delayMs * 2 ** (attempt - 1) : delayMs;
1494
- await delay(delayTime);
1495
- }
1496
- }
1497
- }
1498
- throw lastError;
1499
- };
1500
- };
1501
- /**
1502
- * Wraps a function so that it can only be executed once.
1503
- * The wrapped function remembers (caches) the result of the first invocation
1504
- * and returns that same result for all subsequent calls, regardless of the arguments provided.
1505
- *
1506
- * Common use cases include:
1507
- * - initializing singletons
1508
- * - running setup logic only once
1509
- * - avoiding repeated expensive computations
1510
- *
1511
- * @template T - A function type whose return value should be cached.
1512
- *
1513
- * @param fn - The function to execute at most once.
1514
- *
1515
- * @returns A new function with the same signature as `fn`, but guaranteed to
1516
- * execute `fn` only on the first call and return the cached result
1517
- * thereafter.
1518
- */
1519
- const once = (fn) => {
1520
- let called = false;
1521
- let result;
1522
- return function (...args) {
1523
- if (!called) {
1524
- called = true;
1525
- result = fn.apply(this, args);
1526
- }
1527
- return result;
1528
- };
1529
- };
1530
1641
 
1531
1642
 
1532
1643
  /***/ }),
@@ -1953,10 +2064,76 @@ const resolveAxisDelta = (delta, axis, { allowFallback = true, invert = true } =
1953
2064
 
1954
2065
  /***/ }),
1955
2066
 
1956
- /***/ "./src/math.ts":
1957
- /*!*********************!*\
1958
- !*** ./src/math.ts ***!
1959
- \*********************/
2067
+ /***/ "./src/math/hash-string.ts":
2068
+ /*!*********************************!*\
2069
+ !*** ./src/math/hash-string.ts ***!
2070
+ \*********************************/
2071
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2072
+
2073
+ __webpack_require__.r(__webpack_exports__);
2074
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2075
+ /* harmony export */ hashString: () => (/* binding */ hashString)
2076
+ /* harmony export */ });
2077
+ /**
2078
+ * Generates a short, consistent hash string from an input string using a DJB2-inspired algorithm.
2079
+ *
2080
+ * This function uses a variation of the DJB2 algorithm, which is a simple yet effective hashing algorithm
2081
+ * based on bitwise XOR (`^`) and multiplication by 33. It produces a non-negative 32-bit integer,
2082
+ * which is then converted to a base-36 string (digits + lowercase letters) to produce a compact output.
2083
+ *
2084
+ * Useful for:
2085
+ * - Generating stable class names in CSS-in-JS libraries.
2086
+ * - Producing consistent cache keys.
2087
+ * - Quick and lightweight hashing needs where cryptographic security is not required.
2088
+ *
2089
+ * ⚠️ This is not cryptographically secure and should not be used for hashing passwords or sensitive data.
2090
+ *
2091
+ * @param input - The input string to hash.
2092
+ *
2093
+ * @returns A short, base-36 encoded hash string.
2094
+ *
2095
+ * @example
2096
+ * ```ts
2097
+ * const className = hashString('background-color: red;');
2098
+ * // → 'e4k1z0x'
2099
+ * ```
2100
+ */
2101
+ const hashString = (input) => {
2102
+ let hash = 5381;
2103
+ for (let i = 0; i < input.length; i++) {
2104
+ hash = (hash * 33) ^ input.charCodeAt(i);
2105
+ }
2106
+ return (hash >>> 0).toString(36);
2107
+ };
2108
+
2109
+
2110
+ /***/ }),
2111
+
2112
+ /***/ "./src/math/index.ts":
2113
+ /*!***************************!*\
2114
+ !*** ./src/math/index.ts ***!
2115
+ \***************************/
2116
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2117
+
2118
+ __webpack_require__.r(__webpack_exports__);
2119
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2120
+ /* harmony export */ calculateEuclideanDistance: () => (/* reexport safe */ _math__WEBPACK_IMPORTED_MODULE_0__.calculateEuclideanDistance),
2121
+ /* harmony export */ calculateMovingSpeed: () => (/* reexport safe */ _math__WEBPACK_IMPORTED_MODULE_0__.calculateMovingSpeed),
2122
+ /* harmony export */ calculatePercentage: () => (/* reexport safe */ _math__WEBPACK_IMPORTED_MODULE_0__.calculatePercentage),
2123
+ /* harmony export */ hashString: () => (/* reexport safe */ _hash_string__WEBPACK_IMPORTED_MODULE_1__.hashString)
2124
+ /* harmony export */ });
2125
+ /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math */ "./src/math/math.ts");
2126
+ /* harmony import */ var _hash_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./hash-string */ "./src/math/hash-string.ts");
2127
+
2128
+
2129
+
2130
+
2131
+ /***/ }),
2132
+
2133
+ /***/ "./src/math/math.ts":
2134
+ /*!**************************!*\
2135
+ !*** ./src/math/math.ts ***!
2136
+ \**************************/
1960
2137
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1961
2138
 
1962
2139
  __webpack_require__.r(__webpack_exports__);
@@ -2037,63 +2214,16 @@ const definedProps = (obj) => Object.entries(obj).reduce((result, [key, value])
2037
2214
 
2038
2215
  /***/ }),
2039
2216
 
2040
- /***/ "./src/string.ts":
2041
- /*!***********************!*\
2042
- !*** ./src/string.ts ***!
2043
- \***********************/
2217
+ /***/ "./src/string/camel-to-dash-case.ts":
2218
+ /*!******************************************!*\
2219
+ !*** ./src/string/camel-to-dash-case.ts ***!
2220
+ \******************************************/
2044
2221
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2045
2222
 
2046
2223
  __webpack_require__.r(__webpack_exports__);
2047
2224
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2048
- /* harmony export */ camelToDashCase: () => (/* binding */ camelToDashCase),
2049
- /* harmony export */ camelToWords: () => (/* binding */ camelToWords),
2050
- /* harmony export */ hashString: () => (/* binding */ hashString),
2051
- /* harmony export */ isNilOrEmptyString: () => (/* binding */ isNilOrEmptyString),
2052
- /* harmony export */ isString: () => (/* binding */ isString),
2053
- /* harmony export */ splitStringIntoWords: () => (/* binding */ splitStringIntoWords),
2054
- /* harmony export */ toKebabCase: () => (/* binding */ toKebabCase)
2225
+ /* harmony export */ camelToDashCase: () => (/* binding */ camelToDashCase)
2055
2226
  /* harmony export */ });
2056
- /* harmony import */ var _guards__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./guards */ "./src/guards.ts");
2057
-
2058
- /**
2059
- * Checks if a value is a string.
2060
- *
2061
- * @param value - The value to check.
2062
- *
2063
- * @returns `true` if the value is a string; otherwise, `false`.
2064
- */
2065
- const isString = (value) => typeof value === 'string';
2066
- /**
2067
- * Checks whether the provided value is considered "empty".
2068
- *
2069
- * A value is considered empty if it is:
2070
- * - `null`
2071
- * - `undefined`
2072
- * - `''`
2073
- *
2074
- * @param value - The value to check.
2075
- *
2076
- * @returns `true` if the value is empty; otherwise, `false`.
2077
- */
2078
- const isNilOrEmptyString = (value) => value === '' || (0,_guards__WEBPACK_IMPORTED_MODULE_0__.isNil)(value);
2079
- /**
2080
- * Converts a string to kebab-case format.
2081
- *
2082
- * This function transforms camelCase or PascalCase strings into kebab-case by inserting
2083
- * hyphens between lowercase and uppercase letters, then converting everything to lowercase.
2084
- *
2085
- * @param input - The string to convert to kebab-case.
2086
- *
2087
- * @returns The kebab-case formatted string.
2088
- *
2089
- * @example
2090
- * ```ts
2091
- * toKebabCase('helloWorld'); // → 'hello-world'
2092
- * toKebabCase('HelloWorld'); // → 'hello-world'
2093
- * toKebabCase('hello123World'); // → 'hello123-world'
2094
- * ```
2095
- */
2096
- const toKebabCase = (input) => input.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
2097
2227
  /**
2098
2228
  * Converts a camelCase string to dash-case format.
2099
2229
  *
@@ -2117,12 +2247,26 @@ const camelToDashCase = (input) => {
2117
2247
  // First handle the first character separately to avoid adding a hyphen at the start
2118
2248
  const firstChar = input.charAt(0);
2119
2249
  const restOfString = input.slice(1);
2120
- // Convert the first character to lowercase without adding a hyphen
2250
+ // Convert the first character to the lowercase without adding a hyphen
2121
2251
  const firstCharProcessed = firstChar.toLowerCase();
2122
2252
  // Process the rest of the string normally, adding hyphens before uppercase letters
2123
2253
  const restProcessed = restOfString.replace(/[A-Z]/g, letter => `-${letter.toLowerCase()}`);
2124
2254
  return firstCharProcessed + restProcessed;
2125
2255
  };
2256
+
2257
+
2258
+ /***/ }),
2259
+
2260
+ /***/ "./src/string/camel-to-words.ts":
2261
+ /*!**************************************!*\
2262
+ !*** ./src/string/camel-to-words.ts ***!
2263
+ \**************************************/
2264
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2265
+
2266
+ __webpack_require__.r(__webpack_exports__);
2267
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2268
+ /* harmony export */ camelToWords: () => (/* binding */ camelToWords)
2269
+ /* harmony export */ });
2126
2270
  /**
2127
2271
  * Splits a camelCase or PascalCase string into separate words with spaces.
2128
2272
  *
@@ -2142,6 +2286,102 @@ const camelToDashCase = (input) => {
2142
2286
  * ```
2143
2287
  */
2144
2288
  const camelToWords = (input) => input.replace(/([a-z0-9])([A-Z])/g, '$1 $2');
2289
+
2290
+
2291
+ /***/ }),
2292
+
2293
+ /***/ "./src/string/index.ts":
2294
+ /*!*****************************!*\
2295
+ !*** ./src/string/index.ts ***!
2296
+ \*****************************/
2297
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2298
+
2299
+ __webpack_require__.r(__webpack_exports__);
2300
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2301
+ /* harmony export */ camelToDashCase: () => (/* reexport safe */ _camel_to_dash_case__WEBPACK_IMPORTED_MODULE_2__.camelToDashCase),
2302
+ /* harmony export */ camelToWords: () => (/* reexport safe */ _camel_to_words__WEBPACK_IMPORTED_MODULE_3__.camelToWords),
2303
+ /* harmony export */ isNilOrEmptyString: () => (/* reexport safe */ _is_nil_or_empty_string__WEBPACK_IMPORTED_MODULE_5__.isNilOrEmptyString),
2304
+ /* harmony export */ isString: () => (/* reexport safe */ _is_string__WEBPACK_IMPORTED_MODULE_0__.isString),
2305
+ /* harmony export */ splitStringIntoWords: () => (/* reexport safe */ _split_string_into_words__WEBPACK_IMPORTED_MODULE_4__.splitStringIntoWords),
2306
+ /* harmony export */ toKebabCase: () => (/* reexport safe */ _to_kebab_case__WEBPACK_IMPORTED_MODULE_1__.toKebabCase)
2307
+ /* harmony export */ });
2308
+ /* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-string */ "./src/string/is-string.ts");
2309
+ /* harmony import */ var _to_kebab_case__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./to-kebab-case */ "./src/string/to-kebab-case.ts");
2310
+ /* harmony import */ var _camel_to_dash_case__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./camel-to-dash-case */ "./src/string/camel-to-dash-case.ts");
2311
+ /* harmony import */ var _camel_to_words__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./camel-to-words */ "./src/string/camel-to-words.ts");
2312
+ /* harmony import */ var _split_string_into_words__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./split-string-into-words */ "./src/string/split-string-into-words.ts");
2313
+ /* harmony import */ var _is_nil_or_empty_string__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./is-nil-or-empty-string */ "./src/string/is-nil-or-empty-string.ts");
2314
+
2315
+
2316
+
2317
+
2318
+
2319
+
2320
+
2321
+
2322
+ /***/ }),
2323
+
2324
+ /***/ "./src/string/is-nil-or-empty-string.ts":
2325
+ /*!**********************************************!*\
2326
+ !*** ./src/string/is-nil-or-empty-string.ts ***!
2327
+ \**********************************************/
2328
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2329
+
2330
+ __webpack_require__.r(__webpack_exports__);
2331
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2332
+ /* harmony export */ isNilOrEmptyString: () => (/* binding */ isNilOrEmptyString)
2333
+ /* harmony export */ });
2334
+ /* harmony import */ var _guards__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ~/guards */ "./src/guards.ts");
2335
+
2336
+ /**
2337
+ * Checks whether the provided value is considered "empty".
2338
+ *
2339
+ * A value is considered empty if it is:
2340
+ * - `null`
2341
+ * - `undefined`
2342
+ * - `''`
2343
+ *
2344
+ * @param value - The value to check.
2345
+ *
2346
+ * @returns `true` if the value is empty; otherwise, `false`.
2347
+ */
2348
+ const isNilOrEmptyString = (value) => value === '' || (0,_guards__WEBPACK_IMPORTED_MODULE_0__.isNil)(value);
2349
+
2350
+
2351
+ /***/ }),
2352
+
2353
+ /***/ "./src/string/is-string.ts":
2354
+ /*!*********************************!*\
2355
+ !*** ./src/string/is-string.ts ***!
2356
+ \*********************************/
2357
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2358
+
2359
+ __webpack_require__.r(__webpack_exports__);
2360
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2361
+ /* harmony export */ isString: () => (/* binding */ isString)
2362
+ /* harmony export */ });
2363
+ /**
2364
+ * Checks if a value is a string.
2365
+ *
2366
+ * @param value - The value to check.
2367
+ *
2368
+ * @returns `true` if the value is a string; otherwise, `false`.
2369
+ */
2370
+ const isString = (value) => typeof value === 'string';
2371
+
2372
+
2373
+ /***/ }),
2374
+
2375
+ /***/ "./src/string/split-string-into-words.ts":
2376
+ /*!***********************************************!*\
2377
+ !*** ./src/string/split-string-into-words.ts ***!
2378
+ \***********************************************/
2379
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2380
+
2381
+ __webpack_require__.r(__webpack_exports__);
2382
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2383
+ /* harmony export */ splitStringIntoWords: () => (/* binding */ splitStringIntoWords)
2384
+ /* harmony export */ });
2145
2385
  /**
2146
2386
  * Splits a string into an array of filtered from redundant spaces words.
2147
2387
  *
@@ -2150,37 +2390,38 @@ const camelToWords = (input) => input.replace(/([a-z0-9])([A-Z])/g, '$1 $2');
2150
2390
  * @returns An array of words from the input string.
2151
2391
  */
2152
2392
  const splitStringIntoWords = (input) => input.split(' ').filter(Boolean);
2393
+
2394
+
2395
+ /***/ }),
2396
+
2397
+ /***/ "./src/string/to-kebab-case.ts":
2398
+ /*!*************************************!*\
2399
+ !*** ./src/string/to-kebab-case.ts ***!
2400
+ \*************************************/
2401
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2402
+
2403
+ __webpack_require__.r(__webpack_exports__);
2404
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2405
+ /* harmony export */ toKebabCase: () => (/* binding */ toKebabCase)
2406
+ /* harmony export */ });
2153
2407
  /**
2154
- * Generates a short, consistent hash string from an input string using a DJB2-inspired algorithm.
2155
- *
2156
- * This function uses a variation of the DJB2 algorithm, which is a simple yet effective hashing algorithm
2157
- * based on bitwise XOR (`^`) and multiplication by 33. It produces a non-negative 32-bit integer,
2158
- * which is then converted to a base-36 string (digits + lowercase letters) to produce a compact output.
2159
- *
2160
- * Useful for:
2161
- * - Generating stable class names in CSS-in-JS libraries.
2162
- * - Producing consistent cache keys.
2163
- * - Quick and lightweight hashing needs where cryptographic security is not required.
2408
+ * Converts a string to kebab-case format.
2164
2409
  *
2165
- * ⚠️ This is not cryptographically secure and should not be used for hashing passwords or sensitive data.
2410
+ * This function transforms camelCase or PascalCase strings into kebab-case by inserting
2411
+ * hyphens between lowercase and uppercase letters, then converting everything to lowercase.
2166
2412
  *
2167
- * @param input - The input string to hash.
2413
+ * @param input - The string to convert to kebab-case.
2168
2414
  *
2169
- * @returns A short, base-36 encoded hash string.
2415
+ * @returns The kebab-case formatted string.
2170
2416
  *
2171
2417
  * @example
2172
2418
  * ```ts
2173
- * const className = hashString('background-color: red;');
2174
- * // → 'e4k1z0x'
2419
+ * toKebabCase('helloWorld'); // 'hello-world'
2420
+ * toKebabCase('HelloWorld'); // → 'hello-world'
2421
+ * toKebabCase('hello123World'); // → 'hello123-world'
2175
2422
  * ```
2176
2423
  */
2177
- const hashString = (input) => {
2178
- let hash = 5381;
2179
- for (let i = 0; i < input.length; i++) {
2180
- hash = (hash * 33) ^ input.charCodeAt(i);
2181
- }
2182
- return (hash >>> 0).toString(36);
2183
- };
2424
+ const toKebabCase = (input) => input.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
2184
2425
 
2185
2426
 
2186
2427
  /***/ })
@@ -2258,30 +2499,36 @@ __webpack_require__.r(__webpack_exports__);
2258
2499
  /* harmony export */ calculatePercentage: () => (/* reexport safe */ _math__WEBPACK_IMPORTED_MODULE_5__.calculatePercentage),
2259
2500
  /* harmony export */ camelToDashCase: () => (/* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_1__.camelToDashCase),
2260
2501
  /* harmony export */ camelToWords: () => (/* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_1__.camelToWords),
2502
+ /* harmony export */ centerElementInContainer: () => (/* reexport safe */ _dom__WEBPACK_IMPORTED_MODULE_6__.centerElementInContainer),
2261
2503
  /* harmony export */ chunk: () => (/* reexport safe */ _array__WEBPACK_IMPORTED_MODULE_2__.chunk),
2262
- /* harmony export */ cloneBlob: () => (/* reexport safe */ _dom_dom__WEBPACK_IMPORTED_MODULE_6__.cloneBlob),
2504
+ /* harmony export */ cloneBlob: () => (/* reexport safe */ _dom__WEBPACK_IMPORTED_MODULE_6__.cloneBlob),
2263
2505
  /* harmony export */ compact: () => (/* reexport safe */ _array__WEBPACK_IMPORTED_MODULE_2__.compact),
2264
2506
  /* harmony export */ compose: () => (/* reexport safe */ _array__WEBPACK_IMPORTED_MODULE_2__.compose),
2265
2507
  /* harmony export */ definedProps: () => (/* reexport safe */ _object__WEBPACK_IMPORTED_MODULE_8__.definedProps),
2266
- /* harmony export */ delay: () => (/* reexport safe */ _function__WEBPACK_IMPORTED_MODULE_3__.delay),
2508
+ /* harmony export */ delay: () => (/* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_0__.delay),
2267
2509
  /* harmony export */ difference: () => (/* reexport safe */ _array__WEBPACK_IMPORTED_MODULE_2__.difference),
2510
+ /* harmony export */ downloadFile: () => (/* reexport safe */ _dom__WEBPACK_IMPORTED_MODULE_6__.downloadFile),
2268
2511
  /* harmony export */ everyAsync: () => (/* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_0__.everyAsync),
2269
2512
  /* harmony export */ fileListToFiles: () => (/* reexport safe */ _file__WEBPACK_IMPORTED_MODULE_7__.fileListToFiles),
2270
2513
  /* harmony export */ filterParallel: () => (/* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_0__.filterParallel),
2271
2514
  /* harmony export */ filterSequential: () => (/* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_0__.filterSequential),
2272
2515
  /* harmony export */ findAsync: () => (/* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_0__.findAsync),
2273
2516
  /* harmony export */ getDOMRectIntersectionRatio: () => (/* reexport safe */ _intersection__WEBPACK_IMPORTED_MODULE_10__.getDOMRectIntersectionRatio),
2274
- /* harmony export */ getElementOffsetRect: () => (/* reexport safe */ _dom_dom__WEBPACK_IMPORTED_MODULE_6__.getElementOffsetRect),
2517
+ /* harmony export */ getElementOffsetRect: () => (/* reexport safe */ _dom__WEBPACK_IMPORTED_MODULE_6__.getElementOffsetRect),
2275
2518
  /* harmony export */ getFocusableHtmlElements: () => (/* reexport safe */ _a11y__WEBPACK_IMPORTED_MODULE_11__.getFocusableHtmlElements),
2276
2519
  /* harmony export */ getLocalStorageCapabilities: () => (/* reexport safe */ _env__WEBPACK_IMPORTED_MODULE_12__.getLocalStorageCapabilities),
2277
- /* harmony export */ hashString: () => (/* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_1__.hashString),
2520
+ /* harmony export */ getXOverflowWidth: () => (/* reexport safe */ _dom__WEBPACK_IMPORTED_MODULE_6__.getXOverflowWidth),
2521
+ /* harmony export */ getYOverflowHeight: () => (/* reexport safe */ _dom__WEBPACK_IMPORTED_MODULE_6__.getYOverflowHeight),
2522
+ /* harmony export */ hasXOverflow: () => (/* reexport safe */ _dom__WEBPACK_IMPORTED_MODULE_6__.hasXOverflow),
2523
+ /* harmony export */ hasYOverflow: () => (/* reexport safe */ _dom__WEBPACK_IMPORTED_MODULE_6__.hasYOverflow),
2524
+ /* harmony export */ hashString: () => (/* reexport safe */ _math__WEBPACK_IMPORTED_MODULE_5__.hashString),
2278
2525
  /* harmony export */ intersection: () => (/* reexport safe */ _array__WEBPACK_IMPORTED_MODULE_2__.intersection),
2279
2526
  /* harmony export */ invokeIfFunction: () => (/* reexport safe */ _function__WEBPACK_IMPORTED_MODULE_3__.invokeIfFunction),
2280
- /* harmony export */ isAnchorHtmlElement: () => (/* reexport safe */ _dom_dom__WEBPACK_IMPORTED_MODULE_6__.isAnchorHtmlElement),
2527
+ /* harmony export */ isAnchorHtmlElement: () => (/* reexport safe */ _dom__WEBPACK_IMPORTED_MODULE_6__.isAnchorHtmlElement),
2281
2528
  /* harmony export */ isArray: () => (/* reexport safe */ _array__WEBPACK_IMPORTED_MODULE_2__.isArray),
2282
2529
  /* harmony export */ isBlob: () => (/* reexport safe */ _guards__WEBPACK_IMPORTED_MODULE_4__.isBlob),
2283
2530
  /* harmony export */ isBool: () => (/* reexport safe */ _guards__WEBPACK_IMPORTED_MODULE_4__.isBool),
2284
- /* harmony export */ isContentEditableHtmlElement: () => (/* reexport safe */ _dom_dom__WEBPACK_IMPORTED_MODULE_6__.isContentEditableHtmlElement),
2531
+ /* harmony export */ isContentEditableHtmlElement: () => (/* reexport safe */ _dom__WEBPACK_IMPORTED_MODULE_6__.isContentEditableHtmlElement),
2285
2532
  /* harmony export */ isDate: () => (/* reexport safe */ _guards__WEBPACK_IMPORTED_MODULE_4__.isDate),
2286
2533
  /* harmony export */ isDecimal: () => (/* reexport safe */ _guards__WEBPACK_IMPORTED_MODULE_4__.isDecimal),
2287
2534
  /* harmony export */ isDefined: () => (/* reexport safe */ _guards__WEBPACK_IMPORTED_MODULE_4__.isDefined),
@@ -2311,28 +2558,29 @@ __webpack_require__.r(__webpack_exports__);
2311
2558
  /* harmony export */ noop: () => (/* reexport safe */ _function__WEBPACK_IMPORTED_MODULE_3__.noop),
2312
2559
  /* harmony export */ not: () => (/* reexport safe */ _function__WEBPACK_IMPORTED_MODULE_3__.not),
2313
2560
  /* harmony export */ once: () => (/* reexport safe */ _function__WEBPACK_IMPORTED_MODULE_3__.once),
2561
+ /* harmony export */ parse2DMatrix: () => (/* reexport safe */ _dom__WEBPACK_IMPORTED_MODULE_6__.parse2DMatrix),
2314
2562
  /* harmony export */ parseFileName: () => (/* reexport safe */ _file__WEBPACK_IMPORTED_MODULE_7__.parseFileName),
2315
2563
  /* harmony export */ pipe: () => (/* reexport safe */ _array__WEBPACK_IMPORTED_MODULE_2__.pipe),
2316
2564
  /* harmony export */ readFilesFromDataTransfer: () => (/* reexport safe */ _file__WEBPACK_IMPORTED_MODULE_7__.readFilesFromDataTransfer),
2317
2565
  /* harmony export */ reduceAsync: () => (/* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_0__.reduceAsync),
2318
2566
  /* harmony export */ resolveAxisDelta: () => (/* reexport safe */ _intersection__WEBPACK_IMPORTED_MODULE_10__.resolveAxisDelta),
2319
- /* harmony export */ retry: () => (/* reexport safe */ _function__WEBPACK_IMPORTED_MODULE_3__.retry),
2567
+ /* harmony export */ retry: () => (/* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_0__.retry),
2320
2568
  /* harmony export */ runParallel: () => (/* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_0__.runParallel),
2321
2569
  /* harmony export */ runSequential: () => (/* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_0__.runSequential),
2322
2570
  /* harmony export */ someAsync: () => (/* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_0__.someAsync),
2323
2571
  /* harmony export */ splitStringIntoWords: () => (/* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_1__.splitStringIntoWords),
2324
- /* harmony export */ timeout: () => (/* reexport safe */ _function__WEBPACK_IMPORTED_MODULE_3__.timeout),
2572
+ /* harmony export */ timeout: () => (/* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_0__.timeout),
2325
2573
  /* harmony export */ toKebabCase: () => (/* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_1__.toKebabCase),
2326
2574
  /* harmony export */ traverseFileSystemDirectory: () => (/* reexport safe */ _file__WEBPACK_IMPORTED_MODULE_7__.traverseFileSystemDirectory),
2327
2575
  /* harmony export */ unique: () => (/* reexport safe */ _array__WEBPACK_IMPORTED_MODULE_2__.unique)
2328
2576
  /* harmony export */ });
2329
- /* harmony import */ var _async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./async */ "./src/async.ts");
2330
- /* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./string */ "./src/string.ts");
2577
+ /* harmony import */ var _async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./async */ "./src/async/index.ts");
2578
+ /* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./string */ "./src/string/index.ts");
2331
2579
  /* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./array */ "./src/array.ts");
2332
- /* harmony import */ var _function__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./function */ "./src/function.ts");
2580
+ /* harmony import */ var _function__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./function */ "./src/function/index.ts");
2333
2581
  /* harmony import */ var _guards__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./guards */ "./src/guards.ts");
2334
- /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./math */ "./src/math.ts");
2335
- /* harmony import */ var _dom_dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./dom/dom */ "./src/dom/dom.ts");
2582
+ /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./math */ "./src/math/index.ts");
2583
+ /* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./dom */ "./src/dom/index.ts");
2336
2584
  /* harmony import */ var _file__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./file */ "./src/file.ts");
2337
2585
  /* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./object */ "./src/object.ts");
2338
2586
  /* harmony import */ var _geometry__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./geometry */ "./src/geometry/index.ts");