@whitesev/utils 2.11.12 → 2.11.13
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/package.json +1 -1
- package/src/Dictionary.ts +24 -3
package/dist/index.umd.js
CHANGED
|
@@ -243,7 +243,7 @@
|
|
|
243
243
|
const setInterval$1 = (...args) => loadOrReturnBroker().setInterval(...args);
|
|
244
244
|
const setTimeout$1 = (...args) => loadOrReturnBroker().setTimeout(...args);
|
|
245
245
|
|
|
246
|
-
const version = "2.11.
|
|
246
|
+
const version = "2.11.13";
|
|
247
247
|
|
|
248
248
|
/* eslint-disable */
|
|
249
249
|
// ==UserScript==
|
|
@@ -1924,13 +1924,25 @@
|
|
|
1924
1924
|
}
|
|
1925
1925
|
/**
|
|
1926
1926
|
* 迭代字典
|
|
1927
|
-
* @param
|
|
1927
|
+
* @param cb 回调函数
|
|
1928
1928
|
*/
|
|
1929
|
-
forEach(
|
|
1929
|
+
forEach(cb) {
|
|
1930
1930
|
this.items.forEach((value, key) => {
|
|
1931
|
-
|
|
1931
|
+
cb(value, key, this);
|
|
1932
1932
|
});
|
|
1933
1933
|
}
|
|
1934
|
+
/**
|
|
1935
|
+
* 找到字典中对应的键和值
|
|
1936
|
+
* @param cb 回调函数
|
|
1937
|
+
*/
|
|
1938
|
+
find(cb) {
|
|
1939
|
+
for (const [key, value] of this.items.entries()) {
|
|
1940
|
+
const result = cb(value, key, this);
|
|
1941
|
+
if (result) {
|
|
1942
|
+
return result;
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
}
|
|
1934
1946
|
/**
|
|
1935
1947
|
* 检查已有的键中是否以xx开头
|
|
1936
1948
|
* @param key 需要匹配的键
|