We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Example code
export interface Options { a: number; b: string } export function addSchema(opts: Options): void { const { a } = opts; }
Result AST
[ factory.createInterfaceDeclaration( [factory.createToken(ts.SyntaxKind.ExportKeyword)], factory.createIdentifier("Options"), undefined, undefined, [ factory.createPropertySignature( undefined, factory.createIdentifier("a"), undefined, factory.createKeywordTypeNode(ts.SyntaxKind.NumberKeyword) ), factory.createPropertySignature( undefined, factory.createIdentifier("b"), undefined, factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword) ) ] ), factory.createFunctionDeclaration( [factory.createToken(ts.SyntaxKind.ExportKeyword)], undefined, factory.createIdentifier("addSchema"), undefined, [factory.createParameterDeclaration( undefined, undefined, factory.createIdentifier("opts"), undefined, factory.createTypeReferenceNode( factory.createIdentifier("Options"), undefined ), undefined )], factory.createKeywordTypeNode(ts.SyntaxKind.VoidKeyword), factory.createBlock( [factory.createVariableStatement( undefined, factory.createVariableDeclarationList( [factory.createVariableDeclaration( factory.createObjectBindingPattern([factory.createBindingElement( undefined, undefined, factory.createIdentifier("a"), undefined )]), undefined, undefined, factory.createIdentifier("opts") )], ts.NodeFlags.Const | ts.NodeFlags.Constant | ts.NodeFlags.Constant ) )], true ) ) ];
You can see it generated ts.NodeFlags.Const | ts.NodeFlags.Constant | ts.NodeFlags.Constant when it should be ts.NodeFlags.Const.
ts.NodeFlags.Const | ts.NodeFlags.Constant | ts.NodeFlags.Constant
ts.NodeFlags.Const
When you use the generated AST, it generates
await using { a } = opts;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Example code
Result AST
You can see it generated
ts.NodeFlags.Const | ts.NodeFlags.Constant | ts.NodeFlags.Constant
when it should bets.NodeFlags.Const
.When you use the generated AST, it generates
The text was updated successfully, but these errors were encountered: