Skip to main content
Glama
detectStrictMode.js•782 B
var multiLineComment = /^\s*\/\*.*?\*\//; var singleLineComment = /^\s*\/\/.*?[\r\n]/; var strictMode = /^\s*(?:"use strict"|'use strict')[ \t]*(?:[\r\n]|;)/; /** * Returns true if the source code is intended to run in strict mode. Does not detect * "use strict" if it occurs in a nested function. * * @param {String} src * @return {Boolean} */ function detectStrictMode(src) { var singleLine; var multiLine; while ((singleLine = singleLineComment.test(src)) || (multiLine = multiLineComment.test(src))) { if (singleLine) { src = src.replace(singleLineComment, ""); } if (multiLine) { src = src.replace(multiLineComment, ""); } } return strictMode.test(src); } module.exports = detectStrictMode;

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/samihalawa/brevo-mcp'

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