You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tested it locally doing something like this. I haven't fully performance tested. I can open a PR if you're open to the idea
constbuffer=require('node:buffer');// .../* istanbul ignore else */if(!process.env.WS_NATIVE_UTF8_VALIDATE&&typeofbuffer.isUtf8==='function'){try{console.log("Using native Utf8!");module.exports.isValidUTF8=buffer.isUtf8;}catch(e){// Continue regardless of the error.}}elseif(!process.env.WS_NO_UTF_8_VALIDATE){try{constisValidUTF8=require('utf-8-validate');module.exports.isValidUTF8=function(buf){returnbuf.length<150 ? _isValidUTF8(buf) : isValidUTF8(buf);};}catch(e){// Continue regardless of the error.}}
and it seemed to work ok
ws version
8.11.0
Node.js Version
19.4.0
System
N/A
Expected result
N/A
Actual result
N/A
Attachments
Testing on my Discord bot
Ran all tests:
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Description
New feature in Node 19.4:
https://nodejs.org/dist/latest-v19.x/docs/api/buffer.html#bufferisutf8input
Tested it locally doing something like this. I haven't fully performance tested. I can open a PR if you're open to the idea
and it seemed to work ok
ws version
8.11.0
Node.js Version
19.4.0
System
N/A
Expected result
N/A
Actual result
N/A
Attachments
Testing on my Discord bot
Ran all tests:
The text was updated successfully, but these errors were encountered: