summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2026-02-18 12:21:25 -0500
committerDax Raad <[email protected]>2026-02-18 12:21:25 -0500
commita5c15a23e4b352b21c4e0fe8056c302436564107 (patch)
treeb02cf5d72dd360458bac4c573d0267db4af1d650
parent3d189b42a3bdd98675a972524389399d229d96a3 (diff)
downloadopencode-a5c15a23e4b352b21c4e0fe8056c302436564107.tar.gz
opencode-a5c15a23e4b352b21c4e0fe8056c302436564107.zip
core: allow readJson to be called without explicit type parameter
Added default type parameter 'any' to readJson<T> so users can call it without specifying a type when they don't need strict typing. This reduces boilerplate for quick JSON reads where type safety isn't required.
-rw-r--r--packages/opencode/src/util/filesystem.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/opencode/src/util/filesystem.ts b/packages/opencode/src/util/filesystem.ts
index 5c63af030..d2f22be52 100644
--- a/packages/opencode/src/util/filesystem.ts
+++ b/packages/opencode/src/util/filesystem.ts
@@ -30,7 +30,7 @@ export namespace Filesystem {
return readFile(p, "utf-8")
}
- export async function readJson<T>(p: string): Promise<T> {
+ export async function readJson<T = any>(p: string): Promise<T> {
return JSON.parse(await readFile(p, "utf-8"))
}