Skip to main content
Glama
contains.ts597 B
import { explore } from "./explore.js"; /** * Strict case-sensitive containment check on a JSON path. * Works on values, lists, numbers, booleans, etc. */ export function contains(data: any, jsonpath: string, char: string): boolean { const value = explore(data, jsonpath); // may throw or return undefined depending on your explorer if (value == null) return false; // if value is object or list → stringify if (typeof value === "object") { return JSON.stringify(value).includes(char); } // handle primitive value return String(value).includes(char); }

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/Adsdworld/mcp-json-navigator'

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