diff --git a/src/index.ts b/src/index.ts index 23c6832..5366eff 100644 --- a/src/index.ts +++ b/src/index.ts @@ -18,7 +18,7 @@ export function defineTSConfig (tsconfig: TSConfig): TSConfig { return tsconfig } -export async function readPackageJSON (id: string, opts: ResolveOptions = {}): Promise { +export async function readPackageJSON (id?: string, opts: ResolveOptions = {}): Promise { const resolvedPath = await resolvePackageJSON(id, opts) const blob = await fsp.readFile(resolvedPath, 'utf-8') return JSON.parse(blob) as PackageJson @@ -28,7 +28,7 @@ export async function writePackageJSON (path: string, pkg: PackageJson): Promise await fsp.writeFile(path, JSON.stringify(pkg, null, 2)) } -export async function readTSConfig (id: string, opts: ResolveOptions = {}): Promise { +export async function readTSConfig (id?: string, opts: ResolveOptions = {}): Promise { const resolvedPath = await resolveTSConfig(id, opts) const blob = await fsp.readFile(resolvedPath, 'utf-8') const jsonc = await import('jsonc-parser')