diff --git a/lib/cache.ts b/lib/cache.ts index a1098465..37676197 100644 --- a/lib/cache.ts +++ b/lib/cache.ts @@ -70,12 +70,11 @@ class BlockCache<T> { } remove (key: string): boolean { - if (this._cache.delete(key)) { + if (this.contains(key)) { debug('remove cache entry, key:', key) this.clearTimeout(key) - return true } - return false + return this._cache.delete(key) } contains (key: string): boolean { diff --git a/package.json b/package.json index 12a45d34..f6ba1039 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coap", - "version": "1.2.0", + "version": "1.2.1", "description": "A CoAP library for node modelled after 'http'", "main": "dist/index.js", "types": "dist/index.d.ts",