Function
resolveResourceContent
(
uri: string,
content: typeof ReadResourceResult.Type | string | Uint8Array
)
Source from the content-addressed store, hash-verified
| 2269 | ) |
| 2270 | |
| 2271 | const resolveResourceContent = ( |
| 2272 | uri: string, |
| 2273 | content: typeof ReadResourceResult.Type | string | Uint8Array |
| 2274 | ): typeof ReadResourceResult.Type => { |
| 2275 | if (typeof content === "string") { |
| 2276 | return { |
| 2277 | contents: [{ |
| 2278 | uri, |
| 2279 | text: content |
| 2280 | }] |
| 2281 | } |
| 2282 | } else if (content instanceof Uint8Array) { |
| 2283 | return { |
| 2284 | contents: [{ |
| 2285 | uri, |
| 2286 | blob: content |
| 2287 | }] |
| 2288 | } |
| 2289 | } |
| 2290 | return content |
| 2291 | } |
| 2292 | |
| 2293 | const getClientSession = ( |
| 2294 | sessions: Sessions, |
Tested by
no test coverage detected