Skip to main content
Glama
pick-by.ts605 B
/** * Pick object properties that satisfy the predicate function * * @param object - Source object * @param predicate - Function to test each property * @returns New object with properties that passed the test */ export const pickBy = <T extends Record<string, unknown>>( object: T, predicate: (value: unknown, key: string) => boolean, ): Partial<T> => { return Object.keys(object).reduce<Partial<T>>( (result, key) => { const k = key as keyof T; if (predicate(object[k], key)) { result[k] = object[k]; } return result; }, {} as Partial<T>, ); };

Latest Blog Posts

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/sdd330/feishu-mcp-server'

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