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.pull/14153/head^2
parent
3d189b42a3
commit
a5c15a23e4
|
|
@ -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"))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue