Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rajkumardusad committed Apr 26, 2023
1 parent 30de0f2 commit 7096e77
Show file tree
Hide file tree
Showing 11 changed files with 7 additions and 27 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opensnip/cachejs",
"version": "1.0.2",
"version": "1.0.3",
"description": "Fast and lightweight caching library for javascript",
"main": "index.mjs",
"type": "module",
Expand Down
1 change: 0 additions & 1 deletion src/fifo.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const LinkedList = require("./linkedlist/index.cjs");
const Node = require("./linkedlist/node.cjs");

module.exports = class FIFO {
#linkedList = null;
Expand Down
1 change: 0 additions & 1 deletion src/fifo.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import LinkedList from "./linkedlist/index.mjs";
import Node from "./linkedlist/node.mjs";

export default class FIFO {
#linkedList = null;
Expand Down
1 change: 0 additions & 1 deletion src/lifo.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const LinkedList = require("./linkedlist/index.cjs");
const Node = require("./linkedlist/node.cjs");

module.exports = class LIFO {
#linkedList = null;
Expand Down
1 change: 0 additions & 1 deletion src/lifo.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import LinkedList from "./linkedlist/index.mjs";
import Node from "./linkedlist/node.mjs";

export default class LIFO {
#linkedList = null;
Expand Down
12 changes: 3 additions & 9 deletions src/linkedlist/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,8 @@ module.exports = class LinkedList {
if (rightNode === this.#head) this.#head = tmpLeft;
if (rightNode === this.#tail) this.#tail = tmpLeft;

delete leftNode.next;
delete leftNode.prev;
delete leftNode.value;
delete rightNode.next;
delete rightNode.prev;
delete rightNode.value;
leftNode = null;
rightNode = null;
return [tmpLeft, tmpRight];
}

Expand All @@ -171,9 +167,7 @@ module.exports = class LinkedList {

delete(node) {
this.detach(node);
delete node.prev;
delete node.next;
delete node.value;
node = null;
}

detach(node) {
Expand Down
12 changes: 3 additions & 9 deletions src/linkedlist/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,8 @@ export default class LinkedList {
if (rightNode === this.#head) this.#head = tmpLeft;
if (rightNode === this.#tail) this.#tail = tmpLeft;

delete leftNode.next;
delete leftNode.prev;
delete leftNode.value;
delete rightNode.next;
delete rightNode.prev;
delete rightNode.value;
leftNode = null;
rightNode = null;
return [tmpLeft, tmpRight];
}

Expand All @@ -171,9 +167,7 @@ export default class LinkedList {

delete(node) {
this.detach(node);
delete node.prev;
delete node.next;
delete node.value;
node = null;
}

detach(node) {
Expand Down
1 change: 0 additions & 1 deletion src/lru.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const LinkedList = require("./linkedlist/index.cjs");
const Node = require("./linkedlist/node.cjs");

module.exports = class LRU {
#linkedList = null;
Expand Down
1 change: 0 additions & 1 deletion src/lru.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import LinkedList from "./linkedlist/index.mjs";
import Node from "./linkedlist/node.mjs";

export default class LRU {
#linkedList = null;
Expand Down
1 change: 0 additions & 1 deletion src/mru.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const LinkedList = require("./linkedlist/index.cjs");
const Node = require("./linkedlist/node.cjs");

module.exports = class MRU {
#linkedList = null;
Expand Down
1 change: 0 additions & 1 deletion src/mru.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import LinkedList from "./linkedlist/index.mjs";
import Node from "./linkedlist/node.mjs";

export default class MRU {
#linkedList = null;
Expand Down

0 comments on commit 7096e77

Please sign in to comment.