MCPcopy Create free account
hub / github.com/EvoMap/evolver / readMailboxStateFile

Function readMailboxStateFile

src/proxy/mailbox/state.js:118–126  ·  view source on GitHub ↗

* @param {string} stateFile * @returns {Record |null}

(stateFile)

Source from the content-addressed store, hash-verified

116 * @returns {Record<string, unknown>|null}
117 */
118function readMailboxStateFile(stateFile) {
119 try {
120 if (!fs.existsSync(stateFile)) return null;
121 const parsed = JSON.parse(fs.readFileSync(stateFile, 'utf8'));
122 return isPlainState(parsed) ? parsed : null;
123 } catch {
124 return null;
125 }
126}
127
128function replaceStateFile(stateFile, state) {
129 const dir = path.dirname(stateFile);

Callers 3

_loadStateMethod · 0.85

Calls 2

isPlainStateFunction · 0.85
parseMethod · 0.80

Tested by

no test coverage detected