Skip to content
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

Add support for basic TS assertion signature syntax #504

Merged
merged 1 commit into from
Jan 13, 2020

Conversation

alangpierce
Copy link
Owner

Fixes #503

The previous code didn't handle the basic case asserts x, which I just
overlooked when backporting Babel parser changes. The new code has a special
case for that and conditionally tells the caller whether to parse a type
afterward. I also made the contract a little simpler; it either fully parses the
return type or it doesn't.

Fixes #503

The previous code didn't handle the basic case `asserts x`, which I just
overlooked when backporting Babel parser changes. The new code has a special
case for that and conditionally tells the caller whether to parse a type
afterward. I also made the contract a little simpler; it either fully parses the
return type or it doesn't.
@codecov-io
Copy link

Codecov Report

Merging #504 into master will decrease coverage by 0.09%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #504     +/-   ##
=========================================
- Coverage   82.68%   82.59%   -0.1%     
=========================================
  Files          55       55             
  Lines        5608     5383    -225     
  Branches     1261     1263      +2     
=========================================
- Hits         4637     4446    -191     
+ Misses        681      650     -31     
+ Partials      290      287      -3
Impacted Files Coverage Δ
src/parser/plugins/typescript.ts 80.82% <100%> (+0.23%) ⬆️
src/Options-gen-types.ts 75% <0%> (-25%) ⬇️
src/util/getDeclarationInfo.ts 80% <0%> (-20%) ⬇️
src/util/elideImportEquals.ts 81.81% <0%> (-18.19%) ⬇️
src/util/isAsyncOperation.ts 82.35% <0%> (-17.65%) ⬇️
src/util/shouldElideDefaultExport.ts 68.75% <0%> (-9.03%) ⬇️
src/parser/index.ts 77.77% <0%> (-7.94%) ⬇️
src/computeSourceMap.ts 83.33% <0%> (-5.56%) ⬇️
src/util/getNonTypeIdentifiers.ts 94.44% <0%> (-5.56%) ⬇️
src/parser/plugins/types.ts 91.66% <0%> (-3.34%) ⬇️
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8e4afa1...1c3525c. Read the comment docs.

@alangpierce alangpierce merged commit c1976a6 into master Jan 13, 2020
@alangpierce alangpierce deleted the add-ts-assertion-signature-syntax branch January 13, 2020 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeScript 3.7 assertion signature syntax not working
2 participants