Comments (2)
Thanks for opening this well written issue! This was simply an oversight, I would expect the matched value to be readonly []
in the handler function of the .with([], (x) => ...)
expression here. I opened a PR to fix this.
This is technically a type-level breaking change, but I'm going to treat this as a patch since this behavior was unexpected and the fix doesn't affect the runtime.
from ts-pattern.
That was quick. Thanks! <3
from ts-pattern.
Related Issues (20)
- Type '"error"' is not assignable to type 'KnownPattern<"ok"> HOT 6
- Support Awaited<T>
- Many JSDoc examples are incorrect HOT 1
- Object with `any` breaks `.with` chaining HOT 2
- How do I return a string | null from a match HOT 2
- Nullish pattern doesn't work with omitted fields HOT 2
- Seemingly incorrect tuple maching types HOT 1
- Support type predicate return type at `.when()` callback HOT 4
- Type NonExhaustiveError<BoardDto> has no call signatures
- Preventing use of `.exhaustive()` for enum checks HOT 1
- Support point-free style HOT 3
- Select sub-type for exhaustive check. E.g. `.exhaustive(([state, event]) => event.type)`
- Handling of undefined typings in tuples HOT 1
- a way to split long match blocks
- Predicate factory HOT 3
- .safeExhaustive HOT 1
- Deconstruct string matched with `.startsWith`, `.endsWith`, `regex` HOT 2
- How to check if a key of unknown type exists on an object? HOT 3
- Enter multiple pipeline for objects type match HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ts-pattern.