"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSettingValue = void 0;
const fs_1 = __importDefault(require("fs"));
const path_1 = __importDefault(require("path"));
const os_1 = __importDefault(require("os"));
function getSettingValue(key) {
    let value = {};
    try {
        const keyFilename = path_1.default.join(os_1.default.tmpdir(), `whaticket_settings.json`);
        const jsonData = fs_1.default.readFileSync(keyFilename, "utf8");
        const settings = JSON.parse(jsonData);
        value = settings.find((s) => s.key === key);
    }
    catch (err) {
        console.error("Error reading or parsing data from file:", err);
    }
    return value;
}
exports.getSettingValue = getSettingValue;
