Skip to content

Commit af408c6

Browse files
chore(changesets): bump package version (#10)
chore: bump package version Co-authored-by: Luke Morales <lukemorales@live.com>
1 parent aec6f75 commit af408c6

File tree

4 files changed

+3696
-3101
lines changed

4 files changed

+3696
-3101
lines changed

.changeset/thin-dancers-reply.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
# exhaustive
22

3+
## 1.1.2
4+
5+
### Patch Changes
6+
7+
- [`aec6f75`](https://github.com/lukemorales/exhaustive/commit/aec6f75dcd2b92415419024290db4b03ef6ef8d5) Thanks [@lukemorales](https://github.com/lukemorales)! - Improve inference of return types with new generic value
8+
9+
The return type of `exhaustive` and `exhaustive.tag` will now be inferred based on the return type of the callback function.
10+
11+
```ts
12+
type Union = "IDLE" | "LOADING" | "SUCCESS" | "ERROR";
13+
14+
type HumanReadableUnion = "idle" | "loading" | "success" | "error";
15+
16+
function unionToHumanReadableString(union: Union): HumanReadableUnion {
17+
return exhaustive(union, {
18+
IDLE: () => "idle",
19+
LOADING: () => "loading",
20+
SUCCESS: () => "success",
21+
ERROR: (value) => value.toLowerCase(), // type `string` is not assignable to type `HumanReadableUnion`
22+
});
23+
}
24+
```
25+
326
## 1.1.1
427

528
### Patch Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "exhaustive",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "Exhaustiveness checking in TypeScript",
55
"author": "Luke Morales <lukemorales@live.com>",
66
"license": "MIT",

0 commit comments

Comments
 (0)