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

@slimlib/list

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@slimlib/list

Doubly linked list

  • 1.0.10
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

List

Doubly linked list implementation in typescript.

Changelog

Installation

Using npm:

npm install --save-dev @slimlib/list

API

List() constructor

No arguments. Constructs a new list object.

const list = new List;
const list = new List<NodeType>();

[Symbol.iterator]()

List provides an iterator using the [Symbol.iterator]() method. Most commonly used in cases where another statement/method consumes an iterable object.

Array.from(list);
for (const item of list) {
    // something with item
}

append(element, data)

inserts an element after element (at the end of the list in case of list)

element - ListNode or List itself to add a new element after

data - object that will become a ListNode

appendRange(element, begin, end)

inserts a range of elements after element (at the end of the list in case of list)

element - ListNode or List itself to add range after

begin - first ListNode of a range

end - last ListNode of a range

prepend(element, data)

inserts an element before element (at the beginning of the list in case of list)

element - ListNode or List itself to add a new element before

data - object that will become a ListNode

prependRange(element, begin, end)

inserts a range of elements before element (at the beginning of the list in case of list)

element - ListNode or List itself to insert range before

begin - first ListNode of a range

end - last ListNode of a range

License

MIT

Keywords

FAQs

Package last updated on 11 Oct 2023

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