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

[Fix] Add support for ParenthesisTypeNodes #152

Closed

Conversation

tvillaren
Copy link
Collaborator

Why

As reported by @anthony-dandrea in #148 (comment), it doesn't work when there are parenthesis around the types:

// DoesntWork.ts
import type { BoolValue } from "google/protobuf/BoolValue";
export interface Broken {
  bool: (BoolValue | null);
}

// DoesWork.ts
import type { BoolValue } from "google/protobuf/BoolValue";
export interface Works {
  bool: BoolValue | null;
}

// google/protobuf/BoolValue.ts
export interface BoolValue {
  'value': (boolean);
}

This PR fixes this issue

@codecov-commenter
Copy link

Codecov Report

Merging #152 (690ec55) into main (8d3b297) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##             main     #152      +/-   ##
==========================================
+ Coverage   97.33%   97.34%   +0.01%     
==========================================
  Files          14       14              
  Lines         676      679       +3     
  Branches      275      269       -6     
==========================================
+ Hits          658      661       +3     
  Misses         18       18              
Files Changed Coverage Δ
src/utils/traverseTypes.ts 100.00% <100.00%> (ø)

@tvillaren
Copy link
Collaborator Author

Closing, included in https://github.com/fabien0102/ts-to-zod/pull/159/files

@tvillaren tvillaren closed this Sep 20, 2023
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.

2 participants