Skip to content

typescript-package/collection

Repository files navigation

@typescript-package/collection

npm version GitHub issues GitHub license

A lightweight TypeScript package for data collection.

Table of contents

Installation

npm install @typescript-package/collection --save-peer

Api

import {
  // Abstract.
  CollectionCore,
  CollectionBase,
  // Concrete.
  Collection,
  // Adapters.
  SetAdapter
} from '@typescript-package/collection';

Abstract

CollectionBase

The base functionality abstraction for collections.

import { CollectionBase } from '@typescript-package/collection';

CollectionBase

CollectionCore

The core abstract class for Type collections of elements Element type.

import { CollectionCore } from '@typescript-package/collection';

CollectionCore

Adapters

SetAdapter

The Set collection adapter.

import { SetAdapter } from '@typescript-package/collection';

SetAdapter

Concrete

Collection

The collection concrete class with adapter support.

import { Collection, SetAdapter } from '@typescript-package/collection';

const collection = new Collection(SetAdapter, 1, 2, 3);

// Adds.
collection.add(27, 29, 31, 33);
// Deletes.
collection.delete(29, 31);

console.log(`size: `, collection.size); // Output: 5

Collection

Contributing

Your contributions are valued! If you'd like to contribute, please feel free to submit a pull request. Help is always appreciated.

Support

If you find this package useful and would like to support its and general development, you can contribute through one of the following payment methods. Your support helps maintain the packages and continue adding new.

Support via:

or via Trust Wallet

Thanks for your support!

Code of Conduct

By participating in this project, you agree to follow Code of Conduct.

GIT

Commit

Please follow the following commit message conventions:

Versioning

The package follows Semantic Versioning 2.0.0 for all releases. The versioning format is:

Given a version number MAJOR.MINOR.PATCH, increment the:

  • MAJOR version when you make incompatible API changes,
  • MINOR version when you add functionality in a backwards-compatible manner, and
  • PATCH version when you make backwards-compatible bug fixes.

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

FAQ How should I deal with revisions in the 0.y.z initial development phase?

The simplest thing to do is start your initial development release at 0.1.0 and then increment the minor version for each subsequent release.

How do I know when to release 1.0.0?

If your software is being used in production, it should probably already be 1.0.0. If you have a stable API on which users have come to depend, you should be 1.0.0. If you’re worrying a lot about backwards compatibility, you should probably already be 1.0.0.

License

MIT © typescript-package (license)