Skip to main content
Glama
getSourceMappingUrl.js649 B
import SOURCEMAPPING_URL from './sourceMappingURL.js'; export default function getSourceMappingUrl ( str ) { var index, substring, url, match; // assume we want the last occurence index = str.lastIndexOf( `${SOURCEMAPPING_URL}=` ); if ( index === -1 ) { return null; } substring = str.substring( index + 17 ); match = /^[^\r\n]+/.exec( substring ); url = match ? match[0] : null; // possibly a better way to do this, but we don't want to exclude whitespace // from the sourceMappingURL because it might not have been correctly encoded if ( url && url.slice( -2 ) === '*/' ) { url = url.slice( 0, -2 ).trim(); } return url; }

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