项目作者: hogiagroup

项目描述 :
Utilities for Iterables in TypeScript/JavaScript.
高级语言: TypeScript
项目地址: git://github.com/hogiagroup/enumerable.git
创建时间: 2021-01-08T14:21:41Z
项目社区:https://github.com/hogiagroup/enumerable

开源协议:MIT License

下载


Introduction

This library contains the utility class Enumerable, which implements Iterable and provides a number of methods for
operating on Iterables.

Installation

Install with npm install @hogiagroup/enumerable.

Getting Started

The main class is Enumerable, which can be instantiated with an existing Iterable instance or as empty. Enumerables can then be built by successively chaining methods to the original instance; Enumerable objects themselves are immutable insofar as that all methods are pure (free from side effects), but care should be taken not to modify the source iterable.

Any generator function can be made to return an Enumerable by use of the @enumerable decorator. @enumerable accepts an optional argument validator, a callback which validates input to the decorated function immediately, rather than at evaluation time.

The class PivotSelectionStrategies contains predefined functions for selecting pivot elements for the quickSort function.

Build and Test

To build, run ‘npm run build’. Tests are run with ‘npm run test’ or ‘npm run tdd’ (auto-watch).

Contribute

Submit a pull request.