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
functionbyteLength(str){// TODO: consider making a robust utility in `@stdlib/buffer/byte-length`
93
+
if(SUPPORTS_BUFFER){
94
+
returnbuffer2bytelength(str);
95
+
}
96
+
// Earlier versions of Node.js do not support Buffers, ArrayBuffers, TypedArrays, DataViews, or SharedArrayBuffers, so we need to explicitly call `#.toString()`...
97
+
returnbuffer2bytelength(str.toString());
98
+
}
99
+
83
100
84
101
// MAIN //
85
102
@@ -270,9 +287,7 @@ function httpServer( options ) {
270
287
debug('Sending HTML...');
271
288
response.statusCode=200;
272
289
response.setHeader('Content-Type','text/html');
273
-
274
-
// TODO: we have to convert to a `string` because Node v0.10 requires a `string`. Subsequent versions support providing a `Buffer` object. Ideally, we would sniff `Buffer` support and only convert to a `string` if necessary.
// TODO: we have to convert to a `string` because Node v0.10 requires a `string`. Subsequent versions support providing a `Buffer` object. Ideally, we would sniff `Buffer` support and only convert to a `string` if necessary.
0 commit comments