@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.amd.js +7 -10
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +7 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +7 -10
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +7 -10
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +7 -10
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +7 -10
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/Utils.d.ts +2 -2
- package/dist/types/src/{UtilsWindowApi.d.ts → WindowApi.d.ts} +1 -1
- package/dist/types/src/indexedDB.d.ts +21 -6
- package/package.json +1 -1
- package/src/Utils.ts +14 -11
- package/src/{UtilsWindowApi.ts → WindowApi.ts} +1 -1
- package/src/indexedDB.ts +26 -15
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 =
|
|
2667
|
-
|
|
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
|
|
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
|
|
3516
|
+
this.windowApi = new WindowApi(option);
|
|
3521
3517
|
}
|
|
3522
3518
|
/** 版本号 */
|
|
3523
|
-
version = "2024.7.
|
|
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 ||
|
|
5829
|
+
else if (data instanceof NodeList ||
|
|
5830
|
+
UtilsContext.isJQuery(data)) {
|
|
5834
5831
|
sortNodeFunc(data, getDataFunc);
|
|
5835
5832
|
result = getDataFunc();
|
|
5836
5833
|
}
|