Sha256: f4f26c34f3f2c919153767f0ec4fefff4f9c0a9b3c83998af3f196bcca7bb0aa
Contents?: true
Size: 719 Bytes
Versions: 26
Compression:
Stored size: 719 Bytes
Contents
import { invariant } from "outvariant"; function bypass(input, init) { const request = new Request( // If given a Request instance, clone it not to exhaust // the original request's body. input instanceof Request ? input.clone() : input, init ); invariant( !request.bodyUsed, 'Failed to create a bypassed request to "%s %s": given request instance already has its body read. Make sure to clone the intercepted request if you wish to read its body before bypassing it.', request.method, request.url ); const requestClone = request.clone(); requestClone.headers.set("x-msw-intention", "bypass"); return requestClone; } export { bypass }; //# sourceMappingURL=bypass.mjs.map
Version data entries
26 entries across 26 versions & 1 rubygems