UNPKG

@sern/cli

Version:

Official CLI for @sern/handler

19 lines (17 loc) 598 B
import { resolve } from 'node:path'; import { readFile } from 'node:fs/promises'; // src/utilities/parseTsconfig.ts var cleanJson = (json) => json.replace(/\/\/.*$/gm, "").replace(/\/\*[\s\S]*?\*\//gm, "").replace(/,\s*([}\]])/g, "$1"); var parseTsConfig = async (path) => { const absPath = resolve(path); const fileContent = await readFile(absPath, "utf-8"); const cleanContent = cleanJson(fileContent); try { return JSON.parse(cleanContent); } catch (e) { return null; } }; export { parseTsConfig }; //# sourceMappingURL=out.js.map //# sourceMappingURL=chunk-LLD33MCO.js.map