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