Skip to content

fix: replace Buffer operations with string methods to resolve deprecation warning#31

Closed
BrenoRev wants to merge 1 commit intoapify:masterfrom
BrenoRev:master
Closed

fix: replace Buffer operations with string methods to resolve deprecation warning#31
BrenoRev wants to merge 1 commit intoapify:masterfrom
BrenoRev:master

Conversation

@BrenoRev
Copy link
Copy Markdown

@BrenoRev BrenoRev commented Jun 9, 2025

#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)

@jancurn jancurn requested a review from gippy June 9, 2025 20:21
@BrenoRev
Copy link
Copy Markdown
Author

@jancurn @gippy any update?

@gippy
Copy link
Copy Markdown
Member

gippy commented Jun 20, 2025

@jancurn @gippy any update?

Sorry, this sprint is pretty busy, I'm planning to check this PR around Wednesday next week.

@BrenoRev
Copy link
Copy Markdown
Author

@jancurn @gippy any update?

Sorry, this sprint is pretty busy, I'm planning to check this PR around Wednesday next week.

ok

@BrenoRev
Copy link
Copy Markdown
Author

BrenoRev commented Jul 7, 2025

@gippy any update?

@jancurn
Copy link
Copy Markdown
Member

jancurn commented Jul 24, 2025

I'm bit afraid this could have a performance impact, as the buffer had pre-allocated size, while the string concatenation does not...

@BrenoRev
Copy link
Copy Markdown
Author

I'm bit afraid this could have a performance impact, as the buffer had pre-allocated size, while the string concatenation does not...

Is there any solution to remove the Buffer?

@BrenoRev
Copy link
Copy Markdown
Author

@jancurn How could i help?

@jancurn
Copy link
Copy Markdown
Member

jancurn commented Oct 21, 2025

Is there some way to just ignore the deprecation warning or use some other Buffer constructor, but keep the logic as is? We need to be sure this will not negatively affect the performance

@BrenoRev BrenoRev closed this Mar 30, 2026
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.

4 participants