@whitesev/utils 1.9.0 → 1.9.3

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.
@@ -1,6 +1,7 @@
1
- declare class UtilsDictionary<K extends PropertyKey, V extends any> {
2
- #private;
1
+ declare class UtilsDictionary<K, V> {
2
+ private items;
3
3
  constructor();
4
+ constructor(key: K, value: V);
4
5
  /**
5
6
  * 检查是否有某一个键
6
7
  * @param key 键
@@ -15,7 +16,7 @@ declare class UtilsDictionary<K extends PropertyKey, V extends any> {
15
16
  * 获取以xx开头的键的值
16
17
  * @param key 需要匹配的键
17
18
  */
18
- getStartsWith(key: K): V;
19
+ getStartsWith(key: K): V | undefined;
19
20
  /**
20
21
  * 为字典添加某一个值
21
22
  * @param key 键
@@ -29,13 +30,11 @@ declare class UtilsDictionary<K extends PropertyKey, V extends any> {
29
30
  delete(key: K): boolean;
30
31
  /**
31
32
  * 获取某个键的值
33
+ * https://github.com/microsoft/TypeScript/issues/9619
34
+ * 微软到现在都没有修复has和get的联动
32
35
  * @param key 键
33
36
  */
34
- get(key: K): {
35
- [key: string]: V;
36
- [key: number]: V;
37
- [key: symbol]: V;
38
- }[K] | undefined;
37
+ get(key: K): V;
39
38
  /**
40
39
  * 返回字典中的所有值
41
40
  */
@@ -51,15 +50,11 @@ declare class UtilsDictionary<K extends PropertyKey, V extends any> {
51
50
  /**
52
51
  * 获取字典所有的键
53
52
  */
54
- keys(): string[];
53
+ keys(): (string | symbol)[];
55
54
  /**
56
55
  * 返回字典本身
57
56
  */
58
- getItems(): {
59
- [key: string]: V;
60
- [key: number]: V;
61
- [key: symbol]: V;
62
- };
57
+ getItems(): UtilsDictionary<K, V>;
63
58
  /**
64
59
  * 合并另一个字典
65
60
  * @param data 需要合并的字典
@@ -985,7 +985,7 @@ export declare interface HttpxDetails {
985
985
  * 拒绝拦截配置
986
986
  * 如果设置了相关配置,那么intercept将不会生效
987
987
  */
988
- allowInterceptConfig?: Partial<HttpxAllowInterceptConfig> | boolean | null;
988
+ allowInterceptConfig?: Partial<HttpxAllowInterceptConfig> | boolean;
989
989
  /**
990
990
  * 身份验证的用户名
991
991
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whitesev/utils",
3
- "version": "1.9.0",
3
+ "version": "1.9.3",
4
4
  "description": "一个常用的工具库",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/node/index.esm.js",