Skip to content

Commit a1502a0

Browse files
Bug fixes
1 parent 8999e83 commit a1502a0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/cache.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export default class Cache {
103103
// Insert a new node at head
104104
const existingNode = this.#cache.get(key);
105105
// Update node data if node is already exists
106-
if (typeof existingNode !== undefined) {
106+
if (typeof existingNode !== "undefined") {
107107
existingNode.value = nodeValue;
108108
// Move current node to the head
109109
this.#linkedList.setHead(existingNode);
@@ -126,7 +126,7 @@ export default class Cache {
126126

127127
const node = this.#cache.get(key);
128128

129-
if (typeof node !== undefined) {
129+
if (typeof node !== "undefined") {
130130
// Check node is live or not
131131
if (this.#isStale(node)) {
132132
this.delete(key);
@@ -156,7 +156,7 @@ export default class Cache {
156156
delete(key) {
157157
const node = this.#cache.get(key);
158158

159-
if (typeof node !== undefined) {
159+
if (typeof node !== "undefined") {
160160
this.#linkedList.delete(node);
161161
// Delete node
162162
this.#cache.delete(key);
@@ -202,7 +202,7 @@ export default class Cache {
202202
has(key) {
203203
const node = this.#cache.get(key);
204204

205-
if (typeof node !== undefined) {
205+
if (typeof node !== "undefined") {
206206
// Check node is live or not
207207
if (this.#isStale(node)) {
208208
this.delete(key);

0 commit comments

Comments
 (0)