Socket
Socket
Sign inDemoInstall

ts-linked-list

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ts-linked-list

A doubly linked list written in TypeScript


Version published
Weekly downloads
287
increased by462.75%
Maintainers
1
Install size
45.3 kB
Created
Weekly downloads
 

Readme

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

Last updated on 06 Sep 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc