"use strict";
const path = require('path');
const fs = require('fs');
const pnpmPkgJson_1 = require('../pnpmPkgJson');
function read(storePath) {
    const storeJsonPath = path.join(storePath, 'store.json');
    try {
        return JSON.parse(fs.readFileSync(storeJsonPath, 'utf8'));
    }
    catch (err) {
        return {
            pnpm: pnpmPkgJson_1.default.version,
            packages: {}
        };
    }
}
exports.read = read;
function save(storePath, storeJson) {
    const storeJsonPath = path.join(storePath, 'store.json');
    fs.writeFileSync(storeJsonPath, JSON.stringify(storeJson, null, 2), 'utf8');
}
exports.save = save;
//# sourceMappingURL=storeJsonController.js.map