Skip to content

Small library of Typescript higher-order functions using generics; can use to create literally hundreds of custom functions

License

Notifications You must be signed in to change notification settings

theAlgorithmist/Higher-Order-Functions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Higher-Order Function Library

Simply stated, a higher-order function takes one or more functions as an argument and/or returns a function as a result. Combined with predicates (functions that accept arbitrary inputs and return a boolean), we can construct a small library that replaces the functionality of literally hundreds of hand-coded functions. When combined with Javascript's ability to create functions at runtime by specifying the function body in a string, this process becomes exceptionally powerful.

This library represents my most commonly-used set of higher-order functions. I've used similar collections in the past across multiple environments ranging from C++ in the 1990s to ActionScript to native Javascript to Typescript. I hope you find the library to be useful.

NOTE: This library has been updated and is now part of the AMYR library.

Author: Jim Armstrong - The Algorithmist

@algorithmist

theAlgorithmist [at] gmail [dot] com

Typescript: 3.8.3

Jest: 25.5.3

Version: 1.0

Installation

Installation involves all the usual suspects

  • npm installed globally
  • Clone the repository
  • npm install
  • get coffee (this is the most important step)

Building and running the tests

  1. npm test

  2. Standalone compilation only (npm build)

Specs (_higher-order.spec.ts) reside in the test folder and serve as usage examples for the library.

Enjoy!

License

Apache 2.0

Free Software? Yeah, Homey plays that

About

Small library of Typescript higher-order functions using generics; can use to create literally hundreds of custom functions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published