Skip to content

Commit

Permalink
Meta tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Aug 26, 2023
1 parent 277ada2 commit 5812991
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
matrix:
typescript-version:
- "latest"
- "~5.2.0"
- "~5.1.0"
steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"@sindresorhus/tsconfig": "~0.7.0",
"expect-type": "^0.15.0",
"tsd": "^0.28.1",
"typescript": "^5.0.4",
"xo": "^0.55.0"
"typescript": "^5.2.2",
"xo": "^0.56.0"
},
"xo": {
"rules": {
Expand Down
10 changes: 5 additions & 5 deletions source/opaque.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ A type returned by `Tagged` can be passed to `Tagged` again, to create a type wi
[Read more about tagged types.](https://medium.com/@KevinBGreene/surviving-the-typescript-ecosystem-branding-and-type-tagging-6cf6e516523d)
There have been several discussions about adding similar features to TypeScript. Unfortunately, nothing has (yet) moved forward:
- [Microsoft/TypeScript#202](https://github.com/microsoft/TypeScript/issues/202)
- [Microsoft/TypeScript#4895](https://github.com/microsoft/TypeScript/issues/4895)
- [Microsoft/TypeScript#33290](https://github.com/microsoft/TypeScript/pull/33290)
- [Microsoft/TypeScript#202](https://github.com/microsoft/TypeScript/issues/202)
- [Microsoft/TypeScript#4895](https://github.com/microsoft/TypeScript/issues/4895)
- [Microsoft/TypeScript#33290](https://github.com/microsoft/TypeScript/pull/33290)
@example
```
Expand All @@ -140,11 +140,11 @@ type AccountBalance = Tagged<number, 'AccountBalance'>;
function createAccountNumber(): AccountNumber {
// As you can see, casting from a `number` (the underlying type being tagged) is allowed.
return 2 as AccountNumber;
return 2 as AccountNumber;
}
function getMoneyForAccount(accountNumber: AccountNumber): AccountBalance {
return 4 as AccountBalance;
return 4 as AccountBalance;
}
// This will compile successfully.
Expand Down

0 comments on commit 5812991

Please sign in to comment.