Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
typescript-data-structures
Advanced tools
A collection of TypeScript classes to create and use common data structures
npm install typescript-data-structures
Import the desired data structure in your file
import { LinkedList } from 'typescript-data-structures'
Instantiate class
private linkedList: LinkedList = new LinkedList();
Use class methods
this.linkedList.addToHead('new head');
Method | Parameters | Returns | What it does |
---|---|---|---|
addToHead | value: any | void | adds new node and sets the head pointer to it, the old head becomes the new head's next |
addToTail | value: any | void | adds new node and sets the tail pointer to it, the old tail becomes the new tail's prev |
removeHead | value: any | head.value | removes head and sets new head to old head's next |
removeTail | value: any | tail.value | removes tail and sets new tail to old tail's prev |
has | value: any | LinkedListNode | returns first node that contains the value or null |
search | value: any | LinkedListNode[] | returns array of nodes that contain the value or null |
Method | Parameters | Returns | What it does |
---|---|---|---|
setInsertCondition | (value) => boolean | void | sets insertion rule |
insert | value: any | void | inserts new node according to insert condition; if condition is not set, insertion will be done by simple comparison |
Contributing rules will follow
We use SemVer for versioning. For the versions available, see the tags on this repository.
Eric Traub - Data Structures in Javascript
This project is licensed under the MIT License - see the LICENSE.md file for details
FAQs
A collection of TypeScript classes to create and use common data structures
The npm package typescript-data-structures receives a total of 20 weekly downloads. As such, typescript-data-structures popularity was classified as not popular.
We found that typescript-data-structures demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.