MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / decode

Function decode

packages/core/fetch/index.mjs:368–382  ·  view source on GitHub ↗
(body)

Source from the content-addressed store, hash-verified

366 };
367
368 function decode(body) {
369 var form = new FormData();
370 body
371 .trim()
372 .split("&")
373 .forEach(function (bytes) {
374 if (bytes) {
375 var split = bytes.split("=");
376 var name = split.shift().replace(/\+/g, " ");
377 var value = split.join("=").replace(/\+/g, " ");
378 form.append(decodeURIComponent(name), decodeURIComponent(value));
379 }
380 });
381 return form;
382 }
383
384 function parseHeaders(rawHeaders) {
385 var headers = new Headers();

Callers

nothing calls this directly

Calls 5

appendMethod · 0.95
forEachMethod · 0.80
replaceMethod · 0.80
shiftMethod · 0.80
joinMethod · 0.80

Tested by

no test coverage detected