Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

TypeScript does not have any pattern matching functionality built in. This article shows several ways how you can replicate the core of a simple pattern matcher using a few simple structures and functions within TypeScript. Resulting code will have improved maintainability and better runtime type safety when done right.

License

NotificationsYou must be signed in to change notification settings

swissmanu/pattern-matching-with-typescript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TypeScript does not have any pattern matching functionality built in. This article shows several ways how you can replicate the core of a simple pattern matcher using a few simple structures and functions within TypeScript.

Resulting code will have improved maintainability and better runtime type safety when done right.

This is the backing repository for the article "Pattern Matching with TypeScript" published underhttps://alabor.me/2017/07/05/pattern-matching-with-typescript.html

Examples

Theexamples/ directory contains example code which goes along with the article read. Every example is fully executable.

You can run the examples by cloning or downloading this repository. Runnpm install to installTypeScript andJest.npm test executes the test suite for the examples.

😎 Pro tip: Runnpm test -- --watch if you want to tinker with the code and rerun the test suite automatically.

Article

Github Pages is used to serve the article to you. You find its text and all assets in thegh-pages branch.

Credits

❤️ Thanks to my reviewers for advises and proofreading:

About

TypeScript does not have any pattern matching functionality built in. This article shows several ways how you can replicate the core of a simple pattern matcher using a few simple structures and functions within TypeScript. Resulting code will have improved maintainability and better runtime type safety when done right.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp