mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-01 09:01:45 +08:00
Fixing ICacheObject::get return type (#29001)
get can return undefined if the key isn't in the cache. See the example: https://docs.angularjs.org/api/ng/type/$cacheFactory.Cache ``` superCache.remove('another key'); expect(superCache.get('another key')).toBeUndefined(); ```
This commit is contained in:
2
types/angular/index.d.ts
vendored
2
types/angular/index.d.ts
vendored
@@ -1316,7 +1316,7 @@ declare namespace angular {
|
||||
*
|
||||
* @param key the key of the data to be retrieved
|
||||
*/
|
||||
get<T>(key: string): T;
|
||||
get<T>(key: string): T | undefined;
|
||||
|
||||
/**
|
||||
* Removes an entry from the Cache object.
|
||||
|
||||
Reference in New Issue
Block a user