Skip to main content
Glama
pick.ts577 B
/** * Creates an object composed of the picked object properties * * @param obj - The source object * @param keys - An array of property names to pick * @returns A new object with just the picked properties */ export const pick = < T extends Record<string | symbol, unknown>, K extends keyof T, >( obj?: T, keys: K[] = [], ): Pick<T, K> => { const result = {} as Pick<T, K>; if (!obj) { return result; } for (const key of keys) { if (Object.prototype.hasOwnProperty.call(obj, key)) { result[key] = obj[key]; } } return result; };

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