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