Bump packages to fix linter

This commit is contained in:
Henry Mercer 2023-01-18 20:50:03 +00:00
parent ed9506bbaf
commit 0a11e3fdd9
6063 changed files with 378752 additions and 306784 deletions

View file

@ -113,6 +113,18 @@ function verifyResponseBodyType(body, responseType) {
);
error.name = "InvalidBodyException";
}
} else if (responseType === "blob") {
if (
!isString &&
!(body instanceof ArrayBuffer) &&
supportsBlob &&
!(body instanceof Blob)
) {
error = new Error(
`Attempted to respond to fake XMLHttpRequest with ${body}, which is not a string, ArrayBuffer, or Blob.`
);
error.name = "InvalidBodyException";
}
} else if (!isString) {
error = new Error(
`Attempted to respond to fake XMLHttpRequest with ${body}, which is not a string.`
@ -321,7 +333,11 @@ function fakeXMLHttpRequestFor(globalScope) {
function verifyRequestOpened(xhr) {
if (xhr.readyState !== FakeXMLHttpRequest.OPENED) {
throw new Error(`INVALID_STATE_ERR - ${xhr.readyState}`);
const errorMessage =
xhr.readyState === FakeXMLHttpRequest.UNSENT
? "INVALID_STATE_ERR - you might be trying to set the request state for a request that has already been aborted, it is recommended to check 'readyState' first..."
: `INVALID_STATE_ERR - ${xhr.readyState}`;
throw new Error(errorMessage);
}
}
@ -353,6 +369,10 @@ function fakeXMLHttpRequestFor(globalScope) {
return null;
}
} else if (supportsBlob && responseType === "blob") {
if (body instanceof Blob) {
return body;
}
var blobOptions = {};
if (contentType) {
blobOptions.type = contentType;