MCPcopy Create free account
hub / github.com/BloombergGraphics/whatiscode / decode

Function decode

scripts/libs/fetch.js:219–230  ·  view source on GitHub ↗
(body)

Source from the content-addressed store, hash-verified

217 }
218
219 function decode(body) {
220 var form = new FormData()
221 body.trim().split('&').forEach(function(bytes) {
222 if (bytes) {
223 var split = bytes.split('=')
224 var name = split.shift().replace(/\+/g, ' ')
225 var value = split.join('=').replace(/\+/g, ' ')
226 form.append(decodeURIComponent(name), decodeURIComponent(value))
227 }
228 })
229 return form
230 }
231
232 function headers(xhr) {
233 var head = new Headers()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected