@typed-f/matchable
Version:
[![NPM Version][matchable-npm-version-badge]][matchable-npm] [repo-circleci-badge]: https://img.shields.io/circleci/project/github/Ailrun/typed-f/master.svg?logo=circleci [![Known Vulnerabilities][matchable-snyk-badge]][matchable-snyk] [![Supported TypeSc
23 lines (19 loc) • 386 B
text/typescript
/*
* Copyright 2018-present Junyoung Clare Jang
*/
import { Fun } from '@typed-f/function';
export interface MatchPatterns<U> {
[key: string]: Fun<any[], U>;
}
export interface Matchable {
/**
* @desc
* `Matchable` methods
*/
matchWith<U>(patterns: MatchPatterns<U>): U;
/**
* @desc
* alias of `matchWith`
*/
caseOf<U>(patterns: MatchPatterns<U>): U;
}