@dragiyski/collection
v2.0.1
Published
A library with helper collection classes
Readme
This module contains extended collection in addition to existing ECMAScript collections:
OrderedSetis a collection similar toSet, but with a guaranteed order and indexing.OrderedMapis a collection similar toMap, but with a guaranteed order and indexing.Implementationis a collection that can associate interfaces to their relevant implementation. The collection is similar toSymbolprimitive, but it does not modify the interface objects - no string or symbol properties are added to that object. A symbol is added to the implementation object to link back the interface.WeakOrderedSetis a collection loosly similar toOrderedSetandArray, but objects assigned to this collection are hold by weak references and can be garbage collected. LikeWeakSetthe collection can only store objects (not primitives), but maintains the order of the objects inside. Indexing is not supported for this collection.
Installation
To install this module, run:
npm install @dragiyski/collectionUsage
To use this module, use either shorthand syntax:
const { OrderedSet, OrderedMap } = require('@dragiyski/collection');or include specific collection by filename:
const OrderedSet = require('@dragiyski/collection/ordered-set');All filenames use dash-case.
