@whitesev/utils 2.1.0 → 2.1.2

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.umd.js CHANGED
@@ -2639,8 +2639,6 @@
2639
2639
  let request = idbStore.put(inData);
2640
2640
  request.onsuccess = function (event) {
2641
2641
  /* 保存成功有success 字段 */
2642
- // @ts-ignore
2643
- event.target;
2644
2642
  resolve({
2645
2643
  success: true,
2646
2644
  code: that.#errorCode.success.code,
@@ -2649,8 +2647,6 @@
2649
2647
  });
2650
2648
  };
2651
2649
  request.onerror = function (event) {
2652
- // @ts-ignore
2653
- event.target;
2654
2650
  resolve({
2655
2651
  success: false,
2656
2652
  code: that.#errorCode.save.code,
@@ -2669,8 +2665,8 @@
2669
2665
  async get(key) {
2670
2666
  let that = this;
2671
2667
  return new Promise((resolve) => {
2672
- let dbName = that.#dbName;
2673
- that.open(function (idbStore, success) {
2668
+ let dbName = this.#dbName;
2669
+ this.open(function (idbStore, success) {
2674
2670
  /* 判断返回的数据中是否有error字段 */
2675
2671
  if (!success) {
2676
2672
  resolve({
@@ -3486,7 +3482,7 @@
3486
3482
  }
3487
3483
  }
3488
3484
 
3489
- class UtilsWindowApi {
3485
+ class WindowApi {
3490
3486
  /** 默认的配置 */
3491
3487
  defaultApi = {
3492
3488
  document: document,
@@ -3523,10 +3519,10 @@
3523
3519
  class Utils {
3524
3520
  windowApi;
3525
3521
  constructor(option) {
3526
- this.windowApi = new UtilsWindowApi(option);
3522
+ this.windowApi = new WindowApi(option);
3527
3523
  }
3528
3524
  /** 版本号 */
3529
- version = "2024.7.20";
3525
+ version = "2024.7.24";
3530
3526
  addStyle(cssText) {
3531
3527
  if (typeof cssText !== "string") {
3532
3528
  throw new Error("Utils.addStyle 参数cssText 必须为String类型");
@@ -5836,7 +5832,8 @@
5836
5832
  if (Array.isArray(data)) {
5837
5833
  data.sort(sortFunc);
5838
5834
  }
5839
- else if (data instanceof NodeList || UtilsContext.isJQuery(data)) {
5835
+ else if (data instanceof NodeList ||
5836
+ UtilsContext.isJQuery(data)) {
5840
5837
  sortNodeFunc(data, getDataFunc);
5841
5838
  result = getDataFunc();
5842
5839
  }