Bump packages to fix linter
This commit is contained in:
parent
ed9506bbaf
commit
0a11e3fdd9
6063 changed files with 378752 additions and 306784 deletions
22
node_modules/nise/lib/fake-xhr/index.js
generated
vendored
22
node_modules/nise/lib/fake-xhr/index.js
generated
vendored
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue