Skip to main content
Glama
mapChangedLinesToBlocks.ts564 B
import type { Block, LineChange } from './types'; export const mapChangedLinesToBlocks = ( blocks: Block[], changedLines: LineChange[] ): Set<number> => { const changedSet = new Set<number>(); if (!changedLines || changedLines.length === 0) return changedSet; const changedLookup = new Set<number>(changedLines); blocks.forEach((block, index) => { for (let line = block.lineStart; line <= block.lineEnd; line += 1) { if (changedLookup.has(line)) { changedSet.add(index); break; } } }); return changedSet; };

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/aymericzip/intlayer'

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