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.
This commit is contained in:
Dax Raad
2026-02-18 12:21:25 -05:00
parent 3d189b42a3
commit a5c15a23e4

View File

@@ -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"))
}