@tspro/ts-utils-lib 3.2.0 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * TsUtilsLib v3.2.0 (esm)
2
+ * TsUtilsLib v3.3.1 (esm)
3
3
  * (c) 2023-2025 PahkaSoft
4
4
  * Licensed under the MIT License
5
5
  */
@@ -1520,32 +1520,32 @@ function toPx(value) {
1520
1520
  return value === void 0 ? void 0 : device_exports.unitToPx(value);
1521
1521
  }
1522
1522
  function hasClass(el, className) {
1523
- if (className.length === 0) {
1523
+ if (className.length === 0)
1524
1524
  return false;
1525
- } else if (el.classList) {
1525
+ else if (el.classList)
1526
1526
  return el.classList.contains(className);
1527
- } else {
1527
+ else
1528
1528
  return !!el.className.match(new RegExp("(\\s|^)" + className + "(\\s|$)"));
1529
- }
1530
- }
1531
- function addClass(el, className) {
1532
- if (className.length === 0) {
1533
- return;
1534
- } else if (el.classList) {
1535
- el.classList.add(className);
1536
- } else if (!hasClass(el, className)) {
1537
- el.className += " " + className;
1538
- }
1539
1529
  }
1540
- function removeClass(el, className) {
1541
- if (className.length === 0) {
1542
- return;
1543
- } else if (el.classList) {
1544
- el.classList.remove(className);
1545
- } else if (hasClass(el, className)) {
1546
- var reg = new RegExp("(\\s|^)" + className + "(\\s|$)");
1547
- el.className = el.className.replace(reg, " ");
1548
- }
1530
+ function addClass(el, ...className) {
1531
+ className.forEach((cls) => {
1532
+ if (cls.length === 0)
1533
+ return;
1534
+ else if (el.classList)
1535
+ el.classList.add(cls);
1536
+ else if (!hasClass(el, cls))
1537
+ el.className += " " + cls;
1538
+ });
1539
+ }
1540
+ function removeClass(el, ...className) {
1541
+ className.forEach((cls) => {
1542
+ if (cls.length === 0)
1543
+ return;
1544
+ else if (el.classList)
1545
+ el.classList.remove(cls);
1546
+ else if (hasClass(el, cls))
1547
+ el.className = el.className.replace(new RegExp("(\\s|^)" + cls + "(\\s|$)"), " ");
1548
+ });
1549
1549
  }
1550
1550
  function setOffset(el, left, top, unit = "px") {
1551
1551
  el.style.left = left + unit;
@@ -4464,7 +4464,7 @@ var CallTracker = _CallTracker;
4464
4464
 
4465
4465
  // src/index.ts
4466
4466
  function getLibInfo() {
4467
- return "TsUtilsLib v3.2.0 (esm)";
4467
+ return "TsUtilsLib v3.3.1 (esm)";
4468
4468
  }
4469
4469
 
4470
4470
  export { AnchoredRect, assert_exports as Assert, BaseContainer, BiMap, CallTracker, cookies_exports as Cookies, DefaultArray, DefaultEqualityFn, device_exports as Device, guard_exports as Guard, IndexArray, LRUCache, LinkedList, MultiContainer, Rect, SignedIndexArray, Stack, TriMap, UniMap, utils_exports as Utils, ValueSet, Vec, asMulti, getLibInfo };