@gm-mobile/c-tool 3.12.0 → 3.12.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gm-mobile/c-tool",
3
- "version": "3.12.0",
3
+ "version": "3.12.1",
4
4
  "description": "> TODO: description",
5
5
  "author": "liyatang <liyatang@qq.com>",
6
6
  "homepage": "https://github.com/gmfe/gm-mobile#readme",
@@ -26,5 +26,5 @@
26
26
  "dependencies": {
27
27
  "lodash": "^4.17.20"
28
28
  },
29
- "gitHead": "d4065e9124472a8c61e875fca2e3cd364d53177c"
29
+ "gitHead": "ca8b30b9c7a0826a6fc09bf88c82db0630b7d599"
30
30
  }
@@ -28,7 +28,7 @@ class StorageFactory {
28
28
  }
29
29
  }
30
30
 
31
- get(key: string): any {
31
+ get<T = any>(key: string): T | null {
32
32
  try {
33
33
  let value: any
34
34
 
@@ -41,7 +41,7 @@ class StorageFactory {
41
41
  }
42
42
  }
43
43
 
44
- return value
44
+ return value as T
45
45
  } catch (err) {
46
46
  console.warn('Storage set error', err)
47
47
  // 如果 parse 错误,代表这个存储错误,认为就是没有这个存储,保持和没存储的表现一直,返回 null