feat: release 2.0.0

This commit is contained in:
2025-04-17 17:23:05 +00:00
parent afa0e2f5dd
commit e6efedc7fe
14 changed files with 1039 additions and 1631 deletions

View File

@@ -1,3 +1,5 @@
import { existsSync } from "@std/fs";
import { Request, type RequestMethod } from "./request.ts";
import type { Response } from "./response.ts";
@@ -13,6 +15,10 @@ export class Client {
*/
get connection(): Promise<Deno.UnixConn> | Promise<Deno.TcpConn> {
if ("path" in this.options) {
const hasDockerSock = existsSync(this.options.path);
if (hasDockerSock === false) {
throw new Error(`Failed to resolve '${this.options.path}' unix connection path.`);
}
return Deno.connect(this.options);
}
return Deno.connect(this.options);