@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.esm.js CHANGED
@@ -2633,8 +2633,6 @@ class indexedDB {
2633
2633
  let request = idbStore.put(inData);
2634
2634
  request.onsuccess = function (event) {
2635
2635
  /* 保存成功有success 字段 */
2636
- // @ts-ignore
2637
- event.target;
2638
2636
  resolve({
2639
2637
  success: true,
2640
2638
  code: that.#errorCode.success.code,
@@ -2643,8 +2641,6 @@ class indexedDB {
2643
2641
  });
2644
2642
  };
2645
2643
  request.onerror = function (event) {
2646
- // @ts-ignore
2647
- event.target;
2648
2644
  resolve({
2649
2645
  success: false,
2650
2646
  code: that.#errorCode.save.code,
@@ -2663,8 +2659,8 @@ class indexedDB {
2663
2659
  async get(key) {
2664
2660
  let that = this;
2665
2661
  return new Promise((resolve) => {
2666
- let dbName = that.#dbName;
2667
- that.open(function (idbStore, success) {
2662
+ let dbName = this.#dbName;
2663
+ this.open(function (idbStore, success) {
2668
2664
  /* 判断返回的数据中是否有error字段 */
2669
2665
  if (!success) {
2670
2666
  resolve({
@@ -3480,7 +3476,7 @@ class UtilsDictionary {
3480
3476
  }
3481
3477
  }
3482
3478
 
3483
- class UtilsWindowApi {
3479
+ class WindowApi {
3484
3480
  /** 默认的配置 */
3485
3481
  defaultApi = {
3486
3482
  document: document,
@@ -3517,10 +3513,10 @@ class UtilsWindowApi {
3517
3513
  class Utils {
3518
3514
  windowApi;
3519
3515
  constructor(option) {
3520
- this.windowApi = new UtilsWindowApi(option);
3516
+ this.windowApi = new WindowApi(option);
3521
3517
  }
3522
3518
  /** 版本号 */
3523
- version = "2024.7.20";
3519
+ version = "2024.7.24";
3524
3520
  addStyle(cssText) {
3525
3521
  if (typeof cssText !== "string") {
3526
3522
  throw new Error("Utils.addStyle 参数cssText 必须为String类型");
@@ -5830,7 +5826,8 @@ class Utils {
5830
5826
  if (Array.isArray(data)) {
5831
5827
  data.sort(sortFunc);
5832
5828
  }
5833
- else if (data instanceof NodeList || UtilsContext.isJQuery(data)) {
5829
+ else if (data instanceof NodeList ||
5830
+ UtilsContext.isJQuery(data)) {
5834
5831
  sortNodeFunc(data, getDataFunc);
5835
5832
  result = getDataFunc();
5836
5833
  }