0.3.0 • Published 5 years ago
@perfective/match v0.3.0
Match
The @perfective/match package provides functions and types for the pattern matching.
match<T>(value: T | Nullary<T>): Match<T>Match.that<U>(...statements: Statement<T, U>[]): Maybe<U>Match.to<U>(statements: Statement<T, U>[]): Maybe<U>— applies the given value to theStatement.conditionpredicate until the first one match, returns the result of applying the value to theStatement.evaluatefunction; when match is not found, returnsNothing.
when<T>(condition: T | Predicate<T>): When<T>—Statement<T, U>builder; *then<U>(value: U | Unary<T, U>): Statement<T, U>statements<T, U>(entries: StatementEntry<T, U>[]): Statement<T, U>[]— creates statements from an array of tuples[Predicate<T>, Unary<T, U>].
Read the full documentation in the repository.
0.3.0
5 years ago
0.3.0-alpha
5 years ago
0.2.2
5 years ago
0.2.1
5 years ago
0.2.0
5 years ago
0.2.0-beta.1
5 years ago
0.2.0-beta
5 years ago
0.2.0-alpha.2
5 years ago
0.2.0-alpha.1
5 years ago
0.2.0-alpha
5 years ago
0.1.0
5 years ago