prelude

@prelude/generator · v10.0.1

SourceAPI referenceChangelognpm

Generator module

A TypeScript library for working with iterables and generators, providing a rich set of utility functions for functional programming patterns.

Installation

npm i -E @prelude/generator

Usage

import * as G from '@prelude/generator'

console.log(G.pipe(
  G.charRange('a', 'c'),
  G.cycle,
  G.take(10),
  G.array
))
// [
//   'a', 'b', 'c', 'a',
//   'b', 'c', 'a', 'b',
//   'c', 'a'
// ]

API Reference

Functions

License

This package is dedicated to the public domain under CC0 1.0.