Comparing version 0.0.1-test to 0.0.2-test
@@ -23,3 +23,7 @@ "use strict"; | ||
} | ||
prepend(value) { | ||
peek() { | ||
var _a, _b; | ||
return (_b = (_a = this.head) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : null; | ||
} | ||
addFirst(value) { | ||
const newNode = new ListNode(value); | ||
@@ -36,3 +40,3 @@ if (this.isEmpty()) { | ||
} | ||
append(value) { | ||
addLast(value) { | ||
const newNode = new ListNode(value); | ||
@@ -94,11 +98,27 @@ if (this.isEmpty()) { | ||
let current = this.head; | ||
let listValues = ""; | ||
const listValues = []; | ||
while (current) { | ||
listValues += `${current.value} -> `; | ||
listValues.push(current.value); | ||
current = current.next; | ||
} | ||
listValues += "null"; | ||
this.logger.info(listValues); | ||
} | ||
printReverse() { | ||
if (this.isEmpty()) { | ||
return this.logger.info("List is empty"); | ||
} | ||
let current = this.head; | ||
const listValues = []; | ||
while (current) { | ||
listValues.unshift(current.value); | ||
current = current.next; | ||
} | ||
this.logger.info(listValues); | ||
} | ||
clear() { | ||
this.head = null; | ||
this.tail = null; | ||
this.size = 0; | ||
} | ||
} | ||
exports.default = SingleLinkedList; |
@@ -6,4 +6,14 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SingleLinkedList = void 0; | ||
exports.binarySearch = exports.Logger = exports.LinkedList = exports.Queue = exports.Stack = exports.SingleLinkedList = void 0; | ||
const binarySearch_1 = __importDefault(require("./Algorithms/binarySearch")); | ||
exports.binarySearch = binarySearch_1.default; | ||
const DoublyLinkedList_1 = __importDefault(require("./dataStructures/DoublyLinkedList")); | ||
exports.LinkedList = DoublyLinkedList_1.default; | ||
const Queue_1 = __importDefault(require("./dataStructures/Queue")); | ||
exports.Queue = Queue_1.default; | ||
const SingleLinkedList_1 = __importDefault(require("./dataStructures/SingleLinkedList")); | ||
exports.SingleLinkedList = SingleLinkedList_1.default; | ||
const Stack_1 = __importDefault(require("./dataStructures/Stack")); | ||
exports.Stack = Stack_1.default; | ||
const Logger_1 = __importDefault(require("./lib/Logger")); | ||
exports.Logger = Logger_1.default; |
{ | ||
"name": "dsacjs", | ||
"version": "0.0.1-test", | ||
"version": "0.0.2-test", | ||
"description": "A high-performance JavaScript and TypeScript library offering a comprehensive set of efficient data structures. Simplify your algorithm implementation and data manipulation with optimized, easy-to-use tools.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -0,1 +1,3 @@ | ||
# IN DEVELOPMENT | ||
# DsacJs - Data Structures - Algorithm - Toolkit Collection | ||
@@ -2,0 +4,0 @@ |
@@ -13,8 +13,11 @@ declare class ListNode<T = any> { | ||
isEmpty(): boolean; | ||
prepend(value: T): void; | ||
append(value: T): void; | ||
peek(): T | null; | ||
addFirst(value: T): void; | ||
addLast(value: T): void; | ||
removeFirst(): T | null; | ||
removeLast(): T | null; | ||
print(): void; | ||
printReverse(): void; | ||
clear(): void; | ||
} | ||
export {}; |
@@ -0,2 +1,7 @@ | ||
import binarySearch from "./Algorithms/binarySearch"; | ||
import DoublyLinkedList from "./dataStructures/DoublyLinkedList"; | ||
import Queue from "./dataStructures/Queue"; | ||
import SingleLinkedList from "./dataStructures/SingleLinkedList"; | ||
export { SingleLinkedList }; | ||
import Stack from "./dataStructures/Stack"; | ||
import Logger from "./lib/Logger"; | ||
export { SingleLinkedList, Stack, Queue, DoublyLinkedList as LinkedList, Logger, binarySearch, }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
14330
17
390
8
0
0