Skip to main content
Glama
getBuiltUnmergedDictionariesPath.ts869 B
import { existsSync, mkdirSync } from 'node:fs'; import { basename } from 'node:path'; import { normalizePath } from '@intlayer/config'; import type { IntlayerConfig } from '@intlayer/types'; import fg from 'fast-glob'; /** * This function generates a list of dictionaries in the main directory */ export const getBuiltUnmergedDictionariesPath = async ( configuration: IntlayerConfig, excludeKeys: string[] = [] ) => { const { unmergedDictionariesDir, mainDir } = configuration.content; // Create main directory if it doesn't exist if (!existsSync(mainDir)) { mkdirSync(mainDir, { recursive: true }); } const dictionariesPath: string[] = await fg( `${normalizePath(unmergedDictionariesDir)}/**/*.json` ); return dictionariesPath.filter((path) => { const key = basename(path, '.json'); return !excludeKeys.includes(key); }); };

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