0.0.12 • Published 5 years ago

@elijahjcobb/collections v0.0.12

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

Collections

A collection of generic structures written in TypeScript.

Classes

ClassDescription
ECArrayAn immutable generic class representing a list of values.
ECArrayListA mutable generic class representing a list of values.
ECDictionaryAn immutable generic class representing a group of key value pairs.
ECMapA mutable generic class representing a group of key value pairs.
ECIteratorA generic iterator to iterate through provided values.
ECCSVA helper class to generate a CSV endoded string from an ECArray instance.
ECEnumA helper class to generate both ECArray and ECArrayList instances from a typescript enum.
ECQueueA mutable generic class representing a queue.
ECStackA mutable generic class representing a stack.

Full Documentation

Source Code

If you want to poke around the source code for fun it is all located in the ts directory.

TypeScript Declaration Files

I have completely documented everything. In the table at the top each link on class each names directs to the declaration file for the class on GitHub. By installing with NPM you will also get all my type files.

Import

All the structures are packages on @elijahjcobb/collections. Just import it like normal and you can use any structure of the package.

All Together

import ECCollections = require("@elijahjcobb/collections");
let array: ECCollections.ECArray<any>;

Separate

import { ECArray } from "@elijahjcobb/collections";
let array: ECArray;

Generics

Yes, literally everything is generic. I wrote this for a huge project and made sure everything I made was generic.

Error Handling

Most classes throw errors when you do something that is a "no-no". This package is using a error handling package of mine called error. Check out the package @elijahjcobb/error for all the documentation. Any errors will be thrown as an instance of an ECErrorStack.

Bugs

If you find any bugs please create an issue on GitHub or if you are old fashioned email me at elijah@elijahcobb.com.