TypeMatch
A tiny TypeScript library for pattern matching with focus on type safety.
Introdution
Pattern matching is very popular in functional programming, and there are several libraries that try to bring it to JavaScript, such as pun.
This library is an attempt to provide similar functionality with emphasis on type safety using TypeScript.
How to use it
; // Importing wildcard;
Type safety using JavaScript
You can use this library with JavaScript and have code completion with Visual Studio Code.
To do so, just include reference to the typings definition on the top of your code.
/// <reference path="node_modules/typematch/bin/src/bundle.d.ts" />