Skip to content

Commit 2733bfb

Browse files
committed
chore(endpoint-cache): rename remove operation to delete
Remain consistent with Map API https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
1 parent 06c674a commit 2733bfb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/endpoint-cache/src/EndpointCache.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ describe(EndpointCache.name, () => {
142142
});
143143
});
144144

145-
it("remove", () => {
146-
endpointCache.remove(key);
145+
it("delete", () => {
146+
endpointCache.delete(key);
147147
expect(set).toHaveBeenCalledTimes(1);
148148
expect(set).toHaveBeenCalledWith(key, []);
149149
});

packages/endpoint-cache/src/EndpointCache.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class EndpointCache {
3939

4040
const endpoint = this.getEndpoint(endpointsWithExpiry);
4141
if (endpoint === undefined) {
42-
this.remove(key);
42+
this.delete(key);
4343
}
4444
return endpoint;
4545
}
@@ -66,12 +66,12 @@ export class EndpointCache {
6666
}
6767

6868
/**
69-
* Removes the value for the given key in the cache.
69+
* Deletes the value for the given key in the cache.
7070
*
7171
* @param {string} key
7272
*/
73-
remove(key: string) {
74-
// Replace with remove call once support is added upstream
73+
delete(key: string) {
74+
// Replace with remove/delete call once support is added upstream
7575
// Refs: https://github.com/Yomguithereal/mnemonist/issues/143
7676
this.cache.set(key, []);
7777
}

0 commit comments

Comments
 (0)