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

Function responseFromText

test/lifecycleForceUpdateTrigger.test.js:162–170  ·  view source on GitHub ↗
({ status = 426, body = '', headers = {} } = {})

Source from the content-addressed store, hash-verified

160}
161
162function responseFromText({ status = 426, body = '', headers = {} } = {}) {
163 return {
164 ok: status >= 200 && status < 300,
165 status,
166 headers: { get: (k) => headers[k.toLowerCase()] || headers[k] || null },
167 json: async () => { try { return JSON.parse(body); } catch { return {}; } },
168 text: async () => body,
169 };
170}
171
172// Wait for the microtask spawned by _maybeTriggerForceUpdateFromHeartbeat
173// (the Promise.resolve().then(...) block) to settle, AND for any chained

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected