type UndiciAgentOptions = ConstructorParameters<UndiciRuntimeDeps["Agent"]>[0];
type UndiciEnvHttpProxyAgentOptions = ConstructorParameters<
UndiciRuntimeDeps["EnvHttpProxyAgent"]
>[0];
type UndiciProxyAgentOptions = ConstructorParameters<UndiciRuntimeDeps["ProxyAgent"]>[0];
// Guarded fetch dispatchers intentionally stay on HTTP/1.1. Undici 8 enables // HTTP/2 ALPN by default, but our guarded paths rely on dispatcher overrides // that have not been reliable on the HTTP/2 path yet. const HTTP1_ONLY_DISPATCHER_OPTIONS = Object.freeze({
allowH2: false as const,
});
function isUndiciRuntimeDeps(value: unknown): value is UndiciRuntimeDeps { return ( typeof value === "object" &&
value !== null && typeof (value as UndiciRuntimeDeps).Agent === "function" && typeof (value as UndiciRuntimeDeps).EnvHttpProxyAgent === "function" && typeof (value as UndiciRuntimeDeps).ProxyAgent === "function" && typeof (value as UndiciRuntimeDeps).fetch === "function"
);
}
export function loadUndiciRuntimeDeps(): UndiciRuntimeDeps { const override = (globalThis as Record<string, unknown>)[TEST_UNDICI_RUNTIME_DEPS_KEY]; if (isUndiciRuntimeDeps(override)) { return override;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.