mirror of
https://github.com/xtr-dev/rondevu-client.git
synced 2025-12-10 02:43:25 +00:00
Fix fetch binding issue in browser environments
Fixed error: "'fetch' called on an object that does not implement interface Window" The fetch function reference was not properly bound to the global context. Now using globalThis.fetch.bind(globalThis) to ensure correct binding. Bumped version to 0.0.2 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@xtr-dev/rondevu-client",
|
"name": "@xtr-dev/rondevu-client",
|
||||||
"version": "0.0.1",
|
"version": "0.0.2",
|
||||||
"description": "TypeScript client for Rondevu peer signaling and discovery server",
|
"description": "TypeScript client for Rondevu peer signaling and discovery server",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export class RondevuClient {
|
|||||||
constructor(options: RondevuClientOptions) {
|
constructor(options: RondevuClientOptions) {
|
||||||
this.baseUrl = options.baseUrl.replace(/\/$/, ''); // Remove trailing slash
|
this.baseUrl = options.baseUrl.replace(/\/$/, ''); // Remove trailing slash
|
||||||
this.origin = options.origin || new URL(this.baseUrl).origin;
|
this.origin = options.origin || new URL(this.baseUrl).origin;
|
||||||
this.fetchImpl = options.fetch || fetch;
|
this.fetchImpl = options.fetch || globalThis.fetch.bind(globalThis);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user