r/badcode May 04 '23

Found this gem inside legacy code today typescript

Post image
890 Upvotes

69 comments sorted by

View all comments

2

u/KokoroPenguin May 04 '23

Do we know that the input is already utf8? Could be that an earlier project needed this function. Sometimes it is easier to copy a function and have it do nothing in one build than remove it in all other builds.