@whitesev/utils 2.11.12 → 2.11.14
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 +16 -4
- package/dist/index.amd.js.map +1 -1
- package/dist/index.amd.min.js +1 -1
- package/dist/index.amd.min.js.map +1 -1
- package/dist/index.cjs.js +16 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.js +16 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +16 -4
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.system.js +16 -4
- package/dist/index.system.js.map +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/dist/index.umd.js +16 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/src/Dictionary.d.ts +13 -2
- package/dist/types/src/types/ajaxHooker.d.ts +98 -7
- package/package.json +1 -1
- package/src/Dictionary.ts +24 -3
- package/src/types/ajaxHooker.d.ts +98 -7
package/dist/index.esm.js
CHANGED
|
@@ -237,7 +237,7 @@ const clearTimeout$1 = (timerId) => loadOrReturnBroker().clearTimeout(timerId);
|
|
|
237
237
|
const setInterval$1 = (...args) => loadOrReturnBroker().setInterval(...args);
|
|
238
238
|
const setTimeout$1 = (...args) => loadOrReturnBroker().setTimeout(...args);
|
|
239
239
|
|
|
240
|
-
const version = "2.11.
|
|
240
|
+
const version = "2.11.14";
|
|
241
241
|
|
|
242
242
|
/* eslint-disable */
|
|
243
243
|
// ==UserScript==
|
|
@@ -1918,13 +1918,25 @@ class UtilsDictionary {
|
|
|
1918
1918
|
}
|
|
1919
1919
|
/**
|
|
1920
1920
|
* 迭代字典
|
|
1921
|
-
* @param
|
|
1921
|
+
* @param cb 回调函数
|
|
1922
1922
|
*/
|
|
1923
|
-
forEach(
|
|
1923
|
+
forEach(cb) {
|
|
1924
1924
|
this.items.forEach((value, key) => {
|
|
1925
|
-
|
|
1925
|
+
cb(value, key, this);
|
|
1926
1926
|
});
|
|
1927
1927
|
}
|
|
1928
|
+
/**
|
|
1929
|
+
* 找到字典中对应的键和值
|
|
1930
|
+
* @param cb 回调函数
|
|
1931
|
+
*/
|
|
1932
|
+
find(cb) {
|
|
1933
|
+
for (const [key, value] of this.items.entries()) {
|
|
1934
|
+
const result = cb(value, key, this);
|
|
1935
|
+
if (result) {
|
|
1936
|
+
return result;
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1928
1940
|
/**
|
|
1929
1941
|
* 检查已有的键中是否以xx开头
|
|
1930
1942
|
* @param key 需要匹配的键
|