Skip to main content
Glama
ampcome-mcps

Apify Model Context Protocol Server

by ampcome-mcps
generic.ts1.02 kB
/** * Recursively gets the value in a nested object for each key in the keys array. * Each key can be a dot-separated path (e.g. 'a.b.c'). * Returns an object mapping each key to its resolved value (or undefined if not found). */ export function getValuesByDotKeys<T extends object>(obj: T, keys: string[]): Record<string, unknown> { const result: Record<string, unknown> = {}; for (const key of keys) { const path = key.split('.'); let current: unknown = obj; for (const segment of path) { if ( current !== null && typeof current === 'object' && Object.prototype.hasOwnProperty.call(current, segment) ) { // Use index signature to avoid 'any' and type errors current = (current as Record<string, unknown>)[segment]; } else { current = undefined; break; } } result[key] = current; } 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/ampcome-mcps/apify-mcp'

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