@kya-os/mcp-i
Version:
The TypeScript MCP framework with identity features built-in
23 lines (22 loc) • 682 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.createFolder = createFolder;
exports.parseJson = parseJson;
const fs_1 = __importDefault(require("fs"));
const json5_1 = __importDefault(require("json5"));
function createFolder(folderPath) {
if (!fs_1.default.existsSync(folderPath)) {
fs_1.default.mkdirSync(folderPath, { recursive: true });
}
}
function parseJson(json) {
try {
return [json5_1.default.parse(json), null];
}
catch (e) {
return [null, e];
}
}