Skip to main content
Glama

mcp-google-sheets

array-zipper.ts907 B
import { isObject } from '@activepieces/shared' import { ProcessorFn } from './types' function getLongestArrayLengthInObject(props: Record<string, unknown>): number { return Math.max( ...Object.values(props).map(value => Array.isArray(value) ? value.length : 1, ), ) } function constructResultForIndex(props: Record<string, unknown>, index: number): Record<string, unknown> { return Object.entries(props).reduce((result, [key, value]) => { result[key] = Array.isArray(value) ? value[index] : value return result }, {} as Record<string, unknown>) } export const arrayZipperProcessor: ProcessorFn = (_property, value) => { if (Array.isArray(value) || !isObject(value)) { return value } return Array.from({ length: getLongestArrayLengthInObject(value) }, (_, index) => constructResultForIndex(value, index), ) }

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/activepieces/activepieces'

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