1.0.6 • Published 5 years ago

@ninoha/ts-collections v1.0.6

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

A simple library for providing wrapper classes for collection objects.

List of Classes

  • List
  • Queue, Deque
  • Set (TreeSet)
  • Tree (BinaryTree and BinarySearchTree)

Usage

const list: IList<number> = new List<number>();
list.add(1);

const queue: IQueue<number> = new List<number>();
queue.enqueue(1);

const deque: IDeque<number> = new List<number>();
deque.enqueue(2);
deque.enqueueFirst(1);

Comparators

For trees, you need to provide your own comparator while creating the instances of these classes

const comparator: (v1: string, v2: string) => v1.localeCompare(v2);
const tree: ITree<string> = new BinaryTree<string>(comparator);

Documentation & API

A simple documentation can be found at: https://ninohane.github.io/ts-collections/

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1-alpha

6 years ago

1.0.0-alpha

6 years ago