Skip to content

feat: add safe version of some of TypeScript's private type guards #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

RebeccaStevens
Copy link
Collaborator

@RebeccaStevens RebeccaStevens commented Feb 12, 2023

PR Checklist

Overview

Based off #49

Recreates the logic of bunch of type guards defined in TypeScript's private API.
The logic slightly differs from TypeScript's in-order to make the function "safe".

For example: TypeScript's isExpression is designed to work with partially emitted node while this version requires fully emitted nodes.

@codecov
Copy link

codecov bot commented Feb 12, 2023

Codecov Report

Merging #50 (9033fdd) into main (b5def87) will decrease coverage by 3.29%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main      #50      +/-   ##
==========================================
- Coverage   14.50%   11.22%   -3.29%     
==========================================
  Files          15       16       +1     
  Lines         393      508     +115     
  Branches      160      227      +67     
==========================================
  Hits           57       57              
- Misses        333      448     +115     
  Partials        3        3              
Impacted Files Coverage Δ
src/nodes/typeGuards/private.ts 0.00% <0.00%> (ø)
src/nodes/utilities.ts 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@RebeccaStevens RebeccaStevens changed the title feat: add safe version of some type guards defined in TS private API feat: add safe version of some of TypeScript's private type guards Feb 12, 2023
@JoshuaKGoldberg
Copy link
Owner

Marking as blocked on microsoft/TypeScript#52727 - I'd like to see what the TS team is open to, in case we don't need to re-implement these

@JoshuaKGoldberg JoshuaKGoldberg added the status: blocked Waiting for something else to be resolved 🙅 label Feb 12, 2023
@RebeccaStevens
Copy link
Collaborator Author

Closing for now as a lot of these are coming in TS 5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: blocked Waiting for something else to be resolved 🙅
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants