-
Notifications
You must be signed in to change notification settings - Fork 121
fix: sanitize typescript bindings #2349
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds comprehensive sanitization for TypeScript bindings generation to prevent build errors caused by unsafe characters in identifiers, strings, and documentation comments. The implementation introduces three sanitization functions and applies them throughout the code generation pipeline.
Key changes:
- Added three sanitization functions:
sanitize_doc,sanitize_identifier, andsanitize_string - Applied sanitization to all identifier names, string literals, and documentation strings across the TypeScript code generation
- Added comprehensive test coverage for the sanitization functions and their integration points
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks for noting in the PR and the code that the sanitising doesn't prevent invalid names or keyword collision. That is something we should address here separately and/or in the js-stellar-sdk so that contracts that collide are still supported.
Opened: |
* Bump version to 23.4.1 * fix: sanitize typescript bindings (#2349) --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
What
Sanitize all identifier names, strings, and docs before generating typescript bindings
Why
Prevents build errors
Known limitations
Does not check for protected JS names (like class).