Skip to main content
Glama

Prisma MCP Server

Official
by prisma
Apache 2.0
4
44,192
  • Linux
  • Apple
reduce.ts862 B
/* eslint-disable @typescript-eslint/no-unsafe-argument */ import type { L } from 'ts-toolbelt' export type Reducer<I, R> = (acc: R, item: I, pos: number, exit: (acc: R) => R) => R /** * Calls the specified callback function for all the elements in an array. The * return value of the callback function is the accumulated result, and is * provided as an argument in the next call to the callback function. * * (more efficient than native reduce) * * @param list to accumulate * @param reducer to callback * @param acc initial value * @returns */ const reduce = <I, R>(list: L.List<I>, reducer: Reducer<I, R>, acc: R) => { let hasExit = false const exit = (acc: R) => { hasExit = true return acc } for (let i = 0; !hasExit && i < list.length; ++i) { acc = reducer(acc, list[i], i, exit) } return acc } export { reduce }

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

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