制作者的介绍仅有上面的一句话。 更多详情请阅读仓库 README。 仓库 README ↗
正在加载完整 README。
查看完整 README ↗Data allocation and manipulation - a set of classic collection types (linked lists, doubly-linked lists, tree lists,
queues, stacks) built on a common Linker/Arrayable foundation.
npm install collect-your-stuff
const { LinkedList, Queue, Stack } = require('collect-your-stuff')
const list = LinkedList.fromArray(['a', 'b', 'c'])
list.length // 3
const queue = Queue.fromArray([1, 2, 3])
queue.dequeue() // 1
const stack = Stack.fromArray([1, 2, 3])
stack.pop() // 3
The reference for every class is in docs/ (or open docs/index.html locally). It is generated from the TypeScript source, and each module is a folder of src/:
| Module | What it holds |
|---|---|
collections | The collection classes: Arrayable/ArrayElement, LinkedList/Linker, DoublyLinkedList/DoubleLinker, LinkedTreeList/TreeLinker, Queue/Queueable/TaskQueue, Stack/Stackable/TaskStack, ScopedCollection |
recipes | The Is* interfaces each collection implements (including IsScopedCollection), their iterators, and Runnable |
services | Tree-walking helpers (parseTree, parseTreeNext) and other collection-agnostic utilities |
npm install
npm test # the tests
npm run typecheck # the types
npm run build # dist/, browser/ and docs/
npm run docs # only the documentation