From 2fe8b2fb713bc024d9f7ac16e67a21e9044c3b0c Mon Sep 17 00:00:00 2001 From: awojobigodfrey <67189904+awojobigodfrey@users.noreply.github.com> Date: Mon, 18 Apr 2022 17:15:10 +0100 Subject: [PATCH 1/2] Update LRUCache.js Added a clear function for cache --- Cache/LRUCache.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Cache/LRUCache.js b/Cache/LRUCache.js index d524bcbaec..a6ceed28fd 100644 --- a/Cache/LRUCache.js +++ b/Cache/LRUCache.js @@ -83,6 +83,11 @@ class LRUCache { this.cache.set(key, value) } + clear () { + this.cache.clear() + return this + } + /** * @param {string} key * @returns {*} From 7e7fd9ba8b80a02cd710bdb378a57b48e99419c7 Mon Sep 17 00:00:00 2001 From: awojobigodfrey <67189904+awojobigodfrey@users.noreply.github.com> Date: Mon, 18 Apr 2022 23:24:50 +0100 Subject: [PATCH 2/2] Update LRUCache.js Fixed indentation --- Cache/LRUCache.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cache/LRUCache.js b/Cache/LRUCache.js index a6ceed28fd..7682a04de1 100644 --- a/Cache/LRUCache.js +++ b/Cache/LRUCache.js @@ -84,8 +84,8 @@ class LRUCache { } clear () { - this.cache.clear() - return this + this.cache.clear() + return this } /**