Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit c77c20b1 authored by Simon Chan's avatar Simon Chan
Browse files

feat: remove dependency on web-streams-polyfill

parent 73553391
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -580,9 +580,6 @@ importers:
      tslib:
        specifier: ^2.6.2
        version: 2.6.2
      web-streams-polyfill:
        specifier: ^4.0.0
        version: 4.0.0
    devDependencies:
      '@jest/globals':
        specifier: ^30.0.0-alpha.2
@@ -4627,11 +4624,6 @@ packages:
    engines: {node: '>= 8'}
    dev: false

  /web-streams-polyfill@4.0.0:
    resolution: {integrity: sha512-0zJXHRAYEjM2tUfZ2DiSOHAa2aw1tisnnhU3ufD57R8iefL+DcdJyRBRyJpG+NUimDgbTI/lH+gAE1PAvV3Cgw==}
    engines: {node: '>= 8'}
    dev: false

  /which-boxed-primitive@1.0.2:
    resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==}
    dependencies:
+1 −1
Original line number Diff line number Diff line
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush.
{
  "pnpmShrinkwrapHash": "bc889a61b743d7da6baea855100853c1762ba21e",
  "pnpmShrinkwrapHash": "b28df542a76f6fa0278a6caf978856555b64b5ff",
  "preferredVersionsHash": "bf21a9e8fbc5a3846fb05b4fa0859e0917b2202f"
}
+1 −2
Original line number Diff line number Diff line
@@ -34,8 +34,7 @@
    "dependencies": {
        "@yume-chan/async": "^2.2.0",
        "@yume-chan/struct": "workspace:^0.0.22",
        "tslib": "^2.6.2",
        "web-streams-polyfill": "^4.0.0"
        "tslib": "^2.6.2"
    },
    "devDependencies": {
        "@jest/globals": "^30.0.0-alpha.2",
+19 −24
Original line number Diff line number Diff line
import type { AbortSignal } from "web-streams-polyfill";
import {
    ReadableStream as ReadableStreamPolyfill,
    TransformStream as TransformStreamPolyfill,
    WritableStream as WritableStreamPolyfill,
} from "web-streams-polyfill";
export * from "web-streams-polyfill";
import type {
    AbortSignal,
    ReadableStream as ReadableStreamType,
    TransformStream as TransformStreamType,
    WritableStream as WritableStreamType,
} from "./types.js";

export * from "./types.js";

/** A controller object that allows you to abort one or more DOM requests as and when desired. */
export interface AbortController {
@@ -26,26 +27,20 @@ interface AbortControllerConstructor {

interface GlobalExtension {
    AbortController: AbortControllerConstructor;
    ReadableStream: typeof ReadableStreamPolyfill;
    WritableStream: typeof WritableStreamPolyfill;
    TransformStream: typeof TransformStreamPolyfill;
    ReadableStream: typeof ReadableStreamType;
    WritableStream: typeof WritableStreamType;
    TransformStream: typeof TransformStreamType;
}

const GLOBAL = globalThis as unknown as GlobalExtension;

export const AbortController = GLOBAL.AbortController;
const Global = globalThis as unknown as GlobalExtension;

export type ReadableStream<R = any> = ReadableStreamPolyfill<R>;
export let ReadableStream = ReadableStreamPolyfill;
export const AbortController = Global.AbortController;

export type WritableStream<W = any> = WritableStreamPolyfill<W>;
export let WritableStream = WritableStreamPolyfill;
export type ReadableStream<T = any> = ReadableStreamType<T>;
export const ReadableStream = Global.ReadableStream;

export type TransformStream<I = any, O = any> = TransformStreamPolyfill<I, O>;
export let TransformStream = TransformStreamPolyfill;
export type WritableStream<T = any> = WritableStreamType<T>;
export const WritableStream = Global.WritableStream;

if (GLOBAL.ReadableStream && GLOBAL.WritableStream && GLOBAL.TransformStream) {
    ReadableStream = GLOBAL.ReadableStream;
    WritableStream = GLOBAL.WritableStream;
    TransformStream = GLOBAL.TransformStream;
}
export type TransformStream<I = any, O = any> = TransformStreamType<I, O>;
export const TransformStream = Global.TransformStream;
+881 −0

File added.

Preview size limit exceeded, changes collapsed.