Implement "satisfies" operator in Static TypeScript
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 641
- Avg merge
- 12h 4m
- Merged PRs (30d)
- 57
Description
Feature request template
Is your feature request related to a problem? Please describe.
It would be very nice to be able to use the satisfies operator within PXT projects, as it would finally provide an alternative to as without casting to the specific type.
Describe the solution you'd like
The satisfies operator being implemented into the Static TypeScript compiler, and working similar to the as operator that currently is available for use in PXT.
Describe alternatives you've considered
The only alternative is to use the as keyword, which will cast the value to a different type, potentially causing issues.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Static TypeScript compiler and its existing as operator handling. Compare the requested satisfies behavior with that implementation and identify how compiler coverage is organized. Done means satisfies works in PXT projects without the type-casting behavior described in the request.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100