Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ts-linked-list

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-linked-list

A doubly linked list written in TypeScript

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
51
decreased by-5.56%
Maintainers
1
Weekly downloads
 
Created
Source

ts-linked-list

Build Status Dev Dependencies

Test Coverage Maintainability Known Vulnerabilities

Yet another yet another doubly linked list, written in TypeScript. It supports iterators using a generator function with Symbol.iterator, fast index getter in O(n/2) time, reversible forEach, map, filter and reduce methods, insertBefore and insertAfter any node as well as generics for TypeScript users.

Installation

npm install ts-linked-list

Usage

import LinkedList from 'ts-linked-list';

// Create a list with however many arguments of whatever type you like
const list = new LinkedList(1, 'two', { n: 3 }, () => 4);

// TYPESCRIPT ONLY: ts-linked-list uses generics to type the list data
const typedList = new LinkedList<number>(1, 2, 3);
const wildList = new LinkedList<any>(1, 'two', () => 3, [4]);

// Create a list from any iterable alternatively
const listFromArray = LinkedList.from([1, 2, 3, 'whatever']);

// Do something with it
list.forEach(data => doSomethingUseful(data));

Documentation

https://tuelsch.github.io/ts-linked-list/.

Keywords

FAQs

Package last updated on 06 Sep 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc