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

Function isomorphicEncode

deps/undici/src/lib/web/infra/index.js:149–157  ·  view source on GitHub ↗

* @param {string} input * @returns {string} * * @see https://infra.spec.whatwg.org/#isomorphic-encode

(input)

Source from the content-addressed store, hash-verified

147 * @see https://infra.spec.whatwg.org/#isomorphic-encode
148 */
149function isomorphicEncode (input) {
150 // 1. Assert: input contains no code points greater than U+00FF.
151 assert(!invalidIsomorphicEncodeValueRegex.test(input))
152
153 // 2. Return a byte sequence whose length is equal to input’s code
154 // point length and whose bytes have the same values as the
155 // values of input’s code points, in the same order
156 return input
157}
158
159/**
160 * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value

Callers 4

buildContentRangeFunction · 0.50
schemeFetchFunction · 0.50
httpNetworkOrCacheFetchFunction · 0.50
redirectMethod · 0.50

Calls 2

assertFunction · 0.50
testMethod · 0.45

Tested by

no test coverage detected