fix: replace Buffer operations with string methods to resolve deprecation warning#31
Closed
BrenoRev wants to merge 1 commit intoapify:masterfrom
Closed
fix: replace Buffer operations with string methods to resolve deprecation warning#31BrenoRev wants to merge 1 commit intoapify:masterfrom
BrenoRev wants to merge 1 commit intoapify:masterfrom
Conversation
Author
Member
Author
Author
|
@gippy any update? |
Member
|
I'm bit afraid this could have a performance impact, as the buffer had pre-allocated size, while the string concatenation does not... |
Author
Is there any solution to remove the Buffer? |
Author
|
@jancurn How could i help? |
Member
|
Is there some way to just ignore the deprecation warning or use some other |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#30
Issue Fixed
This change addresses the Node.js deprecation warning:
What Changed
Replaced Buffer-based operations in the sanitize() function with pure string methods to eliminate deprecated Buffer constructor usage. The implementation now uses JavaScript's native string operations (split(), filter(), and join()) while maintaining the same XML character filtering behavior.
Benefits
Eliminates deprecation warnings that were causing Lambda function failures
Maintains the same output as the previous implementation
Improves security by avoiding potential Buffer-related vulnerabilities
Better handles edge cases (null/undefined values)