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

Check for isNamedTupleMember and isIdentifierOrPrivateIdentifier before calling to restore backward compatibility with typescript 3.7.5 and 3.9.7 respectively #1361

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/converter/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ export class Context {

function isNamedNode(node: ts.Node): node is ts.Node & { name: ts.Identifier | ts.PrivateIdentifier | ts.ComputedPropertyName } {
return node['name'] && (
ts.isIdentifierOrPrivateIdentifier(node['name']) ||
ts.isIdentifierOrPrivateIdentifier && ts.isIdentifierOrPrivateIdentifier(node['name']) ||
ts.isComputedPropertyName(node['name'])
);
}
2 changes: 1 addition & 1 deletion src/lib/converter/types/tuple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class TupleConverter extends ConverterTypeComponent implements TypeConver
@Component({ name: 'type:named-tuple-member' })
export class NamedTupleMemberConverter extends ConverterTypeComponent implements TypeNodeConverter<ts.Type, ts.NamedTupleMember> {
supportsNode(_context: Context, node: ts.Node) {
return ts.isNamedTupleMember(node);
return ts.isNamedTupleMember && ts.isNamedTupleMember(node);
}

convertNode(context: Context, node: ts.NamedTupleMember): NamedTupleMember | undefined {
Expand Down