Skip to main content
Glama
escape.js663 B
const ATTR_REGEX = /[&"<]/g; const CONTENT_REGEX = /[&<]/g; /** * Note: this method is performance sensitive and has been optimized * https://github.com/sveltejs/svelte/pull/5701 * @param {unknown} value * @returns {string} */ export function escape(value, is_attr = false) { const str = String(value); const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX; pattern.lastIndex = 0; let escaped = ''; let last = 0; while (pattern.test(str)) { const i = pattern.lastIndex - 1; const ch = str[i]; escaped += str.substring(last, i) + (ch === '&' ? '&amp;' : ch === '"' ? '&quot;' : '&lt;'); last = i + 1; } return escaped + str.substring(last); }

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/MatheusgVentura/Project-One'

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