feat(core): Add Bun and Deno runtime support, unify core loader, unix-socket support and cross-runtime streaming/tests

This commit is contained in:
2025-11-16 22:50:19 +00:00
parent 32332309dc
commit 6211acd60b
22 changed files with 1447 additions and 92 deletions

View File

@@ -447,15 +447,18 @@ export class SmartRequest<T = any> {
requestDataFunc = (req: any) => {
nodeStream.pipe(req);
};
// Remove the temporary stream reference
delete (this._options as any).__nodeStream;
// Don't delete __nodeStream yet - let CoreRequest implementations handle it
// Node.js will use requestDataFunc, Bun/Deno will convert the stream
} else if ((this._options as any).__rawStreamFunc) {
requestDataFunc = (this._options as any).__rawStreamFunc;
// Remove the temporary function reference
delete (this._options as any).__rawStreamFunc;
// Don't delete __rawStreamFunc yet - let CoreRequest implementations handle it
}
const request = new CoreRequest(this._url, this._options as any, requestDataFunc);
// Clean up temporary properties after CoreRequest has been created
delete (this._options as any).__nodeStream;
delete (this._options as any).__rawStreamFunc;
const response = (await request.fire()) as ICoreResponse<R>;
// Check for 429 status if rate limit handling is enabled