Skip to main content
Glama
isReadableStreamLike.ts•704 B
import { ReadableStreamLike } from '../types'; import { isFunction } from './isFunction'; export async function* readableStreamLikeToAsyncGenerator<T>(readableStream: ReadableStreamLike<T>): AsyncGenerator<T> { const reader = readableStream.getReader(); try { while (true) { const { value, done } = await reader.read(); if (done) { return; } yield value!; } } finally { reader.releaseLock(); } } export function isReadableStreamLike<T>(obj: any): obj is ReadableStreamLike<T> { // We don't want to use instanceof checks because they would return // false for instances from another Realm, like an <iframe>. return isFunction(obj?.getReader); }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/samihalawa/brevo-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server