MCPcopy Create free account
hub / github.com/nodejs/node / normalizeBinaryStringToUtf8

Function normalizeBinaryStringToUtf8

deps/undici/src/lib/web/fetch/util.js:82–84  ·  view source on GitHub ↗

* If string contains non-ASCII characters, assumes it's UTF-8 encoded and decodes it. * Since UTF-8 is a superset of ASCII, this will work for ASCII strings as well. * @param {string} value * @returns {string}

(value)

Source from the content-addressed store, hash-verified

80 * @returns {string}
81 */
82function normalizeBinaryStringToUtf8 (value) {
83 return Buffer.from(value, 'binary').toString('utf8')
84}
85
86/** @returns {URL} */
87function requestCurrentURL (request) {

Callers 1

responseLocationURLFunction · 0.70

Calls 2

toStringMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected