summaryrefslogtreecommitdiff
path: root/op_crates/fetch
diff options
context:
space:
mode:
Diffstat (limited to 'op_crates/fetch')
-rw-r--r--op_crates/fetch/11_streams.js23
-rw-r--r--op_crates/fetch/26_fetch.js5
-rw-r--r--op_crates/fetch/lib.deno_fetch.d.ts10
3 files changed, 27 insertions, 11 deletions
diff --git a/op_crates/fetch/11_streams.js b/op_crates/fetch/11_streams.js
index b182a96ed..1c1889e09 100644
--- a/op_crates/fetch/11_streams.js
+++ b/op_crates/fetch/11_streams.js
@@ -7,10 +7,23 @@
// comments which point to steps of the specification that are not implemented.
((window) => {
- /* eslint-disable @typescript-eslint/no-explicit-any,require-await */
-
const customInspect = Symbol.for("Deno.customInspect");
+ function cloneArrayBuffer(
+ srcBuffer,
+ srcByteOffset,
+ srcLength,
+ _cloneConstructor,
+ ) {
+ // this function fudges the return type but SharedArrayBuffer is disabled for a while anyway
+ return srcBuffer.slice(
+ srcByteOffset,
+ srcByteOffset + srcLength,
+ );
+ }
+
+ const objectCloneMemo = new WeakMap();
+
/** Clone a value in a similar way to structured cloning. It is similar to a
* StructureDeserialize(StructuredSerialize(...)). */
function cloneValue(value) {
@@ -88,6 +101,7 @@
}
case "symbol":
case "function":
+ // fallthrough
default:
throw new DOMException("Uncloneable value in stream", "DataCloneError");
}
@@ -2151,10 +2165,10 @@
let canceled2 = false;
let reason1 = undefined;
let reason2 = undefined;
- /* eslint-disable prefer-const */
+ // deno-lint-ignore prefer-const
let branch1;
+ // deno-lint-ignore prefer-const
let branch2;
- /* eslint-enable prefer-const */
const cancelPromise = getDeferred();
const pullAlgorithm = () => {
if (reading) {
@@ -3365,7 +3379,6 @@
}
stream[sym.backpressure] = backpressure;
}
- /* eslint-enable */
class CountQueuingStrategy {
constructor({ highWaterMark }) {
diff --git a/op_crates/fetch/26_fetch.js b/op_crates/fetch/26_fetch.js
index c8b2c8794..d0bc6d979 100644
--- a/op_crates/fetch/26_fetch.js
+++ b/op_crates/fetch/26_fetch.js
@@ -166,6 +166,7 @@
if (typeof str !== "string") {
return false;
}
+ // deno-lint-ignore no-control-regex
return /^[\x00-\x7F]*$/.test(str);
}
@@ -1349,7 +1350,8 @@
});
return new Response(null, responseInit);
case "follow":
- default:
+ // fallthrough
+ default: {
let redirectUrl = response.headers.get("Location");
if (redirectUrl == null) {
return response; // Unspecified
@@ -1363,6 +1365,7 @@
url = redirectUrl;
redirected = true;
remRedirectCount--;
+ }
}
} else {
return response;
diff --git a/op_crates/fetch/lib.deno_fetch.d.ts b/op_crates/fetch/lib.deno_fetch.d.ts
index 4a51bcc95..0b3036e2c 100644
--- a/op_crates/fetch/lib.deno_fetch.d.ts
+++ b/op_crates/fetch/lib.deno_fetch.d.ts
@@ -1,6 +1,6 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
-/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, no-var */
+// deno-lint-ignore-file no-explicit-any
/// <reference no-default-lib="true" />
/// <reference lib="esnext" />
@@ -101,7 +101,7 @@ interface QueuingStrategy<T = any> {
size?: QueuingStrategySizeCallback<T>;
}
-/** This Streams API interface provides a built-in byte length queuing strategy
+/** This Streams API interface provides a built-in byte length queuing strategy
* that can be used when constructing streams. */
declare class CountQueuingStrategy implements QueuingStrategy {
constructor(options: { highWaterMark: number });
@@ -182,7 +182,7 @@ interface UnderlyingSink<W = any> {
write?: WritableStreamDefaultControllerWriteCallback<W>;
}
-/** This Streams API interface provides a standard abstraction for writing
+/** This Streams API interface provides a standard abstraction for writing
* streaming data to a destination, known as a sink. This object comes with
* built-in backpressure and queuing. */
declare class WritableStream<W = any> {
@@ -351,8 +351,8 @@ type HeadersInit = Headers | string[][] | Record<string, string>;
/** This Fetch API interface allows you to perform various actions on HTTP
* request and response headers. These actions include retrieving, setting,
* adding to, and removing. A Headers object has an associated header list,
- * which is initially empty and consists of zero or more name and value pairs.
- *  You can add to this using methods like append() (see Examples.) In all
+ * which is initially empty and consists of zero or more name and value pairs.
+ * You can add to this using methods like append() (see Examples). In all
* methods of this interface, header names are matched by case-insensitive byte
* sequence. */
interface Headers {