@proofkit/better-auth
Version:
FileMaker adapter for Better Auth
26 lines (25 loc) • 648 B
JavaScript
import path from "path";
import fs from "fs-extra";
function stripJsonComments(jsonString) {
return jsonString.replace(
/\\"|"(?:\\"|[^"])*"|(\/\/.*|\/\*[\s\S]*?\*\/)/g,
(m, g) => g ? "" : m
).replace(/,(?=\s*[}\]])/g, "");
}
function getTsconfigInfo(cwd, flatPath) {
let tsConfigPath;
{
tsConfigPath = cwd ? path.join(cwd, "tsconfig.json") : path.join("tsconfig.json");
}
try {
const text = fs.readFileSync(tsConfigPath, "utf-8");
return JSON.parse(stripJsonComments(text));
} catch (error) {
throw error;
}
}
export {
getTsconfigInfo,
stripJsonComments
};
//# sourceMappingURL=get-tsconfig-info.js.map