@serwist/streams 8.3.0 → 8.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -56,9 +56,8 @@ var internal = require('@serwist/core/internal');
56
56
  return readerPromises[i].then((reader)=>{
57
57
  if (reader instanceof ReadableStreamDefaultReader) {
58
58
  return reader.read();
59
- } else {
60
- return;
61
59
  }
60
+ return;
62
61
  }).then((result)=>{
63
62
  if (result?.done) {
64
63
  if (process.env.NODE_ENV !== "production") {
@@ -88,9 +87,8 @@ var internal = require('@serwist/core/internal');
88
87
  }
89
88
  // The `pull` method is defined because we're inside it.
90
89
  return this.pull(controller);
91
- } else {
92
- controller.enqueue(result?.value);
93
90
  }
91
+ controller.enqueue(result?.value);
94
92
  }).catch((error)=>{
95
93
  if (process.env.NODE_ENV !== "production") {
96
94
  internal.logger.error("An error occurred:", error);
@@ -204,7 +202,7 @@ var internal = require('@serwist/core/internal');
204
202
  return response;
205
203
  }
206
204
  if (process.env.NODE_ENV !== "production") {
207
- internal.logger.log(`The current browser doesn't support creating response ` + `streams. Falling back to non-streaming response instead.`);
205
+ internal.logger.log(`The current browser doesn't support creating response ` + "streams. Falling back to non-streaming response instead.");
208
206
  }
209
207
  // Fallback to waiting for everything to finish, and concatenating the
210
208
  // responses.
@@ -212,13 +210,12 @@ var internal = require('@serwist/core/internal');
212
210
  const source = await sourcePromise;
213
211
  if (source instanceof Response) {
214
212
  return source.blob();
215
- } else {
216
- // Technically, a `StreamSource` object can include any valid
217
- // `BodyInit` type, including `FormData` and `URLSearchParams`, which
218
- // cannot be passed to the Blob constructor directly, so we have to
219
- // convert them to actual Blobs first.
220
- return new Response(source).blob();
221
213
  }
214
+ // Technically, a `StreamSource` object can include any valid
215
+ // `BodyInit` type, including `FormData` and `URLSearchParams`, which
216
+ // cannot be passed to the Blob constructor directly, so we have to
217
+ // convert them to actual Blobs first.
218
+ return new Response(source).blob();
222
219
  });
223
220
  const blobParts = await Promise.all(blobPartsPromises);
224
221
  const headers = createHeaders(headersInit);
package/dist/index.js CHANGED
@@ -54,9 +54,8 @@ import { assert, Deferred, logger, SerwistError, canConstructReadableStream } fr
54
54
  return readerPromises[i].then((reader)=>{
55
55
  if (reader instanceof ReadableStreamDefaultReader) {
56
56
  return reader.read();
57
- } else {
58
- return;
59
57
  }
58
+ return;
60
59
  }).then((result)=>{
61
60
  if (result?.done) {
62
61
  if (process.env.NODE_ENV !== "production") {
@@ -86,9 +85,8 @@ import { assert, Deferred, logger, SerwistError, canConstructReadableStream } fr
86
85
  }
87
86
  // The `pull` method is defined because we're inside it.
88
87
  return this.pull(controller);
89
- } else {
90
- controller.enqueue(result?.value);
91
88
  }
89
+ controller.enqueue(result?.value);
92
90
  }).catch((error)=>{
93
91
  if (process.env.NODE_ENV !== "production") {
94
92
  logger.error("An error occurred:", error);
@@ -202,7 +200,7 @@ import { assert, Deferred, logger, SerwistError, canConstructReadableStream } fr
202
200
  return response;
203
201
  }
204
202
  if (process.env.NODE_ENV !== "production") {
205
- logger.log(`The current browser doesn't support creating response ` + `streams. Falling back to non-streaming response instead.`);
203
+ logger.log(`The current browser doesn't support creating response ` + "streams. Falling back to non-streaming response instead.");
206
204
  }
207
205
  // Fallback to waiting for everything to finish, and concatenating the
208
206
  // responses.
@@ -210,13 +208,12 @@ import { assert, Deferred, logger, SerwistError, canConstructReadableStream } fr
210
208
  const source = await sourcePromise;
211
209
  if (source instanceof Response) {
212
210
  return source.blob();
213
- } else {
214
- // Technically, a `StreamSource` object can include any valid
215
- // `BodyInit` type, including `FormData` and `URLSearchParams`, which
216
- // cannot be passed to the Blob constructor directly, so we have to
217
- // convert them to actual Blobs first.
218
- return new Response(source).blob();
219
211
  }
212
+ // Technically, a `StreamSource` object can include any valid
213
+ // `BodyInit` type, including `FormData` and `URLSearchParams`, which
214
+ // cannot be passed to the Blob constructor directly, so we have to
215
+ // convert them to actual Blobs first.
216
+ return new Response(source).blob();
220
217
  });
221
218
  const blobParts = await Promise.all(blobPartsPromises);
222
219
  const headers = createHeaders(headersInit);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serwist/streams",
3
- "version": "8.3.0",
3
+ "version": "8.4.1",
4
4
  "type": "module",
5
5
  "description": "A library that makes it easier to work with Streams in the browser.",
6
6
  "files": [
@@ -19,7 +19,7 @@
19
19
  "license": "MIT",
20
20
  "repository": "serwist/serwist",
21
21
  "bugs": "https://github.com/serwist/serwist/issues",
22
- "homepage": "https://serwist.vercel.app",
22
+ "homepage": "https://serwist.pages.dev",
23
23
  "module": "./dist/index.js",
24
24
  "main": "./dist/index.cjs",
25
25
  "types": "./dist/index.d.ts",
@@ -37,16 +37,17 @@
37
37
  "./package.json": "./package.json"
38
38
  },
39
39
  "dependencies": {
40
- "@serwist/core": "8.3.0",
41
- "@serwist/routing": "8.3.0"
40
+ "@serwist/core": "8.4.1",
41
+ "@serwist/routing": "8.4.1"
42
42
  },
43
43
  "devDependencies": {
44
44
  "rollup": "4.9.1",
45
- "@serwist/constants": "8.3.0"
45
+ "@serwist/constants": "8.4.1"
46
46
  },
47
47
  "scripts": {
48
48
  "build": "rimraf dist && cross-env NODE_ENV=production rollup --config rollup.config.js",
49
- "lint": "eslint src --ext ts,tsx,js,jsx,cjs,mjs",
49
+ "dev": "rollup --config rollup.config.js --watch",
50
+ "lint": "biome lint ./src",
50
51
  "typecheck": "tsc"
51
52
  }
52
53
  }