"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("graceful-fs");
const JSON5 = require("json5");
const stripBom = require("strip-bom");
const util_1 = require("util");
const readFile = util_1.promisify(fs.readFile);
async function readJson5File(filePath) {
    const text = await readFileWithoutBom(filePath);
    return {
        data: JSON5.parse(text),
        text,
    };
}
exports.readJson5File = readJson5File;
async function readJsonFile(filePath) {
    const text = await readFileWithoutBom(filePath);
    return {
        data: JSON.parse(text),
        text,
    };
}
exports.readJsonFile = readJsonFile;
async function readFileWithoutBom(path) {
    return stripBom(await readFile(path, 'utf8'));
}
//# sourceMappingURL=readFile.js.map