🌳
pt0/serverF/libFs/readJsonIfExistF.mts
2import { read1File } from "./read1FileF.mts"
3import type { absFileDirPath } from "../../ptDirF.mts"
5export const readJsonIfExist = async (path: absFileDirPath) => {
6 let contents: string
7 try {
8 contents = await read1File(path)
9 } catch {
10 return
11 }
12 return json1ParseCatch(contents)