MCPcopy Index your code
hub / github.com/nodejs/node / isomorphicDecode

Function isomorphicDecode

lib/internal/data_url.js:350–367  ·  view source on GitHub ↗

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

(input)

Source from the content-addressed store, hash-verified

348 * @returns {string}
349 */
350function isomorphicDecode(input) {
351 // 1. To isomorphic decode a byte sequence input, return a string whose code point
352 // length is equal to input's length and whose code points have the same values
353 // as the values of input's bytes, in the same order.
354 const length = input.length;
355 if ((2 << 15) - 1 > length) {
356 return StringFromCharCodeApply(input);
357 }
358 let result = ''; let i = 0;
359 let addition = (2 << 15) - 1;
360 while (i < length) {
361 if (i + addition > length) {
362 addition = length - i;
363 }
364 result += StringFromCharCodeApply(TypedArrayPrototypeSubarray(input, i, i += addition));
365 }
366 return result;
367}
368
369module.exports = {
370 dataURLProcessor,

Callers 1

dataURLProcessorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…